From de1b6284b3cb6349575938782ee34d2ad0349735 Mon Sep 17 00:00:00 2001
From: wente <329538422@qq.com>
Date: 星期四, 14 三月 2024 18:04:19 +0800
Subject: [PATCH] 表决数量

---
 web/src/views/modules/taskReliability/ConfigNode/index.vue |  269 ++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 174 insertions(+), 95 deletions(-)

diff --git a/web/src/views/modules/taskReliability/ConfigNode/index.vue b/web/src/views/modules/taskReliability/ConfigNode/index.vue
index d8d41d0..0ba5b6f 100644
--- a/web/src/views/modules/taskReliability/ConfigNode/index.vue
+++ b/web/src/views/modules/taskReliability/ConfigNode/index.vue
@@ -3,31 +3,79 @@
   <el-card style="height: 100%">
     <el-tabs v-model="activeName" id="tabPane">
       <el-tab-pane label="灞炴��"  name="first">
-        <el-row :gutter="5" v-show="shape!=='custom-circle1'"  align="middle" style="margin-top:20px">
-          <el-col :span=8 style="font-size: 16px;line-height: 32px">鑺傜偣鍚嶇О</el-col>
-          <el-col :span=16 >
+        <el-form :model="globalGridAttr">
+          <el-form-item v-show="shape!=='custom-circle1'" label="鑺傜偣鍚嶇О" prop="nodeText" label-width="80px">
             <el-input  v-model="globalGridAttr.nodeText" style="width:100%" @change="onTextChange"></el-input>
-          </el-col>
-        </el-row>
-        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">
-          <el-col :span=8 style="font-size: 16px;line-height: 32px">杩炴帴鍏崇郴</el-col>
-          <el-col :span=16>
+          </el-form-item>
+          <el-form-item v-show="nodeType=='node'" label="杩炴帴鍏崇郴" prop="nodeTypeExt" label-width="80px">
             <el-select style="width: 100%" v-model="globalGridAttr.nodeTypeExt" @change="onNodeTypeExtChange">
               <el-option
-                v-for="item in options"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value">
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
               </el-option>
             </el-select>
-          </el-col>
-        </el-row>
-        <el-row :gutter="5" v-show="nodeType=='node' && showNumberInput" align="middle" style="margin-top:20px;">
-          <el-col :span=8 style="font-size: 16px;line-height: 32px">鏁伴噺</el-col>
-          <el-col :span=16>
-            <el-input type="number" v-model="globalGridAttr.numberInputValue" @change="onNumberInputValue"  placeholder="璇疯緭鍏ユ暟瀛�"></el-input>
-          </el-col>
-        </el-row>
+          </el-form-item>
+          <el-form-item v-show="nodeType=='vote' || (nodeType=='node' && showNumberInput)" label="琛ㄥ喅鏁伴噺" prop="voteNum" label-width="80px">
+            <el-input type="number" v-model="globalGridAttr.voteNum" @change="onNumberInputValue"  placeholder="璇疯緭鍏ユ暟瀛�"></el-input>
+          </el-form-item>
+          <el-form-item v-show="nodeType=='node'" label="鍙潬鎬у垎甯冪被鍨�" prop="reliabDistribType" label-width="125px">
+            <zt-dict style="width: 100%" v-model="globalGridAttr.reliabDistribType" @input="onReliabDistribType" dict="ReliabDistribType" placeholder="鍙潬鎬у垎甯冪被鍨�" clearable/>
+          </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>
+          <el-form-item v-show="nodeType=='node'" label="鏄惁鍙淮淇�" prop="isRepair" label-width="100px">
+            <el-select style="width: 100%" v-model="globalGridAttr.isRepair" @change="onIsRepairChange">
+              <el-option
+                  v-for="item in isRepair"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <div v-show="nodeType=='node' && showRepairInput">
+            <el-form-item label="鍙淮淇�у垎甯冪被鍨�" prop="repairDistribType" label-width="140px">
+              <zt-dict v-model="globalGridAttr.repairDistribType" dict="RepairDistribType" @input="onRepairDistribTypeChange" placeholder="缁翠慨鎬у垎甯冪被鍨�" clearable/>
+            </el-form-item>
+            <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>
+          </div>
+        </el-form>
+<!--        <el-row :gutter="5" v-show="shape!=='custom-circle1'"  align="middle" style="margin-top:20px">-->
+<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">鑺傜偣鍚嶇О</el-col>-->
+<!--          <el-col :span=16 >-->
+<!--            <el-input  v-model="globalGridAttr.nodeText" style="width:100%" @change="onTextChange"></el-input>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+<!--        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">-->
+<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">杩炴帴鍏崇郴</el-col>-->
+<!--          <el-col :span=16>-->
+<!--            <el-select style="width: 100%" v-model="globalGridAttr.nodeTypeExt" @change="onNodeTypeExtChange">-->
+<!--              <el-option-->
+<!--                v-for="item in options"-->
+<!--                :key="item.value"-->
+<!--                :label="item.label"-->
+<!--                :value="item.value">-->
+<!--              </el-option>-->
+<!--            </el-select>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+<!--        <el-row :gutter="5" v-show="nodeType=='node' && showNumberInput" align="middle" style="margin-top:20px;">-->
+<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">琛ㄥ喅鏁伴噺</el-col>-->
+<!--          <el-col :span=16>-->
+<!--            <el-input type="number" v-model="globalGridAttr.voteNum" @change="onNumberInputValue"  placeholder="璇疯緭鍏ユ暟瀛�"></el-input>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
 <!--        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">-->
 <!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">鐘舵��</el-col>-->
 <!--          <el-col :span=16>-->
