chuwu 5 éve
szülő
commit
ac03e6497f

+ 33 - 19
src/components/config_point/step3_point/3_identify.vue

@@ -58,29 +58,43 @@
             save() {
                 console.log(this.renderData,'renderData')
                 // let data = this.hotArr[this.activeName - 1].getSourceData()
-                // data = data.map(item => {
-                //     return {
-                //         EquipmentMark: item.own || null,
-                //         Id: item.Id,
-                //     }
-                // })
-                // updatePoint({
-                //     data: {
-                //         Content: data
-                //     },
-                //     type: this.protocolType
-                // }, res => {
-                //     this.$emit("saved")
-                //     this.$message.success("保存成功")
-                // })
+                let data = []
+                this.renderData.map(item => {
+                    if(!!item.PointList){
+                        item.PointList.map(child => {
+                            data.push(child)
+                        })
+                    }
+                })
+                console.log(data)
+                data = data.map(item => {
+                    return {
+                        EquipmentMark: item.own || null,
+                        Id: item.Id,
+                    }
+                })
+                updatePoint({
+                    data: {
+                        Content: data
+                    },
+                    type: this.protocolType
+                }, res => {
+                    this.$emit("saved")
+                    this.$message.success("保存成功")
+                })
             },
             fillClick(){
-                let data = this.hotArr[this.activeName - 1].getSourceData()
+                // let data = this.hotArr[this.activeName - 1].getSourceData()
                 // data.own = this.fillData
-                data.map(item => {
-                    item.own = this.fillData
+                // data.map(item => {
+                //     item.own = this.fillData
+                // })
+                this.renderData[this.activeName - 1].PointList.map(item => {
+                    item.own = item.own || this.fillData
                 })
-                console.log(data,'data')
+                console.log(this.renderData[this.activeName - 1].PointList)
+                this.handleChange(true)
+                // console.log(data,'data')
             },
             handleChange(val) {
                 if (!val) {

+ 1 - 1
src/views/point/config_point/steps/step4.vue

@@ -426,7 +426,7 @@
                                                 let obj3 = {
                                                     id: this.createRandomId(),
                                                     expanded: false,
-                                                    topic: `${node1.InfomationPoint}(${node1.MeterFunc}):${node1.Data.Time}-${node1.Data.Data}-${node1.Data.Unit}`,
+                                                    topic: `${node1.EquipmentMark}-${node1.InfomationPoint}(${node1.MeterFunc}):${node1.Data.Time}-${node1.Data.Data}-${node1.Data.Unit}`,
                                                     children: [],
                                                     DataQuality: item.DataQuality
                                                 }