From 23b4b0e764ba8d7bf73f9c7d999f4144427d31cd Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期五, 13 九月 2024 16:35:35 +0800
Subject: [PATCH] 新增可靠性框图自动排版功能

---
 web/src/views/modules/taskReliability/ConfigNode/configNode.vue |  139 +++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 117 insertions(+), 22 deletions(-)

diff --git a/web/src/views/modules/taskReliability/ConfigNode/configNode.vue b/web/src/views/modules/taskReliability/ConfigNode/configNode.vue
index cbd1bcc..c96307c 100644
--- a/web/src/views/modules/taskReliability/ConfigNode/configNode.vue
+++ b/web/src/views/modules/taskReliability/ConfigNode/configNode.vue
@@ -18,11 +18,26 @@
                 <zt-dict style="width: 100%" v-model="globalGridAttr.reliabDistribType" @input="onReliabDistribType"
                          dict="ReliabDistribType" placeholder="鍙潬鎬у垎甯冪被鍨�" clearable/>
               </el-form-item>
+              <el-form-item v-show="globalGridAttr.reliabDistribType==='3' && showBinoParam" label="浜岄」鍒嗗竷鎴愬姛鐜�"
+                            prop="successRate" label-width="125px">
+                <el-input v-model="globalGridAttr.successRate" @change="onSuccessRateChange"></el-input>
+              </el-form-item>
+              <el-form-item v-show="globalGridAttr.reliabDistribType==='3' && showBinoParam" label="鎬绘鏁�"
+                            prop="simulatTimes" label-width="80px">
+                <el-input v-model="globalGridAttr.simulatTimes" @change="onSimulatTimesChange"></el-input>
+              </el-form-item>
+              <el-form-item v-show="globalGridAttr.reliabDistribType==='3' && showBinoParam" label="鎴愬姛娆℃暟"
+                            prop="successTimes" label-width="80px">
+                <el-input v-model="globalGridAttr.successTimes" @change="onSuccessTimesChange"></el-input>
+              </el-form-item>
               <el-form-item v-show="nodeType=='node'" label="MTBCF" prop="taskMtbcf" label-width="80px">
                 <el-input v-model="globalGridAttr.taskMtbcf" @change="onTaskMtbcfChange"></el-input>
               </el-form-item>
-              <el-form-item v-show="nodeType=='node'" label="鍙傛暟2" prop="taskMtbcfOther" label-width="80px">
-                <el-input v-model="globalGridAttr.taskMtbcfOther" @change="onTaskMtbcfOtherChange"></el-input>
+              <el-form-item v-show="nodeType=='node'" label="鍙傛暟2" prop="taskMtbcfOtherParams2" label-width="80px">
+                <el-input v-model="globalGridAttr.taskMtbcfOtherParams2" @change="onTaskMtbcfOther2Change"></el-input>
+              </el-form-item>
+              <el-form-item v-show="nodeType=='node'" label="鍙傛暟3" prop="taskMtbcfOtherParams3" label-width="80px">
+                <el-input v-model="globalGridAttr.taskMtbcfOtherParams3" @change="onTaskMtbcfOther3Change"></el-input>
               </el-form-item>
               <el-form-item v-show="nodeType=='node'" label="鏄惁鍙淮淇�" prop="isRepair" label-width="100px">
                 <el-select style="width: 100%" v-model="globalGridAttr.isRepair" @change="onIsRepairChange">
@@ -42,8 +57,13 @@
                 <el-form-item label="MTTCR" prop="repairMttcr" label-width="80px">
                   <el-input v-model="globalGridAttr.repairMttcr" @change="onRepairMttcrChange"></el-input>
                 </el-form-item>
