| | |
| | | } else if (this.mapOperationType == "public_teaching" || this.mapOperationType == "station_teaching") { |
| | | |
| | | if (this.teachingStatus) { |
| | | showModal("已记录的路径将会被删除。", "是否要退出示教?").then((res) => { |
| | | showModal({ |
| | | title: `${this.translate('ask_exit_teaching')}`, |
| | | content: `${this.translate('recorded_path_will_be_deleted')}`, |
| | | confirmText: this.translate('yes'), |
| | | cancelText: this.translate('no'), |
| | | }).then((res) => { |
| | | if (res) { |
| | | this.mapOperationType = "" |
| | | } |
| | |
| | | |
| | | } catch (ex) { |
| | | |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | }, |
| | | async loadAgvState() { |
| | |
| | | const info = await getAgvState(this.ip) |
| | | return info |
| | | } catch (ex) { |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | return {} |
| | | } |
| | | }, |
| | |
| | | const info = await stations(this.ip) |
| | | return info.station_list || [] |
| | | } catch (ex) { |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | return [] |
| | | } |
| | | }, |
| | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | |
| | | }, |
| | |
| | | this.askTeachingBiDirection(this.teachingModeCur) |
| | | } |
| | | } catch (ex) { |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | |
| | | }, |
| | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | }, |
| | | async clickTeachingStart() { |
| | |
| | | |
| | | const curIndex = stationTeaching.findIndex((a) => a.src_dst == srcDst) |
| | | if (curIndex > -1) { |
| | | showModal("该站点间已有示教路径,重新记录会覆盖之前的路径。", "是否要重新记录?").then(async (res) => { |
| | | showModal({ |
| | | title: "是否要重新记录?", |
| | | content: "该站点间已有示教路径,重新记录会覆盖之前的路径。", |
| | | confirmText: this.translate('yes'), |
| | | cancelText: this.translate('no'), |
| | | }).then(async (res) => { |
| | | if (res) { |
| | | try { |
| | | _this.teachingStatus = "teaching" |
| | |
| | | stationTeaching.splice(curIndex, 1) |
| | | _this.teachingStart("Stations") |
| | | } catch (ex) { |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | |
| | | } else { |
| | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | }, |
| | | clickTeachingEnd() { |
| | |
| | | }, |
| | | clickTeachingReset() { |
| | | const _this = this |
| | | showModal("已记录的路径将会被删除。", "是否要重新记录?").then(async (res) => { |
| | | showModal({ |
| | | title: `${this.translate('ask_exit_teaching')}`, |
| | | content: `${this.translate('recorded_path_will_be_deleted')}`, |
| | | confirmText: this.translate('yes'), |
| | | cancelText: this.translate('no'), |
| | | }).then(async (res) => { |
| | | if (res) { |
| | | try { |
| | | await delTeachingMode(_this.ip, [_this.teachingModeCur]) |
| | |
| | | _this.teachingMode = await getTeachingMode(_this.ip) |
| | | |
| | | } catch (ex) { |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | } else { |
| | | _this.teachingStatus = "save" |
| | |
| | | |
| | | this.teachingStatus = "save" |
| | | try {} catch (ex) { |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | |
| | | }, |
| | |
| | | |
| | | } |
| | | } catch (ex) { |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | }, |
| | | async clickNoCalibration() { |
| | |
| | | |
| | | } |
| | | } catch (ex) { |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | }, |
| | | askTeachingBiDirection(teachingMode) { |
| | | showModal("是否将当前示教路线设置为双向?", "示教结束").then((res) => { |
| | | showModal({ |
| | | title: "示教结束", |
| | | content: "是否将当前示教路线设置为双向?", |
| | | confirmText: this.translate('yes'), |
| | | cancelText: this.translate('no'), |
| | | }).then((res) => { |
| | | if (res) { |
| | | teachingMode.bidirection = "1" |
| | | } else { |
| | |
| | | this.teachingMode = await getTeachingMode(this.ip) |
| | | this.teachingStatus = "end" |
| | | } catch (ex) { |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | }, |
| | | clickBackTeaching() { |
| | | this.$refs.refPopupCalibration.close() |
| | | this.teachingStatus = "" |
| | | }, |
| | | |
| | | translate(t) { |
| | | if (typeof this.$t == "function") return this.$t(`page.${t}`) |
| | | else return t; |
| | | }, |
| | | } |
| | | } |
| | | </script> |