cuiqian2004
4 天以前 2af5f043b60c1f7ac38ecccc8f5bf44743134325
pages/station/delete.vue
@@ -10,17 +10,17 @@
                  <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>
@@ -75,7 +75,7 @@
            } catch (ex) {
               showError(ex)
               showError(ex, this.translate('error'))
            }
         },
         async loadStations() {
@@ -83,7 +83,7 @@
               const info = await stations(this.ip)
               return info.station_list || []
            } catch (ex) {
               showError(ex)
               showError(ex, this.translate('error'))
               return []
            }
         },
@@ -122,10 +122,15 @@
            }
            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)
               }
@@ -136,22 +141,25 @@
         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>