-                <el-form-item label="鍙傛暟2" prop="repairMttcrOther" label-width="80px">
-                  <el-input v-model="globalGridAttr.repairMttcrOther" @change="onRepairMttcrOtherChange"></el-input>
+                <el-form-item label="鍙傛暟2" prop="repairMttcrOtherParams2" label-width="80px">
+                  <el-input v-model="globalGridAttr.repairMttcrOtherParams2"
+                            @change="onRepairMttcrOther2Change"></el-input>
+                </el-form-item>
+                <el-form-item label="鍙傛暟2" prop="repairMttcrOtherParams3" label-width="80px">
+                  <el-input v-model="globalGridAttr.repairMttcrOtherParams3"
+                            @change="onRepairMttcrOther3Change"></el-input>
                 </el-form-item>
               </div>
             </div>
@@ -91,12 +111,17 @@
           reliabDistribType: '',
           repairDistribType: '',
           repairMttcr: '',
-          repairMttcrOther: '',
+          repairMttcrOtherParams2: '',
+          repairMttcrOtherParams3: '',
+          taskMtbcfOtherParams2: '',
+          taskMtbcfOtherParams3: '',
           taskMtbcf: '',
-          taskMtbcfOther: '',
           isRepair: '',
           voteNum: 0,
-          productType: ''
+          productType: '',
+          successRate: '',
+          simulatTimes: '',
+          successTimes: '',
         },
         data: {
           dataId: '',
@@ -105,6 +130,7 @@
         },
         showNumberInput: false,
         showRepairInput: false,
+        showBinoParam: false,
         isRepair: [
           {
             value: 0,
@@ -122,10 +148,8 @@
       }
     },
     components: {},
-    props: {
-    },
-    watch: {
-    },
+    props: {},
+    watch: {},
     mounted() {
     },
     methods: {
@@ -174,6 +198,9 @@
       // 鍙潬鎬у垎甯冪被鍨�
       onReliabDistribType(e) {
         this.globalGridAttr.reliabDistribType = e
+        if (e === '3') {
+          this.showBinoParam = true
+        }
         let reliabDistribType = {
           reliabDistribType: this.globalGridAttr.reliabDistribType
         }
@@ -193,19 +220,31 @@
         }
       },
       // 鍙傛暟2
