From 4ae5681e4a92c1cc98e811135098c71958c48a02 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 30 四月 2025 10:04:51 +0800
Subject: [PATCH] 可靠性计划优化检验项

---
 src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue |  210 +++++++++++++++++++++++++++++++++------------------
 1 files changed, 135 insertions(+), 75 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue b/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue
index 5c1b33e..dd18e33 100644
--- a/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue
+++ b/src/views/CNAS/resourceDemand/device/component/acquisitionConfig.vue
@@ -17,24 +17,37 @@
         :span-method="spanMethod">
         <el-table-column type="index" label="搴忓彿" align="center" width="65"></el-table-column>
         <el-table-column prop="deviceName" align="center" min-width="100" label="璁惧鍚嶇О"></el-table-column>
-        <el-table-column prop="fileType" align="center" label="鏂囦欢鍚庣紑"></el-table-column>
-        <el-table-column prop="collectUrl" align="center" min-width="100" show-overflow-tooltip
-          label="閲囬泦鍦板潃"></el-table-column>
-        <el-table-column prop="storageUrl" align="center" min-width="100" show-overflow-tooltip
-          label="瀛樺偍鍦板潃"></el-table-column>
-        <el-table-column prop="ip" align="center" label="IP鍦板潃" min-width="100"></el-table-column>
+        <el-table-column prop="fileType" align="center" label="鏂囦欢鍚庣紑"
+          v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column>
+        <el-table-column prop="collectUrl" align="center" min-width="100" show-overflow-tooltip label="閲囬泦鍦板潃"
+          v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column>
+        <el-table-column prop="storageUrl" align="center" min-width="100" show-overflow-tooltip label="瀛樺偍鍦板潃"
+          v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column>
+        <el-table-column prop="ip" align="center" label="IP鍦板潃" min-width="100"
+          v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column>
         <el-table-column prop="sample" align="center" label="妫�楠屽璞�" show-overflow-tooltip
           min-width="150"></el-table-column>
         <el-table-column prop="inspectionItemClass" align="center" label="妫�楠岄」鍒嗙被" min-width="120"></el-table-column>
         <el-table-column prop="inspectionItem" align="center" label="妫�楠岄」" min-width="100"></el-table-column>
         <el-table-column prop="inspectionItemSubclass" align="center" label="妫�楠屽瓙椤�" min-width="100"></el-table-column>
-        <el-table-column prop="referx" align="center" label="鍙傜収X" min-width="100"></el-table-column>
-        <el-table-column prop="x" align="center" label="X"></el-table-column>
-        <el-table-column prop="refery" align="center" label="鍙傜収Y" min-width="100"></el-table-column>
-        <el-table-column prop="y" align="center" label="Y"></el-table-column>
-        <el-table-column prop="anotherName" align="center" label="鍒悕" min-width="100"></el-table-column>
-        <el-table-column prop="matchingName" align="center" label="鍖归厤鍚嶇О" min-width="100"></el-table-column>
-        <el-table-column prop="formula" align="center" label="鍏紡"></el-table-column>
+        <el-table-column prop="importedParts" align="center" label="閮ㄤ綅" min-width="100"
+          v-if="deviceName && deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column>
+        <el-table-column prop="importedChannel" align="center" label="閫氶亾" min-width="100"
+          v-if="deviceName && deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column>
+        <el-table-column prop="referx" align="center" label="鍙傜収X" min-width="100"
+          v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column>
+        <el-table-column prop="x" align="center" label="X"
+          v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column>
+        <el-table-column prop="refery" align="center" label="鍙傜収Y" min-width="100"
+          v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column>
+        <el-table-column prop="y" align="center" label="Y"
+          v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column>
+        <el-table-column prop="anotherName" align="center" label="鍒悕" min-width="100"
+          v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column>
+        <el-table-column prop="matchingName" align="center" label="鍖归厤鍚嶇О" min-width="100"
+          v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column>
+        <el-table-column prop="formula" align="center" label="鍏紡"
+          v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')"></el-table-column>
         <el-table-column fixed="right" label="鎿嶄綔" width="120" align="center">
           <template slot-scope="scope">
             <el-button type="text" @click="dataConfig(scope.row)">鏁伴噰閰嶇疆</el-button>
@@ -127,7 +140,7 @@
       <div class="search_thing" style="margin-bottom: 14px;" v-if="deviceName && deviceName.includes('缃戠粶鍒嗘瀽')">
         <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>绔彛锛�
         </div>
-        <el-input size="small" placeholder="璇疯緭鍏�(缃戠粶鍒嗘瀽浠繀濉�)" clearable v-model="configForm.port"></el-input>
+        <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.port"></el-input>
       </div>
       <div class="search_thing" style="margin-bottom: 14px;" v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')">
         <div class="search_label">
