Explorar o código

优化联锁编辑

yuhan hai 4 meses
pai
achega
9b2191357e

+ 57 - 30
src/views/module_interLock/InterlockSummary/modules/InterlockConditionForm.vue

@@ -135,13 +135,15 @@
               </a-form-model-item>
             </a-col>
             <a-col :span="24">
-              <a-form-model-item label="高限值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upperLimit">
-                <a-auto-complete :data-source="['4258', '61948']" v-model="model.upperLimit" placeholder="请输入高限"></a-auto-complete>
+              <a-form-model-item label="高限值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upperLimitGd">
+                <!-- <a-auto-complete :data-source="['4258', '61948']" v-model="model.upperLimit" placeholder="请输入高限"></a-auto-complete> -->
+                <a-input v-model="model.upperLimitGd" placeholder="请输入高限"></a-input>
               </a-form-model-item>
             </a-col>
             <a-col :span="24">
-              <a-form-model-item label="低限值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lowerLimit">
-                <a-auto-complete :data-source="['737', '10722']" v-model="model.lowerLimit" placeholder="请输入低限"></a-auto-complete>
+              <a-form-model-item label="低限值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lowerLimitGd">
+                <!-- <a-auto-complete :data-source="['737', '10722']" v-model="model.lowerLimit" placeholder="请输入低限"></a-auto-complete> -->
+                <a-input v-model="model.lowerLimitGd" placeholder="请输入低限"></a-input>
               </a-form-model-item>
             </a-col>
           </template>
@@ -169,12 +171,14 @@
               <a-form-model-item label="突变判断公式" :labelCol="labelCol" :wrapperCol="wrapperCol" class="red-star-form-item">
                 <div style="display: flex;">
                   <div style="width: 30px;text-align: center;">( </div>
-                  <a-form-model-item prop="upperLimit">
-                    <a-auto-complete :data-source="['4095', '59577']" v-model="model.upperLimit" placeholder="请输入高限"></a-auto-complete>
+                  <a-form-model-item prop="upperLimitTb">
+                    <!-- <a-auto-complete :data-source="['4095', '59577']" v-model="model.upperLimit" placeholder="请输入高限"></a-auto-complete> -->
+                    <a-input v-model="model.upperLimitTb" placeholder="请输入高限"></a-input>
                   </a-form-model-item>
                   <div style="width: 30px;text-align: center;"> - </div>
-                  <a-form-model-item prop="lowerLimit">
-                    <a-auto-complete :data-source="['819', '11915']" v-model="model.lowerLimit" placeholder="请输入低限"></a-auto-complete>
+                  <a-form-model-item prop="lowerLimitTb">
+                    <!-- <a-auto-complete :data-source="['819', '11915']" v-model="model.lowerLimit" placeholder="请输入低限"></a-auto-complete> -->
+                    <a-input v-model="model.lowerLimitTb" placeholder="请输入低限"></a-input>
                   </a-form-model-item>
                   <div style="width: 60px;text-align: center;">)* </div>
                   <a-form-model-item prop="thresholdValueN">
@@ -288,10 +292,12 @@
           mpStatusDefault: null, // MP状态默认值默认参数
           instrumentStatusJuge: '0', // 仪表判定依据-位号读取
           // instrumentStatus: null, // 仪表状态默认值默认参数
-          instrumentGDXT: 'Tricon',
-          instrumentTBXT: 'Tricon',
-          upperLimit: null,
-          lowerLimit: null,
+          instrumentGDXT: '',
+          instrumentTBXT: '',
+          upperLimitGd: null,
+          lowerLimitGd: null,
+          upperLimitTb: null,
+          lowerLimitTb: null,
           thresholdValueN: '1',
           ifBypass: '1', // 是否有旁路-是
           bypassNo: null, // 旁路默认值
@@ -320,10 +326,16 @@
           ysmnlData: [{
             required: true, message: '请选择原始模拟量!',
           }],