-      onTaskMtbcfOtherChange(e) {
+      onTaskMtbcfOther2Change(e) {
         const numberRegex = /^-?\d+(\.\d+)?$/
         console.log(e, 'eeeee')
         if (numberRegex.test(e)) {
-          this.globalGridAttr.taskMtbcfOther = e
-          let taskMtbcfOther = {
-            taskMtbcfOther: this.globalGridAttr.taskMtbcfOther
+          this.globalGridAttr.taskMtbcfOtherParams2 = e
+          let taskMtbcfOtherParams2 = {
+            taskMtbcfOtherParams2: this.globalGridAttr.taskMtbcfOtherParams2
           }
-          this.curCel.setData(taskMtbcfOther)
+          this.curCel.setData(taskMtbcfOtherParams2)
         } else {
           this.$message.error('杈撳叆鏍煎紡鏈夎锛岃杈撳叆瀹炴暟')
         }
-
+      },
+      onTaskMtbcfOther3Change(e) {
+        const numberRegex = /^-?\d+(\.\d+)?$/
+        console.log(e, 'eeeee')
+        if (numberRegex.test(e)) {
+          this.globalGridAttr.taskMtbcfOtherParams3 = e
+          let taskMtbcfOtherParams3 = {
+            taskMtbcfOtherParams3: this.globalGridAttr.taskMtbcfOtherParams3
+          }
+          this.curCel.setData(taskMtbcfOtherParams3)
+        } else {
+          this.$message.error('杈撳叆鏍煎紡鏈夎锛岃杈撳叆瀹炴暟')
+        }
       },
       // 鏄惁鍙淮淇�
       onIsRepairChange(e) {
@@ -239,14 +278,63 @@
 
       },
       // 鍙淮淇�у垎甯冪被鍨� 鍙傛暟2
-      onRepairMttcrOtherChange(e) {
+      onRepairMttcrOther2Change(e) {
         const numberRegex = /^-?\d+(\.\d+)?$/
         if (numberRegex.test(e)) {
-          this.globalGridAttr.repairMttcrOther = e
-          let repairMttcrOther = {
-            repairMttcrOther: this.globalGridAttr.repairMttcrOther
+          this.globalGridAttr.repairMttcrOtherParams2 = e
+          let repairMttcrOtherParams2 = {
+            repairMttcrOtherParams2: this.globalGridAttr.repairMttcrOtherParams2
           }
-          this.curCel.setData(repairMttcrOther)
+          this.curCel.setData(repairMttcrOtherParams2)
+        } else {
+          this.$message.error('杈撳叆鏍煎紡鏈夎锛岃杈撳叆瀹炴暟')
+        }
+      },
+      // 鍙淮淇�у垎甯冪被鍨� 鍙傛暟2
+      onRepairMttcrOther3Change(e) {
+        const numberRegex = /^-?\d+(\.\d+)?$/
+        if (numberRegex.test(e)) {
+          this.globalGridAttr.repairMttcrOtherParams3 = e
+          let repairMttcrOtherParams3 = {
+            repairMttcrOtherParams3: this.globalGridAttr.repairMttcrOtherParams3
+          }
+          this.curCel.setData(repairMttcrOtherParams3)
+        } else {
+          this.$message.error('杈撳叆鏍煎紡鏈夎锛岃杈撳叆瀹炴暟')
+        }
+      },
+      onSuccessRateChange(e) {
+        const numberRegex = /^-?\d+(\.\d+)?$/
+        if (numberRegex.test(e)) {
+          this.globalGridAttr.successRate = e
+          let successRate = {
+            successRate: this.globalGridAttr.successRate
+          }
+          this.curCel.setData(successRate)
+        } else {
+          this.$message.error('杈撳叆鏍煎紡鏈夎锛岃杈撳叆瀹炴暟')
+        }
+      },
+      onSimulatTimesChange(e) {
+        const numberRegex = /^-?\d+(\.\d+)?$/
+        if (numberRegex.test(e)) {
+          this.globalGridAttr.simulatTimes = e
+          let simulatTimes = {
+            simulatTimes: this.globalGridAttr.simulatTimes
+          }
+          this.curCel.setData(simulatTimes)
+        } else {
+          this.$message.error('杈撳叆鏍煎紡鏈夎锛岃杈撳叆瀹炴暟')
+        }
+      },
+      onSuccessTimesChange(e) {
+        const numberRegex = /^-?\d+(\.\d+)?$/
+        if (numberRegex.test(e)) {
+          this.globalGridAttr.successTimes = e
+          let successTimes = {
+            successTimes: this.globalGridAttr.successTimes
+          }
+          this.curCel.setData(successTimes)
         } else {
           this.$message.error('杈撳叆鏍煎紡鏈夎锛岃杈撳叆瀹炴暟')
         }
@@ -315,10 +403,17 @@
           this.globalGridAttr.isRepair = cell.getData().isRepair
           this.globalGridAttr.voteNum = cell.getData().voteNum
           this.globalGridAttr.productType = cell.getData().productType
+          this.globalGridAttr.successRate = cell.getData().successRate
+          this.globalGridAttr.simulatTimes = cell.getData().simulatTimes
+          this.globalGridAttr.successTimes = cell.getData().successTimes
           if (this.nodeType === 'vote' || this.globalGridAttr.nodeTypeExt === 'vote' || (cell.getData().voteNum !== undefined && cell.getData().voteNum !== '')) {
             console.log(cell.getData().voteNum, 'cell.getData().voteNum')
             this.showNumberInput = true
           }
+          if (cell.getData().reliabDistribType === 3) {
+            this.globalGridAttr.reliabDistribType = '3'
+            this.showBinoParam = true
+          }
           this.showRepairInput = cell.getData().isRepair
           cell.removeTools()
           cell.addTools([

--
Gitblit v1.9.1