@@ -135,7 +148,7 @@
         </div>
         <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.collectUrl"></el-input>
       </div>
-      <div class="search_thing" style="margin-bottom: 14px;" v-if="deviceName && deviceName.includes('缃戠粶鍒嗘瀽')">
+      <!-- <div class="search_thing" style="margin-bottom: 14px;" v-if="deviceName && deviceName.includes('缃戠粶鍒嗘瀽')">
         <div class="search_label" style="width: 130px;">
           <span style="color:red;margin-right: 4px;">*</span>缃戝垎浠噰闆嗛�氶亾锛�
         </div>
@@ -143,7 +156,7 @@
           <el-option v-for="(item, index) in channelList" :key="index" :label="item" :value="item">
           </el-option>
         </el-select>
-      </div>
+      </div> -->
       <div class="search_thing" style="margin-bottom: 14px;" v-if="deviceName && !deviceName.includes('缃戠粶鍒嗘瀽')">
         <div class="search_label">鍌ㄥ瓨鍦板潃锛�</div>
         <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.storageUrl"></el-input>
@@ -173,6 +186,25 @@
         <el-row>
           <el-button @click="dialogVisible4 = false">鍙� 娑�</el-button>
           <el-button type="primary" @click="submitForm4" :loading="upLoad4">纭� 瀹�</el-button>
+        </el-row>
+      </span>
+    </el-dialog>
+    <el-dialog title="鏁伴噰閰嶇疆" :visible.sync="dialogVisible5" width="400px">
+      <div class="search_thing" style="margin-bottom: 14px;">
+        <div class="search_label">
+          <span style="color:red;margin-right: 4px;">*</span>閮ㄤ綅锛�
+        </div>
+        <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.importedParts"></el-input>
+      </div>
+      <div class="search_thing" style="margin-bottom: 14px;">
+        <div class="search_label"><span style="color:red;margin-right: 4px;">*</span>閫氶亾锛�
+        </div>
+        <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="configForm.importedChannel"></el-input>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-row>
+          <el-button @click="dialogVisible5 = false">鍙� 娑�</el-button>
+          <el-button type="primary" @click="submitForm5" :loading="upLoad5">纭� 瀹�</el-button>
         </el-row>
       </span>
     </el-dialog>
@@ -266,9 +298,13 @@
         { label: "db", value: ".db" },
         { label: "mdb", value: ".mdb" },
         { label: "word", value: ".docx" },
-        { label: "excel", value: ".xlsx" },
+        // { label: "excel", value: ".xlsx" },
+        { label: "xlsx", value: ".xlsx" },
         { label: "txt", value: ".txt" },
-        { label: "png", value: ".png" }
+        { label: "png", value: ".png" },
+        { label: "et", value: ".et" },
+        { label: "xls", value: ".xls" },
+        { label: "pdf", value: ".pdf" }
       ],
       spanList: [],
       specialSpanList: [],
@@ -316,7 +352,10 @@
         }
       },
       deleteList: [],
-      channelList: []
+      channelList: [],
+      dialogVisible5: false,
+      upLoad5: false,
+      currentInfo: {}
     };
   },
   // 鏂规硶闆嗗悎
@@ -417,9 +456,9 @@
           this.tableList[0].fiberOpticRibbon
         )
         this.$set(this.configForm, "port", this.tableList[0].port);
-        let arr = this.tableList[0].channel ? this.tableList[0].channel.split(',') : []
-        this.$set(this.configForm, "channel", arr);
-        this.channelList = arr
+        // let arr = this.tableList[0].channel ? this.tableList[0].channel.split(',') : []
+        // this.$set(this.configForm, "channel", arr);
+        // this.channelList = arr
       }
     },
     init() {
@@ -476,18 +515,18 @@
             "fiberOpticRibbon",
             this.tableList[0].fiberOpticRibbon
           )
