| | |
| | | |
| | | <view class="item-title">{{item.name}}</view> |
| | | <view class="item-text"> |
| | | 角度:{{Math.round(item.angle *180/3.14)}},坐标({{Math.round(Number(item.x)*100)/100}},{{Math.round(Number(item.y)*100)/100}}) |
| | | {{translate("angle")}}:{{Math.round(item.angle *180/3.14)}},{{translate("coordinates")}}:({{Math.round(Number(item.x)*100)/100}},{{Math.round(Number(item.y)*100)/100}}) |
| | | </view> |
| | | </view> |
| | | </label> |
| | | </checkbox-group> |
| | | </view> |
| | | <view class="bottom"> |
| | | <checkbox :checked="checkedAll" @click="onSelectAll">全选</checkbox> |
| | | <checkbox :checked="checkedAll" @click="onSelectAll">{{translate("select_all")}}</checkbox> |
| | | <view class="button-group"> |
| | | |
| | | <a-button type="primary" class="button" @click="clickDelelte">删除</a-button> |
| | | <a-button type="primary" class="button" @click="clickDelelte">{{translate("delete")}}</a-button> |
| | | </view> |
| | | |
| | | |
| | |
| | | onBackPress() { |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | eventChannel.emit('delete_finish', this.listDel); |
| | | |
| | | |
| | | }, |
| | | methods: { |
| | | async loadData() { |
| | |
| | | |
| | | } catch (ex) { |
| | | |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | } |
| | | }, |
| | | async loadStations() { |
| | |
| | | const info = await stations(this.ip) |
| | | return info.station_list || [] |
| | | } catch (ex) { |
| | | showError(ex) |
| | | showError(ex, this.translate('error')) |
| | | return [] |
| | | } |
| | | }, |
| | |
| | | |
| | | } |
| | | if (list.length === 0) { |
| | | showInfo("未选择站点!") |
| | | showToast(this.translate("no_selected_stations")) |
| | | return |
| | | } |
| | | showModal("删除选择的站点", "是否确认删除?").then((res) => { |
| | | showModal({ |
| | | title: this.translate("ask_confirm_remove"), |
| | | content: `${this.translate('delete_selected_station')}`, |
| | | confirmText: this.translate('remove'), |
| | | cancelText: this.translate('cancel'), |
| | | }).then((res) => { |
| | | if (res) { |
| | | _this.stationDelete(list) |
| | | } |
| | |
| | | async stationDelete(list) { |
| | | try { |
| | | uni.showLoading({ |
| | | title: "正在删除站点" |
| | | title: this.translate("deleting_station") |
| | | }) |
| | | |
| | | await delStation(this.ip, list) |
| | | this.stationList = await this.loadStations() || [] |
| | | |
| | | this.listDel.push(...list) |
| | | showToast("删除站点成功") |
| | | showToast(this.translate("delete_station_success")) |
| | | } catch (ex) { |
| | | |
| | | showError(ex) |
| | | |
| | | showError(ex, this.translate('error')) |
| | | } finally { |
| | | uni.hideLoading() |
| | | } |
| | | }, |
| | | |
| | | translate(t) { |
| | | if (typeof this.$t == "function") return this.$t(`page.${t}`) |
| | | else return t; |
| | | }, |
| | | } |
| | | } |
| | | </script> |