Browse Source

上传点位代码

chuwu 5 years ago
parent
commit
650754cad8
1 changed files with 61 additions and 0 deletions
  1. 61 0
      src/views/point/config_point/steps/step4.vue

+ 61 - 0
src/views/point/config_point/steps/step4.vue

@@ -343,6 +343,67 @@
                     }
                 })
             },
+            delPoint(arr){
+                return arr.map(item => {
+                    if(item.hasOwnProperty('EquipmentTypeList')){
+                        let obj = {
+                            id: this.createRandomId(),
+                            topic: `<div>${item.SpecialtySystem}(${item.PointCount})</div>`,
+                            expanded: false
+                        }
+                        if(item.hasOwnProperty("EquipmentTypeList")){
+                            obj.children = []
+                            obj.children = item.EquipmentTypeList.map(child => {
+                                let obj1 = {
+                                    id: this.createRandomId(),
+                                    topic: `<div>${child.EquipmentType}</div>`,
+                                    children: [],
+                                    expanded: false
+                                }
+                                if(child.hasOwnProperty("OriginalPointList")){
+                                    child.OriginalPointList.map(node => {
+                                        let obj2 = {
+                                            id: this.createRandomId(),
+                                            topic: `<div>${node.Description}(${node.Address}):${node.Data.Time}-${node.Data.Data}-${node.Data.Unit}</div>`,
+                                            expanded: false,
+                                            children: []
+                                        }
+                                        if(node.hasOwnProperty("InfoList")){
+                                            node.InfoList.map(node1 => {
+                                                let obj3 = {
+                                                    id: this.createRandomId(),
+                                                    expanded: false,
+                                                    topic: `<div>${node1.InfomationPoint}(${node1.MeterFunc}):${node1.Data.Time}-${node1.Data.Data}-${node1.Data.Unit}</div>`,
+                                                    children: []
+                                                }
+                                                obj2.children.push(obj3)
+                                            })
+                                        }
+                                        obj1.children.push(obj2)
+                                    })
+                                }
+                                return obj1
+                            })
+                        }
+                        return obj
+                    }
+                    if(item.hasOwnProperty("CheckTodos")){
+                        let obj = {
+                            id: this.createRandomId(),
+                            topic: `<div>${item.SpecialtySystem}(${item.PointCount})</div>`,
+                            expanded: false,
+                            children: []
+                        }
+                        obj.children = item.CheckTodos.map(node => {
+                            return {
+                                id: this.createRandomId(),
+                                topic: `<div>${node.Description}(${node.Address})</div>`,
+                            }
+                        })
+                        return obj
+                    }
+                })
+            },
             createRandomId() {
                 return (Math.random() * 10000000).toString(16).substr(0, 4) + '-' + (new Date()).getTime() + '-' + Math.random().toString().substr(2, 5);
             }