魏熙美 6 年之前
父節點
當前提交
a5b77d4c94
共有 1 個文件被更改,包括 24 次插入21 次删除
  1. 24
    21
      VUECODE/smart-property-manage/src/views/systemResources/app/index.vue

+ 24
- 21
VUECODE/smart-property-manage/src/views/systemResources/app/index.vue 查看文件

@@ -118,13 +118,14 @@
118 118
       </el-tab-pane>
119 119
       <el-tab-pane label="公区监控" name="monitoring">
120 120
         <span style="display: flex; justify-content: center;">可配置项</span>
121
-        <div style="display: flex; justify-content: center; margin-top: 20px;">
121
+        <!-- padding: 10px 20px 0;border-radius: 8px;margin: 20px 15px 10px 15px;border: 1px solid #eee;box-shadow: 4px 4px 10px #dadada; -->
122
+        <div style="display: flex; justify-content: center; margin: 20px 15px 10px 15px;">
122 123
           <span style="display: flex; justify-content: center; color: #409EFF;cursor: pointer; margin-right: 50px;" @click="addMonitoring">添加一个配置</span>
123 124
           <span style="display: flex; justify-content: center; color: #409EFF;cursor: pointer; margin-left: 50px;" @click="monitoringSubmit">提交</span>
124 125
         </div>
125
-        <div style="display: flex; justify-content: center; flex-wrap: wrap;">
126
+        <div style="display: flex; justify-content: center; flex-wrap: wrap; ">
126 127
           <el-form v-for="(item, index) in equipmentList" ref="monitoringForm" label-width="120px" style="margin-top: 20px;">
127
-            <div>
128
+            <div style="padding: 10px 20px 0;border-radius: 8px;margin: 20px 15px 10px 15px;border: 1px solid #eee;box-shadow: 4px 4px 10px #dadada;">
128 129
               <el-form-item label="编号">
129 130
                 <!-- item.id -->
130 131
                 <span>{{ index }}</span>
@@ -223,26 +224,28 @@ export default {
223 224
       })
224 225
     },
225 226
     monitoringRemover(id, equipmentIndex) { // 监控删除
226
-      // console.log('monitoringForm : ', this.equipmentList, '  下坐标:', index)
227
-      // const tempEquipmentList = []
228
-      // this.equipmentList.map((item, index) => {
229
-      //   // 排除需要删除的下坐标的数据
230
-      //   if (index !== equipmentIndex) {
231
-      //     tempEquipmentList.push(item)
232
-      //   }
233
-      // })
234
-      // this.equipmentList = tempEquipmentList
235
-
236
-      this.$store.dispatch('DeleteEquipment', id).then(res => {
237
-        const resCode = res.code
238
-        if (resCode === '1') {
239
-          this.$message.error(res.message)
240
-          return
227
+      // console.log('monitoringForm : ', this.equipmentList, '  下坐标:', equipmentIndex)
228
+      const tempEquipmentList = []
229
+      this.equipmentList.map((item, index) => {
230
+        // 排除需要删除的下坐标的数据
231
+        if (index !== equipmentIndex) {
232
+          tempEquipmentList.push(item)
241 233
         }
242
-        this.getMenuList()
243
-      }).catch(() => {
244
-        console.log('DeleteEquipment error!')
245 234
       })
235
+      this.equipmentList = tempEquipmentList
236
+
237
+      if (id !== '') {
238
+        this.$store.dispatch('DeleteEquipment', id).then(res => {
239
+          const resCode = res.code
240
+          if (resCode === '1') {
241
+            this.$message.error(res.message)
242
+            return
243
+          }
244
+          this.getMenuList()
245
+        }).catch(() => {
246
+          console.log('DeleteEquipment error!')
247
+        })
248
+      }
246 249
     },
247 250
     onSubmit() {
248 251
       this.getPropertyData()