-          let arr = this.tableList[0].channel ? this.tableList[0].channel.split(',') : []
-          this.$set(
-            this.configForm,
-            "channel",
-            arr
-          )
-          this.$set(
-            this.configForm,
-            "port",
-            this.tableList[0].port
-          )
-          this.channelList = arr;
+          // let arr = this.tableList[0].channel ? this.tableList[0].channel.split(',') : []
+          // this.$set(
+          //   this.configForm,
+          //   "channel",
+          //   arr
+          // )
+          // this.$set(
+          //   this.configForm,
+          //   "port",
+          //   this.tableList[0].port
+          // )
+          // this.channelList = arr;
         }
         // 涓�鑸殑鍚堝苟琛�
         if (
@@ -544,15 +583,15 @@
         dbFileName: this.configForm.dbFileName,
         fiberOpticRibbon: this.configForm.fiberOpticRibbon,
         port: this.configForm.port,
-        channel: this.configForm.channel
+        // channel: this.configForm.channel
       });
       if (this.deviceName && this.deviceName.includes('缃戠粶鍒嗘瀽')) {
         if (!this.configForm.port) {
           return this.$message.error("璇峰~鍐欑鍙�");
         }
-        if (!this.configForm.channel || !this.configForm.channel.length) {
-          return this.$message.error("璇峰~鍐欑綉鍒嗕华閲囬泦閫氶亾");
-        }
+        // if (!this.configForm.channel || !this.configForm.channel.length) {
+        //   return this.$message.error("璇峰~鍐欑綉鍒嗕华閲囬泦閫氶亾");
+        // }
       }
       this.upLoad4 = true;
       saveDataAcquisitionConfiguration({ deviceId: this.deviceId, ...obj }).then(res => {
@@ -576,46 +615,53 @@
         structureItemParameterId: row.structureItemParameterId,
         inspectionItemClass: row.inspectionItemClass,
       };
-      this.dialogVisible3 = true;
-      queryDataAcquisitionConfiguration({
-        deviceId: this.deviceId,
-        inspectionItem: row.inspectionItem.trim(),
-        isDevice: true,
-        inspectionItemSubclass: row.inspectionItemSubclass.trim(),
-        inspectionItemClass: row.inspectionItemClass ? row.inspectionItemClass.trim() : '',
-        structureItemParameterId: row.structureItemParameterId
-      }).then(res => {
-        const data = res.data;
-        if (data[0]) {
-          this.domains.splice(0, 1);
-          let formula = data[0].formula
-          let isIncludes = false
-          if (formula && formula != "") {
-            for (let key in this.formulas) {
-              if (formula.includes(this.formulas[key].label)) {
-                isIncludes = true
+      if (this.deviceName && this.deviceName.includes('缃戠粶鍒嗘瀽')) {
+        this.currentInfo = row
+        this.dialogVisible5 = true;
+        this.$set(this.configForm, 'importedParts', row.importedParts ? row.importedParts : '')
+        this.$set(this.configForm, 'importedChannel', row.importedChannel ? row.importedChannel : '')
+      } else {
+        this.dialogVisible3 = true;
+        queryDataAcquisitionConfiguration({
+          deviceId: this.deviceId,
+          inspectionItem: row.inspectionItem.trim(),
+          isDevice: true,
+          inspectionItemSubclass: row.inspectionItemSubclass.trim(),
+          inspectionItemClass: row.inspectionItemClass ? row.inspectionItemClass.trim() : '',
+          structureItemParameterId: row.structureItemParameterId
+        }).then(res => {
+          const data = res.data;
+          if (data[0]) {
+            this.domains.splice(0, 1);
+            let formula = data[0].formula
+            let isIncludes = false
+            if (formula && formula != "") {
+              for (let key in this.formulas) {
+                if (formula.includes(this.formulas[key].label)) {
+                  isIncludes = true
+                }
               }
             }
-          }
-          if (!isIncludes && formula) {
-            let formulaValue = formula.slice(1, -1)
-            this.$set(this.configForm, "formula", formulaValue);
-          } else {
-            this.$set(this.configForm, "formula", data[0].formula);
-          }
-          data.forEach(i => {
-            this.domains.push({
-              referx: i.referx,
-              refery: i.refery,
-              x: i.x,
-              y: i.y,
-              anotherName: i.anotherName,
-              matchingName: i.matchingName,
-              id: i.id
+            if (!isIncludes && formula) {
+              let formulaValue = formula.slice(1, -1)
+              this.$set(this.configForm, "formula", formulaValue);
+            } else {
+              this.$set(this.configForm, "formula", data[0].formula);
+            }
+            data.forEach(i => {
+              this.domains.push({
+                referx: i.referx,
+                refery: i.refery,
+                x: i.x,
+                y: i.y,
+                anotherName: i.anotherName,
+                matchingName: i.matchingName,
+                id: i.id
+              });
             });
-          });
-        }
-      });
+          }
+        });
+      }
     },
     submitForm3() {
       this.$refs.configForm.validate(valid => {
@@ -725,6 +771,20 @@
       ];
       this.dialogVisible3 = false;
       this.$refs.configForm.resetFields();
+    },
+    submitForm5() {
+      this.currentInfo.importedParts = this.configForm.importedParts
+      this.currentInfo.importedChannel = this.configForm.importedChannel
+      this.currentInfo.deviceId = this.deviceId
+      saveDataAcquisitionConfiguration({
+        deviceId: this.deviceId,
+        isDevice: false,
+        dataConfigList: [{ ...this.currentInfo }],
+      }).then(res => {
+        this.dialogVisible5 = false;
+        this.init();
+        this.$message.success("娣诲姞鎴愬姛");
+      });
     }
   }
 };

--
Gitblit v1.9.3