浏览代码

修改设备详情bug

zhangyu 4 年之前
父节点
当前提交
ee2211a010
共有 2 个文件被更改,包括 6 次插入32 次删除
  1. 1 1
      src/components/ledger/details/detail/cruxDialog.vue
  2. 5 31
      src/views/ledger/facility/details/index.vue

+ 1 - 1
src/components/ledger/details/detail/cruxDialog.vue

@@ -84,7 +84,7 @@
           setDataDictionary(param, res => {
             this.dialogFormVisible = false
             this.$emit('cruxSuccess')
-            this.$message('保存成功')
+            this.$message.success('保存成功')
 
           });
 

+ 5 - 31
src/views/ledger/facility/details/index.vue

@@ -229,6 +229,9 @@ export default {
 
             }
           }
+					if (this.instance.hasOwnProperty(item.Path)) {
+						item.value = this.instance[item.Path]
+					}
         })
         let params = { //获取动态参数
           secret: this.secret,
@@ -263,15 +266,8 @@ export default {
     },
     handleEnclosure() {
       //图片文件处理,脱离radio控制
-      let isList = this.pointData
       let isArr = []
-      isList.map(j => {
-        if (this.instance.hasOwnProperty(j.Path)) {
-          j.value = this.instance[j.Path]
-          return j
-        }
-      })
-      isArr = isList.filter(k => k.value)
+      isArr = this.pointData.filter(k => k.value)
       this.handlePicList(isArr)
       this.handleFileList(isArr)
     },
@@ -287,34 +283,12 @@ export default {
           }
         }
       })
-
       if (val == 1) { //需采集信息
         arr = this.pointData.filter(i => i.Visible)
-        // //  图片和的处理
-        // this.handlePicList(arr)
-        // //  文件处理
-        // this.handleFileList(arr)
-
       } else if (val == 2) { //有值信息点
-        let list = this.pointData
-        list.map(j => {
-          if (this.instance.hasOwnProperty(j.Path)) {
-            return {
-              ...j,
-              value: this.instance[j.Path]
-            }
-
-
-          }
-        })
-        arr = list.filter(k => k.value)
-        // this.handlePicList(arr, 2)
-        // this.handleFileList(arr, 2)
-
+        arr = this.pointData.filter(k => k.value)
       } else { //全部信息点
         arr = this.pointData
-        // this.handlePicList(arr)
-        // this.handleFileList(arr)
       }
       this.displayData(arr)
     },