From f265469d0504f7888fab731a6b9cb295e26f7adf Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 15 七月 2024 18:19:11 +0800
Subject: [PATCH] 优化

---
 src/components/view/a6-device-management.vue |   86 ++++++++++++++++++++++++++++---------------
 1 files changed, 56 insertions(+), 30 deletions(-)

diff --git a/src/components/view/a6-device-management.vue b/src/components/view/a6-device-management.vue
index a96603f..a5e0e51 100644
--- a/src/components/view/a6-device-management.vue
+++ b/src/components/view/a6-device-management.vue
@@ -410,7 +410,7 @@
 						v-model="configForm.y"></el-input>
 			</div>
       <div class="search_thing">
-				<div class="search_label"><span style="color:red;margin-right: 4px;">*</span>鍏紡锛�</div>
+				<div class="search_label">鍏紡锛�</div>
 				<el-input size="small" placeholder="璇疯緭鍏�" clearable
 						v-model="configForm.formula"></el-input>
 			</div>
@@ -421,17 +421,17 @@
 				</el-row>
 			</span>
     </el-dialog>
-<!--    <dataAcquisitionConfig v-if="showData"/>-->
+    <dataAcquisitionConfig v-if="showData" :tableList="tableList"/>
 	</div>
 </template>
 
 <script>
 	import ValueTable from '../tool/value-table.vue'
-  // import dataAcquisitionConfig from '../do/b6-device-management/b6-data-acquisition-config.vue'
+  import dataAcquisitionConfig from '../do/b6-device-management/b6-data-acquisition-config.vue'
 	export default {
 		components: {
 			ValueTable,
-      // dataAcquisitionConfig
+      dataAcquisitionConfig
 		},
 		data() {
 			return {
@@ -451,6 +451,7 @@
 				dialogVisible2: false,
 				addPower: false,
         showData: false, // 鏁伴噰閰嶇疆椤甸潰
+        tableList: [],
 				componentData: {
 					entity: {
 						deviceStatus: null,
@@ -479,7 +480,10 @@
 						id: 'handleConfig',
 						font: '鏁伴噰閰嶇疆',
 						type: 'text',
-						method: 'handleConfig'
+						method: 'handleConfig',
+            disabFun: (row, index) => {
+              return row.insProductItem === ''
+            }
 					}],
           headNoShow:['enDeviceName'],
 					tagField: {
@@ -594,21 +598,21 @@
 					if (power[i].menuMethod == 'addDeviceParameter') {
 						add = true
 					}
-          if (power[i].menuMethod == 'numberCollect') {
+          			if (power[i].menuMethod == 'saveDataAcquisitionConfiguration') {
 						config = true
 					}
 				}
-        if (!config) {
-					this.componentData.do.splice(2, 1)
-				}
-				if (!up) {
-					this.componentData.do.splice(1, 1)
-				}
-				if (!del) {
-					this.componentData.do.splice(0, 1)
-				}
-				this.addPower = add
-			},
+				if (!config) {
+							this.componentData.do.splice(2, 1)
+						}
+						if (!up) {
+							this.componentData.do.splice(1, 1)
+						}
+						if (!del) {
+							this.componentData.do.splice(0, 1)
+						}
+						this.addPower = add
+					},
 			// 鑾峰彇瀛楀吀
 			selectEnumByCategory() {
 				this.$axios.post(this.$api.enums.selectEnumByCategory, {
@@ -658,6 +662,23 @@
             this.componentData.tagField.insProductIds.select = [...this.componentData.tagField.insProductIds.select,...children]
             this.componentData.selectField.insProductIds.select = [...this.componentData.selectField.insProductIds.select,...children]
             return m
+          })
+          this.options.forEach(item=>{
+            if(item.children.length==0){
+              item.children = null;
+            }else{
+              item.children.forEach(m=>{
+                if(m.children.length==0){
+                  m.children = null;
+                }else{
+                  m.children.forEach(n=>{
+                    if(n.children&&n.children.length==0){
+                      n.children = null;
+                    }
+                  })
+                }
+              })
+            }
           })
 				})
       },
@@ -840,17 +861,26 @@
 				})
 			},
       handleConfig(row){
-        this.configForm = {}
-        this.dialogVisible3 = true
-        this.$axios.post(this.$api.deviceScope.getNumberCollect+'?id='+row.id).then(res => {
-          this.configForm = res.data
+        // this.configForm = {}
+        // this.dialogVisible3 = true
+        // this.$axios.post(this.$api.deviceScope.getNumberCollect+'?id='+row.id).then(res => {
+        //   this.configForm = res.data
+        // })
+        this.showData = true
+        const list = row.insProductItem.split(';')
+        let list2 = []
+        list.map((item) => {
+          const obj = Object.assign({
+			deviceId: row.id,
+            insProductItem: item,
+          })
+          list2.push(obj)
         })
-        // this.showData = true
-        // console.log('?????', this.showData)
+        this.tableList = list2
       },
-      // closeDataVue () {
-      //   this.showData = false
-      // },
+      closeDataVue () {
+        this.showData = false
+      },
       submitForm3(){
         if(!this.configForm.ip){
           this.$message.error('璇峰~鍐橧P');
@@ -874,10 +904,6 @@
         }
         if(!this.configForm.y){
           this.$message.error('璇峰~鍐橸');
-          return
-        }
-        if(!this.configForm.formula){
-          this.$message.error('璇峰~鍐欏叕寮�');
           return
         }
 

--
Gitblit v1.9.3