chenrui 2 yıl önce
ebeveyn
işleme
164e94e45d

+ 11 - 3
src/views/power/equipment/equipmentManagement.vue

@@ -40,7 +40,7 @@
         </a-form>
       </div>
       <div class="table-operator">
-        <a-button type="primary" class="button-error" @click="openModal = true">添加设备</a-button>
+        <a-button type="primary" class="button-error" @click="addEquipment">添加设备</a-button>
       </div>
       <!-- 列表 -->
       <s-table
@@ -124,6 +124,11 @@ export default {
     this.getCityList()
   },
   methods: {
+    // 新增设备
+    addEquipment () {
+      this.itemId = ''
+      this.openModal = true
+    },
     // 获取所属省份
     getCityList () {
       getAreaCgj({ type: '2' }).then(res => {
@@ -163,10 +168,11 @@ export default {
     },
     handleDel (row) {
       const _this = this
-      this.$warning({
+      this.$confirm({
         title: '提示',
         content: '删除该设备后,所有绑定数据将被清除,并且不能继续操作。',
         okText: '删除',
+        cancelText: '取消',
         onOk () {
           handDeviceDel({ id: row.id }).then(res => {
             if (res.status == 200) {
@@ -175,7 +181,9 @@ export default {
             }
           })
         },
-        onCancel () {}
+        onCancel () {
+          console.log('取消删除')
+        }
       })
     },
     //  时间  change