| | |
| | | <script> |
| | | import { |
| | | showToast, |
| | | showModal |
| | | showModal, |
| | | showError, |
| | | showInfo |
| | | } from "@/comm/utils.js" |
| | | // import OIFabric from "@/components/oi-fabric/index.vue" |
| | | import { |
| | |
| | | }, |
| | | |
| | | { |
| | | method: "move_canvas", |
| | | method: "move_pt_center", |
| | | param: { |
| | | x: infoAgv.x, |
| | | y: infoAgv.y |
| | |
| | | bgProgressPercent: 0, |
| | | bgLoading: false |
| | | }) |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | async loadAgvState() { |
| | |
| | | const info = await getAgvState(this.vehicleIp) |
| | | return info |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | return {} |
| | | } |
| | | }, |
| | |
| | | const info = await stations(this.vehicleIp) |
| | | return info.station_list || [] |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | return [] |
| | | } |
| | | }, |
| | |
| | | const info = await getMapUrl(this.vehicleIp, id) |
| | | return info |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | return {} |
| | | } |
| | | }, |
| | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | return { |
| | | Public: [], |
| | | Stations: [] |
| | |
| | | ]) |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | |
| | | } |
| | | }, |
| | |
| | | param: item, |
| | | }]) |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | async removeTeachingModeData(data) { |
| | |
| | | await delTeachingModeData(this.vehicleIp, data) |
| | | this.reloadTeachingMode() |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | clickPublicTeaching() { |
| | |
| | | }]) |
| | | this.mapOperationType = 'public_teaching' |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | async stationAdd(item) { |
| | |
| | | |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | async teachingStart(mode) { |
| | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | |
| | | }, |
| | |
| | | this.askTeachingBiDirection(this.teachingModeCur) |
| | | } |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | |
| | | }, |
| | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | |
| | |
| | | }]) |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | |
| | |
| | | stationTeaching.splice(curIndex, 1) |
| | | _this.teachingStart("Stations") |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | |
| | | } else { |
| | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | clickTeachingEnd() { |
| | |
| | | _this.reloadTeachingMode() |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | } else { |
| | | _this.teachingStatus = "save" |
| | |
| | | |
| | | this.teachingStatus = "save" |
| | | try {} catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | |
| | | }, |
| | |
| | | |
| | | } |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | |
| | |
| | | |
| | | } |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | askTeachingBiDirection(teachingMode) { |
| | |
| | | this.reloadTeachingMode() |
| | | this.teachingStatus = "end" |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | clickBackTeaching() { |
| | |
| | | method: "edit_station_pos", |
| | | param: this.stationEdit |
| | | }, { |
| | | method: "move_canvas", |
| | | method: "move_pt_center", |
| | | param: { |
| | | x: agv.x, |
| | | y: agv.y |
| | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | |
| | | }, |
| | |
| | | method: "update_station", |
| | | param: [this.stationEdit] |
| | | }, { |
| | | method: "move_canvas", |
| | | method: "move_pt_center", |
| | | param: { |
| | | x: this.stationEdit.x, |
| | | y: this.stationEdit.y |
| | |
| | | method: "update_station", |
| | | param: [this.stationEdit] |
| | | }, { |
| | | method: "move_canvas", |
| | | method: "move_pt_center", |
| | | param: { |
| | | x: this.stationEdit.x, |
| | | y: this.stationEdit.y |
| | |
| | | method: "update_station", |
| | | param: [this.stationEdit] |
| | | }, { |
| | | method: "move_canvas", |
| | | method: "move_pt_center", |
| | | param: { |
| | | x: this.stationEdit.x, |
| | | y: this.stationEdit.y |
| | |
| | | method: "update_station", |
| | | param: [this.stationEdit] |
| | | }, { |
| | | method: "move_canvas", |
| | | method: "move_pt_center", |
| | | param: { |
| | | x: this.stationEdit.x, |
| | | y: this.stationEdit.y |
| | |
| | | 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() { |
| | |
| | | ]) |
| | | console.log(this.ctxDataStr) |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex) |
| | | } |
| | | }, |
| | | async clickPositionStation() { |
| | |
| | | param: [this.stationEdit] |
| | | }, |
| | | { |
| | | method: "move_canvas", |
| | | method: "move_pt_center", |
| | | param: { |
| | | x: infoAgv.x, |
| | | y: infoAgv.y |
| | |
| | | |
| | | ]) |
| | | } 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, "确定") |
| | | }, |
| | | |
| | | |