cuiqian2004
2025-09-19 d8743368ffda9bc0fb2c6818f695a9a6b1079e57
pages/map/teaching.vue
@@ -234,7 +234,9 @@
<script>
   import {
      showToast,
      showModal
      showModal,
      showError,
      showInfo
   } from "@/comm/utils.js"
   // import OIFabric from "@/components/oi-fabric/index.vue"
   import {
@@ -463,7 +465,7 @@
                  },
                  {
                     method: "move_canvas",
                     method: "move_pt_center",
                     param: {
                        x: infoAgv.x,
                        y: infoAgv.y
@@ -478,7 +480,7 @@
                  bgProgressPercent: 0,
                  bgLoading: false
               })
               this.showError(ex)
               showError(ex)
            }
         },
         async loadAgvState() {
@@ -486,7 +488,7 @@
               const info = await getAgvState(this.vehicleIp)
               return info
            } catch (ex) {
               this.showError(ex)
               showError(ex)
               return {}
            }
         },
@@ -495,7 +497,7 @@
               const info = await stations(this.vehicleIp)
               return info.station_list || []
            } catch (ex) {
               this.showError(ex)
               showError(ex)
               return []
            }
         },
@@ -504,7 +506,7 @@
               const info = await getMapUrl(this.vehicleIp, id)
               return info
            } catch (ex) {
               this.showError(ex)
               showError(ex)
               return {}
            }
         },
@@ -519,7 +521,7 @@
               }
            } catch (ex) {
               this.showError(ex)
               showError(ex)
               return {
                  Public: [],
                  Stations: []
@@ -540,7 +542,7 @@
               ])
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
@@ -701,7 +703,7 @@
                  param: item,
               }])
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
         async removeTeachingModeData(data) {
@@ -709,7 +711,7 @@
               await delTeachingModeData(this.vehicleIp, data)
               this.reloadTeachingMode()
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
         clickPublicTeaching() {
@@ -751,7 +753,7 @@
               }])
               this.mapOperationType = 'public_teaching'
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
         async stationAdd(item) {
@@ -768,7 +770,7 @@
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
         async teachingStart(mode) {
@@ -812,7 +814,7 @@
               }
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
@@ -830,7 +832,7 @@
                  this.askTeachingBiDirection(this.teachingModeCur)
               }
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
@@ -856,7 +858,7 @@
               }
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
@@ -870,7 +872,7 @@
               }])
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
@@ -900,7 +902,7 @@
                              stationTeaching.splice(curIndex, 1)
                              _this.teachingStart("Stations")
                           } catch (ex) {
                              this.showError(ex)
                              showError(ex)
                           }
                        } else {
@@ -925,7 +927,7 @@
               }
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
         clickTeachingEnd() {
@@ -948,7 +950,7 @@
                     _this.reloadTeachingMode()
                  } catch (ex) {
                     this.showError(ex)
                     showError(ex)
                  }
               } else {
                  _this.teachingStatus = "save"
@@ -960,7 +962,7 @@
            this.teachingStatus = "save"
            try {} catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
@@ -1145,7 +1147,7 @@
               }
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
@@ -1172,7 +1174,7 @@
               }
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
         askTeachingBiDirection(teachingMode) {
@@ -1193,7 +1195,7 @@
               this.reloadTeachingMode()
               this.teachingStatus = "end"
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
         clickBackTeaching() {
@@ -1233,7 +1235,7 @@
                     method: "edit_station_pos",
                     param: this.stationEdit
                  }, {
                     method: "move_canvas",
                     method: "move_pt_center",
                     param: {
                        x: agv.x,
                        y: agv.y
@@ -1243,7 +1245,7 @@
               }
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
@@ -1267,7 +1269,7 @@
               method: "update_station",
               param: [this.stationEdit]
            }, {
               method: "move_canvas",
               method: "move_pt_center",
               param: {
                  x: this.stationEdit.x,
                  y: this.stationEdit.y
@@ -1282,7 +1284,7 @@
               method: "update_station",
               param: [this.stationEdit]
            }, {
               method: "move_canvas",
               method: "move_pt_center",
               param: {
                  x: this.stationEdit.x,
                  y: this.stationEdit.y
@@ -1295,7 +1297,7 @@
               method: "update_station",
               param: [this.stationEdit]
            }, {
               method: "move_canvas",
               method: "move_pt_center",
               param: {
                  x: this.stationEdit.x,
                  y: this.stationEdit.y
@@ -1308,7 +1310,7 @@
               method: "update_station",
               param: [this.stationEdit]
            }, {
               method: "move_canvas",
               method: "move_pt_center",
               param: {
                  x: this.stationEdit.x,
                  y: this.stationEdit.y
@@ -1399,14 +1401,14 @@
                  method: "update_agv_state",
                  param: infoAgv
               }, {
                  method: "move_canvas",
                  method: "move_pt_center",
                  param: {
                     x: infoAgv.x,
                     y: infoAgv.y
                  }
               }])
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
         async clickShowTeachingPath() {
@@ -1439,7 +1441,7 @@
               ])
               console.log(this.ctxDataStr)
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
         async clickPositionStation() {
@@ -1459,7 +1461,7 @@
                     param: [this.stationEdit]
                  },
                  {
                     method: "move_canvas",
                     method: "move_pt_center",
                     param: {
                        x: infoAgv.x,
                        y: infoAgv.y
@@ -1469,16 +1471,8 @@
               ])
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
         showError(ex) {
            let exStr = JSON.stringify(ex)
            if (exStr == "{}")
               exStr = ex
            let tip = typeof ex.msg == "string" ? ex.msg : exStr
            showModal(tip, "错误", false, "确定")
         },