From c263fb316fc23d9db98ce711fda30d81c28d2d9c Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 08 八月 2024 19:02:10 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/center-lims-before

---
 src/components/view/a6-device-management.vue |  112 +++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 75 insertions(+), 37 deletions(-)

diff --git a/src/components/view/a6-device-management.vue b/src/components/view/a6-device-management.vue
index a96603f..f28e1bc 100644
--- a/src/components/view/a6-device-management.vue
+++ b/src/components/view/a6-device-management.vue
@@ -162,7 +162,7 @@
 				</el-col>
 				<!-- 鍙宠竟甯冨眬 -->
 				<el-col :span="7">
-					<el-form :label-position="labelPosition" :model="formData" label-width="120px" ref="ruleForm">
+					<el-form :label-position="labelPosition" :model="formData" label-width="140px" ref="ruleForm">
             <!-- 瀹為獙瀹ゅ垪琛� -->
             <el-form-item label="鎵�灞為儴闂�:">
               <el-select :disabled="isUp" v-model="formData.subordinateDepartmentsId" placeholder="璇烽�夋嫨" size="small" style="width:100%">
@@ -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,20 +421,30 @@
 				</el-row>
 			</span>
     </el-dialog>
-<!--    <dataAcquisitionConfig v-if="showData"/>-->
+    <dataAcquisitionConfig v-if="showData" :deviceId="deviceId"/>
 	</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 {
+				deviceId: '',
+				fileTypeOptions: [
+					{label: 'csv', value: '.csv'},
+					{label: 'db', value: '.db'},
+					{label: 'mdb', value: '.mdb'},
+					{label: 'word', value: '.docx'},
+					{label: 'excel', value: '.xlsx'},
+					{label: 'txt', value: '.txt'},
+					{label: 'png', value: '.png'},
+				],
 				//鏄惁鏄。妗堜慨璁�  true涓嶆槸 false鏄�
 				isUp: true,
 				formData: {
@@ -451,6 +461,7 @@
 				dialogVisible2: false,
 				addPower: false,
         showData: false, // 鏁伴噰閰嶇疆椤甸潰
+        tableList: [],
 				componentData: {
 					entity: {
 						deviceStatus: null,
@@ -479,7 +490,10 @@
 						id: 'handleConfig',
 						font: '鏁伴噰閰嶇疆',
 						type: 'text',
-						method: 'handleConfig'
+						method: 'handleConfig',
+            disabFun: (row, index) => {
+              return row.insProductItem === ''
+            }
 					}],
           headNoShow:['enDeviceName'],
 					tagField: {
@@ -515,7 +529,8 @@
             }
 					},
 					requiredAdd: [],
-					requiredUp: []
+					requiredUp: [],
+          needSort: ['deviceName', 'acquisitionDate', 'activationDate', 'lastCalibrationDate', 'nextCalibrationDate', 'deviceStatus'],
 				},
 				entityCopy: {},
 				upIndex: 0,
@@ -570,8 +585,8 @@
 					this.subordinateDepartmentsList = data
 				})
 			},
-			refreshTable() {
-				this.$refs['ValueTable'].selectList()
+			refreshTable(e) {
+				this.$refs['ValueTable'].selectList(e)
 			},
 			refresh() {
 				this.componentData.entity = this.HaveJson(this.entityCopy)
@@ -594,21 +609,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 +673,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;
+                    }
+                  })
+                }
+              })
+            }
           })
 				})
       },
@@ -777,7 +809,7 @@
 					}
 					this.$message.success('淇敼鎴愬姛')
 					this.upLoad = false
-					this.refreshTable()
+					this.refreshTable('page')
 					this.dialogVisible = false
 				}).catch(e => {
 					this.$message.error('淇敼澶辫触')
@@ -827,7 +859,7 @@
 					}
 					this.$message.success('鎻愪氦鎴愬姛')
 					this.upLoad2 = false
-					this.refreshTable()
+					this.refreshTable('page')
 					this.dialogVisible2 = false
 					this.formData2 = {
 						imageUpload: '',
@@ -840,17 +872,27 @@
 				})
 			},
       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
+		this.deviceId = row.id
       },
-      // closeDataVue () {
-      //   this.showData = false
-      // },
+      closeDataVue () {
+        this.showData = false
+      },
       submitForm3(){
         if(!this.configForm.ip){
           this.$message.error('璇峰~鍐橧P');
@@ -876,10 +918,6 @@
           this.$message.error('璇峰~鍐橸');
           return
         }
-        if(!this.configForm.formula){
-          this.$message.error('璇峰~鍐欏叕寮�');
-          return
-        }
 
         this.upLoad3 = true
         this.$axios.post(this.$api.deviceScope.numberCollect, this.configForm, {
@@ -892,7 +930,7 @@
 						return
 					}
 					this.$message.success('鎿嶄綔鎴愬姛')
-					this.refreshTable()
+					this.refreshTable('page')
 					this.dialogVisible3 = false
 				}).catch(e => {
 					this.$message.error('鎿嶄綔澶辫触')

--
Gitblit v1.9.3