| | |
| | | <uni-popup-dialog type="info" cancelText="取消" confirmText="确定" title="示教更新" |
| | | @confirm="dialogTeachingUpdateConfirm" @close="dialogTeachingUpdateClose"> |
| | | |
| | | <view> |
| | | |
| | | <radio-group @change="radioTeachinMainRoadChange"> |
| | | <label class="radio"> |
| | | <radio :value="1" :checked="selectTeachingMode.main_road == 1" />主路 |
| | | </label> |
| | | <label class="radio"> |
| | | <radio :value="0" :checked="selectTeachingMode.main_road != 1" />支路 |
| | | </label> |
| | | </radio-group> |
| | | <view class="popup-dialog-content"> |
| | | <view class="popup-content-item"> |
| | | <radio-group @change="radioTeachinMainRoadChange"> |
| | | <label class="radio"> |
| | | <radio :value="1" :checked="selectTeachingMode.main_road == 1" />主路 |
| | | </label> |
| | | <label class="radio"> |
| | | <radio :value="0" :checked="selectTeachingMode.main_road != 1" />支路 |
| | | </label> |
| | | </radio-group> |
| | | |
| | | |
| | | </view> |
| | | <view class="popup-content-item"> |
| | | <radio-group @change="radioTeachinBidirectionChange"> |
| | | <label class="radio"> |
| | | <radio :value="1" :checked="selectTeachingMode.bidirection == 1" />双向 |
| | | </label> |
| | | <label class="radio"> |
| | | <radio :value="0" :checked="selectTeachingMode.bidirection != 1" />单向 |
| | | </label> |
| | | </radio-group> |
| | | |
| | | </view> |
| | | </view> |
| | | <view> |
| | | <radio-group @change="radioTeachinBidirectionChange"> |
| | | <label class="radio"> |
| | | <radio :value="1" :checked="selectTeachingMode.bidirection == 1" />双向 |
| | | </label> |
| | | <label class="radio"> |
| | | <radio :value="0" :checked="selectTeachingMode.bidirection != 1" />单向 |
| | | </label> |
| | | </radio-group> |
| | | |
| | | </view> |
| | | |
| | | </uni-popup-dialog> |
| | | </uni-popup> |
| | | |
| | |
| | | unlinked: false, |
| | | showTeachingPathFlag: true, |
| | | curTeachingPathFlag: false, |
| | | curTeachingPathTime: 0, |
| | | curMapInfo: { |
| | | proportion: 1, |
| | | img_proportion: 1, |
| | |
| | | if (this.mapOperationStatus == 'end' || this.mapOperationStatus == |
| | | 'save') { |
| | | try { |
| | | // await delTeachingMode(this.vehicleIp, [this.teachingModeCur]) |
| | | await deleteSplitTeachingData(this.vehicleIp, this.teachingModeCur |
| | | .edge_name, this.teachingModeCur.name) |
| | | await delTeachingMode(this.vehicleIp, [this.teachingModeCur]) |
| | | |
| | | listDataStr.push({ |
| | | method: "remove_teaching_path", |
| | |
| | | name: param.data?.name || "", |
| | | point: param.point, |
| | | main_road: param.data?.main_road || 0, |
| | | bidirection: param.data?.name || 0, |
| | | bidirection: param.data?.bidirection || 0, |
| | | } |
| | | console.log(this.selectTeachingMode.main_road, this.selectTeachingMode) |
| | | } |
| | | this.$refs.refPopupOperateTeaching.open("bottom") |
| | | } else if (param.method == "cancel_positioning_agv") { |
| | |
| | | } |
| | | }) |
| | | if (list.length > 0) { |
| | | this.curTeachingPathTime += 1 |
| | | this.curTeachingPathFlag = true |
| | | if (this.curTeachingPathTime % 5 == 0) { |
| | | const listStationCtxData = await this.getRefreshStationCtxData() || [] |
| | | if (listStationCtxData.length > 0) { |
| | | listCtrData.push(...listStationCtxData) |
| | | } |
| | | } |
| | | } else { |
| | | if (this.curTeachingPathFlag) { |
| | | this.curTeachingPathFlag = false |
| | | this.curTeachingPathTime = 0 |
| | | |
| | | const teaching = await this.loadTeachingMode() |
| | | |
| | | const publicOld = this.teachingMode.Public || [] |
| | |
| | | const stationAdd = [] |
| | | for (let i in publicNew) { |
| | | const item = publicNew[i] |
| | | const curIndex = publicOld.findIndex((a) => a.name == item.name) |
| | | console.log(curIndex, item) |
| | | const curIndex = publicOld.findIndex((a) => a.name == item.name && a.edge_name == item.edge_name ) |
| | | |
| | | if (curIndex < 0) { |
| | | publicAdd.push(item) |
| | | publicOld.push(item) |
| | |
| | | show: this.showTeachingPathFlag |
| | | } |
| | | }) |
| | | } |
| | | const listStationCtxData = await this.getRefreshStationCtxData() || [] |
| | | if (listStationCtxData.length > 0) { |
| | | listCtrData.push(...listStationCtxData) |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | }, |
| | | async getRefreshStationCtxData() { |
| | | try { |
| | | const listCtrData = [] |
| | | const listOld = this.stationList |
| | | const listId = listOld.map((a) => a.stationID) |
| | | const stationLst = await this.loadStations() |
| | | const listNew = stationLst.filter((a) => { |
| | | return !listId.includes(a.stationID) |
| | | }) |
| | | // console.log(listId.length,listNew.length,stationLst.length) |
| | | // console.log(listId) |
| | | if (listId.length + listNew.length > stationLst.length) { |
| | | const listId2 = stationLst.map((a) => a.stationID) |
| | | |
| | | const listRemove = listOld.filter((a) => { |
| | | return !listId2.includes(a.stationID) |
| | | }) |
| | | if (listRemove.length > 0) { |
| | | listCtrData.push({ |
| | | method: "remove_station", |
| | | param: listRemove |
| | | }) |
| | | this.stationList = stationLst |
| | | } |
| | | } |
| | | if (listNew.length > 0) { |
| | | listCtrData.push({ |
| | | method: "add_station", |
| | | param: listNew |
| | | }) |
| | | this.stationList = stationLst |
| | | } |
| | | return listCtrData |
| | | } catch (ex) { |
| | | |
| | | showToast(ex) |
| | | return [] |
| | | } |
| | | }, |
| | | askTeachingBiDirection(teachingMode) { |
| | | showModal("选择当前示教路线类型?", "示教结束", true, "双向路线", |
| | | "单向路线").then((res) => { |
| | |
| | | if (res) { |
| | | try { |
| | | this.loading = true |
| | | //await delTeachingMode(_this.vehicleIp, [_this.teachingModeCur]) |
| | | await deleteSplitTeachingData(_this.vehicleIp, _this.teachingModeCur.edge_name, |
| | | _this.teachingModeCur.name) |
| | | await delTeachingMode(_this.vehicleIp, [_this.teachingModeCur]) |
| | | _this.mapOperationStatus = "" |
| | | const listDataStr = [] |
| | | listDataStr.push({ |
| | |
| | | this.teachingModeCur.teaching_flag = 1 |
| | | this.teachingModeCur.mode = "Public" |
| | | this.teachingModeCur.name = "" |
| | | const res = await teachingModeFlag(this.vehicleIp, this.teachingModeCur) |
| | | const res = await teachingModeFlag(this.vehicleIp, this |
| | | .teachingModeCur) |
| | | if (val == 1) |
| | | showToast("已将示教切换成双向模式") |
| | | else if (val == 2) |
| | |
| | | // param: this.selectTeachingMode, |
| | | // }]) |
| | | }, |
| | | radioTeachinMainRoadChange(e) { |
| | | radioTeachinMainRoadChange(evt) { |
| | | this.selectTeachingMode.main_road = evt.detail.value |
| | | }, |
| | | radioTeachinBidirectionChange(evt) { |
| | |
| | | uni.showLoading({ |
| | | title: "删除示教中" |
| | | }) |
| | | await deleteSplitTeachingData(this.vehicleIp, item.edge_name, item.name) |
| | | await deleteSplitTeachingData(this.vehicleIp, item |
| | | .edge_name, item.name) |
| | | //await delTeachingMode(this.vehicleIp, [item]) |
| | | this.ctxDataStr = |
| | | JSON.stringify( |
| | |
| | | uni.showLoading({ |
| | | title: "删除示教数据中" |
| | | }) |
| | | await deleteSplitTeachingData(this.vehicleIp, data.edge_name, data.name) |
| | | //await delTeachingModeData(this.vehicleIp, data) |
| | | await delTeachingModeData(this.vehicleIp, data) |
| | | showToast("删除示教成功") |
| | | this.reloadTeachingMode() |
| | | } catch (ex) { |
| | |
| | | height: 32px; |
| | | line-height: 32px; |
| | | text-align: center; |
| | | box-shadow: 0px 2px 8px 0px #0000000C; |
| | | } |
| | | |
| | | .switch-button-checked { |
| | |
| | | background-color: transparent; |
| | | } |
| | | |
| | | .popup-dialog-content { |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .popup-content-item { |
| | | padding: 10rpx; |
| | | } |
| | | } |
| | | |
| | | .popup-content-menu { |
| | | margin-top: 140rpx; |
| | | margin-left: 225rpx; |