-          upperLimit: [{
+          upperLimitGd: [{
+            required: true, message: '请输入高限值!',
+          }],
+          lowerLimitGd: [{
+            required: true, message: '请输入低限值!',
+          }],
+          upperLimitTb: [{
             required: true, message: '请输入高限值!',
           }],
-          lowerLimit: [{
+          lowerLimitTb: [{
             required: true, message: '请输入低限值!',
           }],
           // 突变超限
@@ -392,15 +404,16 @@
         // this.$set(this.model, 'inputStatusRadio', e.target.value)
         this.model = {...this.model}
       },
-      // 设置状态默认值
+      // 设置状态默认值和初始化值
       setDefaultValue(){
-        console.log('set',this.itSystemDefaultValue, this.model)
         // this.$set(this.model, 'inputStatusDefault', this.itSystemDefaultValue.controlSystemStatusNormal)
         var instrumentStatusDefault = this.itSystemDefaultValue.instrumentStatusNormalName +'('+ this.itSystemDefaultValue.controlSystemStatusNormal+')'
         this.model.inputStatusDefault = instrumentStatusDefault
         this.model.outputStatusDefault = instrumentStatusDefault
         this.model.mpStatusDefault = instrumentStatusDefault
         this.model.bypassNo = this.itSystemDefaultValue.bypassYesName +'('+ this.itSystemDefaultValue.bypassYes +')'
+        // 初始化
+        this.model.thresholdValueN = '1'
       },
       // 获取所有位号
       // getTagInfo(){
@@ -419,30 +432,30 @@
         console.log(e)
       },
       // 点位状态依据改变时
-      instrumentStatusJugeChange(e){
-        console.log(e)
-        this.model.upperLimit = null
-        this.model.lowerLimit = null
-      },
+      // instrumentStatusJugeChange(e){
+      //   console.log(e)
+      //   this.model.upperLimit = null
+      //   this.model.lowerLimit = null
+      // },
       // 高低限判断系统参考改变
       instrumentGDXTChange(e){
         if(e.target.value === 'Tricon'){
-          this.model.upperLimit = '4258'
-          this.model.lowerLimit = '737'
+          this.model.upperLimitGd = '4258'
+          this.model.lowerLimitGd = '737'
         }
         if(e.target.value === 'TSxPlus'){
-          this.model.upperLimit = '61948'
-          this.model.lowerLimit = '10722'
+          this.model.upperLimitGd = '61948'
+          this.model.lowerLimitGd = '10722'
         }
       },
       instrumentTBXTChange(e){
         if(e.target.value === 'Tricon'){
-          this.model.upperLimit = '4095'
-          this.model.lowerLimit = '819'
+          this.model.upperLimitTb = '4095'
+          this.model.lowerLimitTb = '819'
         }
         if(e.target.value === 'TSxPlus'){
-          this.model.upperLimit = '59577'
-          this.model.lowerLimit = '11915'
+          this.model.upperLimitTb = '59577'
+          this.model.lowerLimitTb = '11915'
         }
       },
       add () {
@@ -450,7 +463,7 @@
         this.setDefaultValue()
       },
       edit (record) {
-        console.log(record)
+        // console.log(record)
         this.model = Object.assign({}, record);
         // 联锁条件
         this.model.interlockConditionData = [record.interlockConditionDeviceId, record.interlockConditionModuleName, record.interlockConditionTag+'&'+record.interlockCondition]
@@ -463,7 +476,14 @@
           // 仪表状态-原始模拟量位号
           this.model.ysmnlData = [record.ysmnlDeviceId, record.ysmnlModuleName, record.ysmnlTag+'&'+record.ysmnlValue]
         }
+        if(this.model.instrumentStatusJuge === '1'){
+          // 高低限赋值--依据转换后还保持刚刚的选择
+          this.model.upperLimitGd = record.upperLimit
+          this.model.lowerLimitGd = record.lowerLimit
+        }
         if(this.model.instrumentStatusJuge === '2'){
+          this.model.upperLimitTb = record.upperLimit
+          this.model.lowerLimitTb = record.lowerLimit
           // 仪表状态-阈值Math.round解决相乘会出现很多小数的情况
           this.model.thresholdValueN = Math.round(parseInt(record.thresholdValue)*100)
           // this.model.thresholdValueN = (parseInt(record.thresholdValue)*100).toFixed(0)
@@ -523,7 +543,14 @@
               this.model.ysmnlTag = (this.model.ysmnlData[2].split('&'))[0]
               this.model.ysmnlValue = (this.model.ysmnlData[2].split('&'))[1]
             }
+            if(this.model.instrumentStatusJuge === '1'){
+              // 根据状态给后端高低限赋值
+              this.model.upperLimit = this.model.upperLimitGd
+              this.model.lowerLimit = this.model.lowerLimitGd
+            }
             if(this.model.instrumentStatusJuge === '2'){
+              this.model.upperLimit = this.model.upperLimitTb
+              this.model.lowerLimit = this.model.lowerLimitTb
               // 仪表状态-阈值--设置thresholdValueN是防止自身转换出现问题
               this.model.thresholdValue = parseInt(this.model.thresholdValueN)/100
             }

+ 11 - 7
src/views/module_interLock/InterlockSummary/modules/InterlockSummaryForm.vue

@@ -87,14 +87,18 @@
               <template v-if="record.instrumentStatusJuge === '1'">
                 <span>位号:{{ record.ysmnlTag }}</span><br/>
                 <span>
-                  <span>高限值:{{ record.upperLimit }}</span>
+                  <span>高限值:{{ record.upperLimit }}</span>&nbsp;
                   <span>低限值:{{ record.lowerLimit }}</span>
                 </span>
               </template>
               <template v-if="record.instrumentStatusJuge === '2'">
-                <span>位号:{{ record.ysmnlTag }}</span>
+                <span>位号:{{ record.ysmnlTag }}</span><br/>
+                <span>
+                  <span>高限值:{{ record.upperLimit }}</span> &nbsp;
+                  <span>低限值:{{ record.lowerLimit }}</span>
+                </span><br/>
                 <span>
-                  <span>时间:{{ record.thresholdTime }}</span>
+                  <span>时间:{{ record.thresholdTime }}</span>&nbsp;
                   <span>阈值:{{ record.thresholdValue }}</span>
                 </span>
               </template>
@@ -102,7 +106,7 @@
             <!-- 是否旁路 -->
             <span slot="ifBypass" slot-scope="text, record">
               <span v-if="record.ifBypass === '1'">{{ record.bypassTag }}</span>
-              <span v-if="record.ifBypass === '0'">{{ itSystemDefaultValue.bypassYesName+'('+record.bypass+')' }}</span>
+              <span v-if="record.ifBypass === '0'">{{ record.bypass_dictText+'('+record.bypass+')' }}</span>
             </span>
             <!-- 操作 -->
             <span slot="action" slot-scope="text, record, index">
@@ -291,7 +295,7 @@
               if(record.inputStatusTag){
                 return record.inputStatusTag
               } else {
-                return this.itSystemDefaultValue.instrumentStatusNormalName +'('+ record.inputStatus+')'
+                return record.inputStatus_dictText +'('+ record.inputStatus+')'
               }
             }
           },
@@ -303,7 +307,7 @@
               if(record.outputStatusTag){
                 return record.outputStatusTag
               } else {
-                return this.itSystemDefaultValue.instrumentStatusNormalName +'('+ record.outputStatus+')'
+                return record.outputStatus_dictText +'('+ record.outputStatus+')'
               }
             }
           },
@@ -315,7 +319,7 @@
               if(record.mpStatusTag){
                 return record.mpStatusTag
               } else {
-                return this.itSystemDefaultValue.instrumentStatusNormalName +'('+ record.mpStatus+')'
+                return record.mpStatus_dictText +'('+ record.mpStatus+')'
               }
             }
           },