| | |
| | | <view class="item-title">{{item.name}}</view> |
| | | <view class="item-text">{{getTeachingSrcDst(item)}}</view> |
| | | <template v-slot:right> |
| | | <view class="btn-del" @click="clickDelTeachingMode('Public',item)">删除</view> |
| | | <view class="btn-del" @click="clickDelTeachingMode('Public',item)">{{translate("delete")}} |
| | | </view> |
| | | </template> |
| | | </uni-swipe-action-item> |
| | | <uni-swipe-action-item class="list-item" |
| | |
| | | <view class="item-title">{{item.name}}</view> |
| | | <view class="item-text">{{getTeachingSrcDst(item)}}</view> |
| | | <template v-slot:right> |
| | | <view class="btn-del" @click="clickDelTeachingMode('Stations',item)">删除</view> |
| | | <view class="btn-del" @click="clickDelTeachingMode('Stations',item)">{{translate("delete")}} |
| | | </view> |
| | | </template> |
| | | </uni-swipe-action-item> |
| | | </uni-swipe-action> |
| | |
| | | showToast, |
| | | showModal, |
| | | session, |
| | | showError, |
| | | showInfo |
| | | } from "@/comm/utils.js" |
| | | import { |
| | | Button |
| | |
| | | |
| | | } catch (ex) { |
| | | |
| | | this.showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | }, |
| | | |
| | |
| | | this.teachingPublic = data?.Public || [] |
| | | this.teachingStation = data?.Stations || [] |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | }, |
| | | clickAddTeaching() { |
| | |
| | | const list = item.pos_list || [] |
| | | let tip = "" |
| | | if (list.length > 1) { |
| | | tip = `(${Number(list[0].x).toFixed(2)},${Number(list[0].y).toFixed(2)}) (${Number(list[1].x).toFixed(2)},${Number(list[1].y).toFixed(2)})` |
| | | tip = |
| | | `(${Number(list[0].x).toFixed(2)},${Number(list[0].y).toFixed(2)}) (${Number(list[1].x).toFixed(2)},${Number(list[1].y).toFixed(2)})` |
| | | } |
| | | if (list.length == 1) { |
| | | tip = `(${Number(list[0].x).toFixed(2)},${Number(list[0].y).toFixed(2)})` |
| | |
| | | return tip |
| | | }, |
| | | clickDelTeachingMode(mode, item) { |
| | | showModal("确认删除示教", "警告").then((res) => { |
| | | showModal({ |
| | | title: "", |
| | | content: `${this.translate('ask_deleting_teaching')}`, |
| | | confirmText: this.translate('ok'), |
| | | cancelText: this.translate('cancel'), |
| | | }).then((res) => { |
| | | if (res) { |
| | | this.deleteTeachingMode(mode, item) |
| | | } |
| | |
| | | } |
| | | |
| | | } catch (ex) { |
| | | this.showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | |
| | | }, |
| | | |
| | | showError(ex) { |
| | | let exStr = JSON.stringify(ex) |
| | | if (exStr == "{}") |
| | | exStr = ex |
| | | let tip = typeof ex.msg == "string" ? ex.msg : exStr |
| | | showModal(tip, "错误", false) |
| | | translate(t) { |
| | | if (typeof this.$t == "function") return this.$t(`page.${t}`) |
| | | else return t; |
| | | }, |
| | | |
| | | |
| | |
| | | |
| | | .item-title { |
| | | font-size: 32rpx; |
| | | padding: 10rpx 20rpx; |
| | | padding: 10rpx 20rpx; |
| | | } |
| | | |
| | | |