@@ -41,57 +89,57 @@
 <!--            </el-select>-->
 <!--          </el-col>-->
 <!--        </el-row>-->
-        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">
-          <el-col :span=8 style="font-size: 16px;line-height: 32px">鍙潬鎬у垎甯冪被鍨�</el-col>
-          <el-col :span=16>
-            <zt-dict v-model="globalGridAttr.reliabDistribType" @input="onReliabDistribType" dict="ReliabDistribType" placeholder="鍙潬鎬у垎甯冪被鍨�" clearable/>
-          </el-col>
-        </el-row>
-        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">
-          <el-col :span=8 style="font-size: 16px;line-height: 32px">MTBCF</el-col>
-          <el-col :span=16>
-            <el-input  type="number" v-model="globalGridAttr.taskMtbcf" @change="onTaskMtbcfChange"></el-input>
-          </el-col>
-        </el-row>
-        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">
-          <el-col :span=8 style="font-size: 16px;line-height: 32px">鍙傛暟2</el-col>
-          <el-col :span=16>
-            <el-input  v-model="globalGridAttr.taskMtbcfOther" @change="onTaskMtbcfOtherChange"></el-input>
-          </el-col>
-        </el-row>
-        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">
-          <el-col :span=8 style="font-size: 16px;line-height: 32px">鏄惁鍙淮淇�</el-col>
-          <el-col :span=16>
-            <el-select style="width: 100%" v-model="globalGridAttr.isRepair" @change="onIsRepairChange">
-              <el-option
-                  v-for="item in isRepair"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-              </el-option>
-            </el-select>
-          </el-col>
-        </el-row>
-        <div v-show="nodeType=='node' && showRepairInput">
-          <el-row :gutter="5"  align="middle" style="margin-top:20px;">
-            <el-col :span=8 style="font-size: 16px;line-height: 32px">鍙淮淇�у垎甯冪被鍨�</el-col>
-            <el-col :span=16>
-              <zt-dict v-model="globalGridAttr.repairDistribType" dict="RepairDistribType" @input="onRepairDistribTypeChange" placeholder="缁翠慨鎬у垎甯冪被鍨�" clearable/>
-            </el-col>
-          </el-row>
-          <el-row :gutter="5"  align="middle" style="margin-top:20px;">
-            <el-col :span=8 style="font-size: 16px;line-height: 32px">MTTCR</el-col>
-            <el-col :span=16>
-              <el-input  type="number" v-model="globalGridAttr.repairMttcr" @change="onRepairMttcrChange"></el-input>
-            </el-col>
-          </el-row>
-          <el-row :gutter="5"  align="middle" style="margin-top:20px;">
-            <el-col :span=8 style="font-size: 16px;line-height: 32px">鍙傛暟2</el-col>
-            <el-col :span=16>
-              <el-input  v-model="globalGridAttr.repairMttcrOther" @change="onRepairMttcrOtherChange"></el-input>
-            </el-col>
-          </el-row>
-        </div>
+<!--        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">-->
+<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">鍙潬鎬у垎甯冪被鍨�</el-col>-->
+<!--          <el-col :span=16>-->
+<!--            <zt-dict v-model="globalGridAttr.reliabDistribType" @input="onReliabDistribType" dict="ReliabDistribType" placeholder="鍙潬鎬у垎甯冪被鍨�" clearable/>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+<!--        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">-->
+<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">MTBCF</el-col>-->
+<!--          <el-col :span=16>-->
+<!--            <el-input  v-model="globalGridAttr.taskMtbcf" @change="onTaskMtbcfChange"></el-input>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+<!--        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">-->
+<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">鍙傛暟2</el-col>-->
+<!--          <el-col :span=16>-->
+<!--            <el-input  v-model="globalGridAttr.taskMtbcfOther" @change="onTaskMtbcfOtherChange"></el-input>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+<!--        <el-row :gutter="5" v-show="nodeType=='node'" align="middle" style="margin-top:20px;">-->
+<!--          <el-col :span=8 style="font-size: 16px;line-height: 32px">鏄惁鍙淮淇�</el-col>-->
+<!--          <el-col :span=16>-->
+<!--            <el-select style="width: 100%" v-model="globalGridAttr.isRepair" @change="onIsRepairChange">-->
+<!--              <el-option-->
+<!--                  v-for="item in isRepair"-->
+<!--                  :key="item.value"-->
+<!--                  :label="item.label"-->
+<!--                  :value="item.value">-->
+<!--              </el-option>-->
+<!--            </el-select>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+<!--        <div v-show="nodeType=='node' && showRepairInput">-->
+<!--          <el-row :gutter="5"  align="middle" style="margin-top:20px;">-->
+<!--            <el-col :span=8 style="font-size: 16px;line-height: 32px">鍙淮淇�у垎甯冪被鍨�</el-col>-->
+<!--            <el-col :span=16>-->
+<!--              <zt-dict v-model="globalGridAttr.repairDistribType" dict="RepairDistribType" @input="onRepairDistribTypeChange" placeholder="缁翠慨鎬у垎甯冪被鍨�" clearable/>-->
+<!--            </el-col>-->
+<!--          </el-row>-->
+<!--          <el-row :gutter="5"  align="middle" style="margin-top:20px;">-->
+<!--            <el-col :span=8 style="font-size: 16px;line-height: 32px">MTTCR</el-col>-->
+<!--            <el-col :span=16>-->
+<!--              <el-input  v-model="globalGridAttr.repairMttcr" @change="onRepairMttcrChange"></el-input>-->
+<!--            </el-col>-->
+<!--          </el-row>-->
+<!--          <el-row :gutter="5"  align="middle" style="margin-top:20px;">-->
+<!--            <el-col :span=8 style="font-size: 16px;line-height: 32px">鍙傛暟2</el-col>-->
+<!--            <el-col :span=16>-->
+<!--              <el-input  v-model="globalGridAttr.repairMttcrOther" @change="onRepairMttcrOtherChange"></el-input>-->
+<!--            </el-col>-->
+<!--          </el-row>-->
+<!--        </div>-->
       </el-tab-pane>
       <el-tab-pane label="鏍峰紡"  name="second">
         <el-row :gutter="5" align="middle" style="margin-top:20px">
@@ -249,11 +297,11 @@
     },
     // 琛ㄥ喅鏁伴噺
     onNumberInputValue(e){
-      this.globalGridAttr.voteSum = e
-      let voteSum={
-        voteSum:this.globalGridAttr.voteSum
+      this.globalGridAttr.voteNum = e
+      let voteNum={
+        voteNum:this.globalGridAttr.voteNum
       }
-      this.curCel.setData(voteSum)
+      this.curCel.setData(voteNum)
       this.curCel = this.nodeOpt(this.id,this.globalGridAttr)
     },
     // 鍙潬鎬у垎甯冪被鍨�
@@ -267,21 +315,34 @@
     },
     // mtbf
     onTaskMtbcfChange(e){
-      this.globalGridAttr.taskMtbcf =e
-      let taskMtbcf={
-        taskMtbcf:this.globalGridAttr.taskMtbcf
+      const numberRegex = /^-?\d+(\.\d+)?$/
+      if(numberRegex.test(e)){
+          this.globalGridAttr.taskMtbcf =e
+          let taskMtbcf={
+              taskMtbcf:this.globalGridAttr.taskMtbcf
+          }
+          this.curCel.setData(taskMtbcf)
+          this.curCel = this.nodeOpt(this.id,this.globalGridAttr)
+      }else {
+        this.$message.error('杈撳叆鏍煎紡鏈夎锛岃杈撳叆瀹炴暟')
       }
-      this.curCel.setData(taskMtbcf)
-      this.curCel = this.nodeOpt(this.id,this.globalGridAttr)
+
     },
     // 鍙傛暟2
     onTaskMtbcfOtherChange(e){
-      this.globalGridAttr.taskMtbcfOther = e
-      let taskMtbcfOther={
-        taskMtbcfOther:this.globalGridAttr.taskMtbcfOther
+      const numberRegex = /^-?\d+(\.\d+)?$/
+      console.log(e,'eeeee')
+      if(numberRegex.test(e)){
+        this.globalGridAttr.taskMtbcfOther = e
+        let taskMtbcfOther={
+          taskMtbcfOther:this.globalGridAttr.taskMtbcfOther
+        }
+        this.curCel.setData(taskMtbcfOther)
+        this.curCel = this.nodeOpt(this.id,this.globalGridAttr)
+      }else {
+        this.$message.error('杈撳叆鏍煎紡鏈夎锛岃杈撳叆瀹炴暟')
       }
-      this.curCel.setData(taskMtbcfOther)
-      this.curCel = this.nodeOpt(this.id,this.globalGridAttr)
+
     },
     // 鏄惁鍙淮淇�
     onIsRepairChange(e){
@@ -304,21 +365,32 @@
     },
     // Mttcr
     onRepairMttcrChange(e){
-      this.globalGridAttr.repairMttcr = e
-      let repairMttcr={
-        repairMttcr:this.globalGridAttr.repairMttcr
+      const numberRegex = /^-?\d+(\.\d+)?$/
+      if(numberRegex.test(e)){
+        this.globalGridAttr.repairMttcr = e
+        let repairMttcr={
+          repairMttcr:this.globalGridAttr.repairMttcr
+        }
+        this.curCel.setData(repairMttcr)
+        this.curCel = this.nodeOpt(this.id,this.globalGridAttr)
+      }else {
+        this.$message.error('杈撳叆鏍煎紡鏈夎锛岃杈撳叆瀹炴暟')
       }
-      this.curCel.setData(repairMttcr)
-      this.curCel = this.nodeOpt(this.id,this.globalGridAttr)
+
     },
     // 鍙淮淇�у垎甯冪被鍨� 鍙傛暟2
     onRepairMttcrOtherChange(e){
-      this.globalGridAttr.repairMttcrOther = e
-      let repairMttcrOther={
-        repairMttcrOther:this.globalGridAttr.repairMttcrOther
+      const numberRegex = /^-?\d+(\.\d+)?$/
+      if(numberRegex.test(e)) {
+        this.globalGridAttr.repairMttcrOther = e
+        let repairMttcrOther = {
+          repairMttcrOther: this.globalGridAttr.repairMttcrOther
+        }
+        this.curCel.setData(repairMttcrOther)
+        this.curCel = this.nodeOpt(this.id, this.globalGridAttr)
+      }else {
+        this.$message.error('杈撳叆鏍煎紡鏈夎锛岃杈撳叆瀹炴暟')
       }
-      this.curCel.setData(repairMttcrOther)
-      this.curCel = this.nodeOpt(this.id,this.globalGridAttr)
     },
     onStatusImgChange(e){
       this.globalGridAttr.statusImg = e
@@ -361,6 +433,7 @@
         if (!cell || !cell.isNode()) {
           return
         }
+        this.showNumberInput = false
         this.curCel = cell
         globalGridAttr.nodeStroke = cell.attr('body/stroke')
         globalGridAttr.nodeStrokeWidth = cell.attr('body/strokeWidth')
@@ -387,6 +460,12 @@
         globalGridAttr.taskMtbcf = cell.getData().taskMtbcf
         globalGridAttr.taskMtbcfOther = cell.getData().taskMtbcfOther
         globalGridAttr.isRepair = cell.getData().isRepair
+        globalGridAttr.voteNum = cell.getData().voteNum
+        console.log(cell.getData().voteNum,'cell.getData().voteNum')
+        if(cell.getData().voteNum!==undefined ||  this.globalGridAttr.nodeTypeExt === 'vote' || this.nodeType==='vote'){
+          this.showNumberInput = true
+        }
+        console.log(this.showNumberInput,'this.showNumberInput')
         this.showRepairInput = cell.getData().isRepair
         cell.removeTools()
         cell.addTools([

--
Gitblit v1.9.1