Ver código fonte

Merge branch 'master' of http://121.37.208.192:3000/root/interlock_client

dongjh 2 meses atrás
pai
commit
a3e41ba1a0

+ 14 - 14
src/views/module_interLock/baseInterLock/modules/BaseInterLockModal.vue

@@ -59,14 +59,14 @@
               <!-- :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" -->
           </a-form-model-item>
           <a-form-model-item label="默认类别" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="interlockType">
-            <!-- <j-dict-select-tag
+            <j-dict-select-tag
               ref="systemTypeRef"
               type="radio"
               v-model="model.systemType"  dictCode="system_type"
-              placeholder="请选择默认类别"/> -->
-              <a-radio-group name="radioGroup" v-model="model.systemType">
+              placeholder="请选择默认类别"/>
+              <!-- <a-radio-group name="radioGroup" v-model="model.systemType">
                 <a-radio :value="item.value" v-for="item in systemTypeDicts" :key="item.value"> {{item.label}} </a-radio>
-              </a-radio-group>
+              </a-radio-group> -->
           </a-form-model-item>
           <a-divider orientation="left"> <span>状态值设置</span> </a-divider>
           <!-- 控制系统状态 -->
@@ -326,20 +326,20 @@
       }
     },
     created () {
-      this.initDictConfig()
+      // this.initDictConfig()
       //备份model原始值
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
     },
     methods: {
-      initDictConfig() {
-        //初始化字典 - 性别
-        initDictOptions('system_type').then((res) => {
-          console.log(res)
-          if (res.success) {
-            this.systemTypeDicts = res.result.filter(item => item.value<2);
-          }
-        });
-      },
+      // initDictConfig() {
+      //   //初始化字典 - 系统类别:原是3个还有个其他,后来需求改变了不需要过滤处理了
+      //   initDictOptions('system_type').then((res) => {
+      //     console.log(res)
+      //     if (res.success) {
+      //       this.systemTypeDicts = res.result.filter(item => item.value<2);
+      //     }
+      //   });
+      // },
       // 父级节点-装置改变时
       pidChange(e, option){
         console.log(e, option)

+ 52 - 106
src/views/module_interLock/interlockSummarySet/InterlockConditionForm.vue

@@ -94,6 +94,7 @@
           <!-- 仪表状态开始 -->
           <a-divider orientation="left"> <span>仪表状态</span> </a-divider>
           <a-col :span="24">
+            <!-- 0819修改需求为高低限判断和突变的默认值只为系统配置中的类别有关,此处无需修改类别但能自定义输入,若需要查看上一版代码见同级别的--choose或上一版git -->
             <a-form-model-item label="仪表状态判定依据" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="instrumentStatusJuge">
               <a-radio-group name="radioGroup" v-model="model.instrumentStatusJuge">
                 <!-- @change="instrumentStatusJugeChange" -->
@@ -134,28 +135,15 @@
               </a-form-model-item>
             </a-col>
             <a-col :span="24">
-              <a-form-model-item label="系统" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="instrumentGDXT">
-                <!-- <a-radio-group name="radioGroup" v-model="model.instrumentGDXT" @change="instrumentGDXTChange">
-                  <a-radio value="Tricon"> Tricon </a-radio>
-                  <a-radio value="TSxPlus"> TSxPlus </a-radio>
-                  <a-radio value="qita"> 其他 </a-radio>
-                </a-radio-group> -->
-                <j-dict-select-tag
-                  type="radio"
-                  v-model="model.systemTypeGd"  dictCode="system_type"
-                  placeholder="请选择" @change="instrumentGDXTChange"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :span="24">
               <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="请输入高限" :disabled="model.systemTypeGd !== '2'"></a-input>
+                <a-auto-complete :data-source="upperLimitGdDefault" v-model="model.upperLimitGd" :filter-option="filterOption" 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="lowerLimitGd">
-                <!-- <a-auto-complete :data-source="['737', '10722']" v-model="model.lowerLimit" placeholder="请输入低限"></a-auto-complete> -->
-                <a-input v-model="model.lowerLimitGd" placeholder="请输入低限" :disabled="model.systemTypeGd !== '2'"></a-input>
+                <a-auto-complete :data-source="lowerLimitGdDefault" v-model="model.lowerLimitGd" :filter-option="filterOption" placeholder="请输入低限"></a-auto-complete>
+                <!-- <a-input v-model="model.lowerLimitGd" placeholder="请输入低限"></a-input> -->
               </a-form-model-item>
             </a-col>
           </template>
@@ -172,56 +160,27 @@
               </a-form-model-item>
             </a-col>
             <a-col :span="24">
-              <a-form-model-item label="系统" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="instrumentTBXT">
-                <!-- <a-radio-group name="radioGroup" v-model="model.instrumentTBXT" @change="instrumentTBXTChange">
-                  <a-radio value="Tricon"> Tricon </a-radio>
-                  <a-radio value="TSxPlus"> TSxPlus </a-radio>
-                  <a-radio value="qita"> 其他 </a-radio>
-                </a-radio-group> -->
-                <j-dict-select-tag
-                  type="radio"
-                  v-model="model.systemTypeTb"  dictCode="system_type"
-                  placeholder="请选择" @change="instrumentTBXTChange"/>
-              </a-form-model-item>
-            </a-col>
-            <a-col :span="24">
               <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="upperLimitTb">
-                    <!-- <a-auto-complete :data-source="['4095', '59577']" v-model="model.upperLimit" placeholder="请输入高限"></a-auto-complete> -->
-                    <a-input v-model="model.upperLimitTb" placeholder="请输入高限" :disabled="model.systemTypeTb !== '2'"></a-input>
+                    <a-auto-complete :data-source="upperLimitTbDefault" v-model="model.upperLimitTb" :filter-option="filterOption" 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="lowerLimitTb">
-                    <!-- <a-auto-complete :data-source="['819', '11915']" v-model="model.lowerLimit" placeholder="请输入低限"></a-auto-complete> -->
-                    <a-input v-model="model.lowerLimitTb" placeholder="请输入低限" :disabled="model.systemTypeTb !== '2'"></a-input>
+                    <a-auto-complete :data-source="lowerLimitTbDefault" v-model="model.lowerLimitTb" :filter-option="filterOption" 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">
-                    <a-input v-model="model.thresholdValueN" placeholder="请输入阈值" :disabled="model.systemTypeTb !== '2'"></a-input>
-                    <!-- <a-auto-complete :data-source="['1']" v-model="model.thresholdValueN" placeholder="请输入阈值"></a-auto-complete> -->
+                    <a-auto-complete :data-source="['1']" v-model="model.thresholdValueN" :filter-option="filterOption" placeholder="请输入阈值"></a-auto-complete>
+                    <!-- <a-input v-model="model.thresholdValueN" placeholder="请输入阈值"></a-input> -->
                   </a-form-model-item>
                   <div style="width: 30px;text-align: center;"> % </div>
                 </div>
               </a-form-model-item>
             </a-col>
-            <!-- <a-col :span="24">
-              <a-form-model-item label="高限值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upperLimit">
-                <a-input v-model="model.upperLimit" 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-input v-model="model.lowerLimit" placeholder="请输入低限"></a-input>
-              </a-form-model-item>
-            </a-col> -->
-            <!-- <a-col :span="24"> -->
-              <!-- <a-form-model-item label="阈值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="thresholdValueN">
-                <a-input v-model="model.thresholdValueN" suffix="%" placeholder="请输入阈值"></a-input> -->
-                <!-- addon-after="%" -->
-              <!-- </a-form-model-item> -->
-            <!-- </a-col> -->
             <a-col :span="24">
               <a-form-model-item label="突变判断时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="thresholdTime">
                 <a-input v-model="model.thresholdTime" suffix="S" placeholder="请输入时间"></a-input>
@@ -244,7 +203,11 @@
                 <!--  :default-value="model.ifBypass" -->
                 <a-radio :value="'0'"> 否 </a-radio>
                 <a-radio :value="'1'"> 是 </a-radio>
+                <a-radio :value="'2'"> 现场旁路 </a-radio>
               </a-radio-group>
+              <template v-if="model.ifBypass === '0'">
+                <a-input v-model="model.bypassDefault" disabled></a-input>
+              </template>
             </a-form-model-item>
           </a-col>
           <template v-if="model.ifBypass === '1'">
@@ -259,11 +222,9 @@
               </a-form-model-item>
             </a-col>
           </template>
-          <template v-if="model.ifBypass === '0'">
+          <template v-if="model.ifBypass === '2'">
             <a-col :span="24">
               <a-form-model-item label="旁路状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bypassNo">
-                <!-- <a-input v-model="model.bypassNo" disabled></a-input> -->
-                <!-- placeholder="无旁路" :default-value="bypassNo" -->
                 <a-select v-model="model.bypassNo" @change="bypassChange">
                   <a-select-option :value="item.value" v-for="item in byPassOptions" :key="item.value"> {{ item.title }} </a-select-option>
                 </a-select>
@@ -316,9 +277,14 @@
           lowerLimitTb: null,
           thresholdValueN: '1',
           ifBypass: '1', // 是否有旁路-是
+          bypassDefault: null, // 是否有旁路-否显示的正常状态值
           bypassNo: '0', // 旁路默认值
           bypass: null, // MP状态默认值默认参数
         },
+        upperLimitTbDefault: [],
+        lowerLimitTbDefault: [],
+        upperLimitGdDefault: [],
+        lowerLimitGdDefault: [],
         labelCol: {
           xs: { span: 24 },
           sm: { span: 5 },
@@ -429,7 +395,18 @@
         this.model.mpStatusDefault = controlSystemStatusDefault
         // 仪表状态
         this.model.instrumentStatusDefault = this.itSystemDefaultValue.instrumentStatusNormalName +'('+ this.itSystemDefaultValue.instrumentStatusNormal+')'
+        // 过滤数组
+        var upperLimitTbDefault = this.itSystemDefaultValue.systemType === '0' ? '4095' : '59577'
+        var lowerLimitTbDefault = this.itSystemDefaultValue.systemType === '0' ? '819' : '11915'
+        var upperLimitGdDefault = this.itSystemDefaultValue.systemType === '0' ? '4258' : '61948'
+        var lowerLimitGdDefault = this.itSystemDefaultValue.systemType === '0' ? '737' : '10722'
+        this.upperLimitTbDefault.push(upperLimitTbDefault)
+        this.lowerLimitTbDefault.push(lowerLimitTbDefault)
+        this.upperLimitGdDefault.push(upperLimitGdDefault)
+        this.lowerLimitGdDefault.push(lowerLimitGdDefault)
+        
         // 旁路状态
+        this.model.bypassDefault = this.itSystemDefaultValue.bypassYesName +'('+ this.itSystemDefaultValue.bypassYes+')'
         this.byPassOptions = []
         this.byPassOptions.push({
           value: this.itSystemDefaultValue.bypassYes,
@@ -444,6 +421,12 @@
         // 初始化
         this.model.thresholdValueN = '1'
       },
+      // 过滤
+      filterOption(input, option) {
+        return (
+          option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0
+        );
+      },
       // 获取所有位号
       // getTagInfo(){
       //   postAction(this.url.getTagInfo).then(res => {
@@ -464,48 +447,11 @@
       bypassChange(){
         this.model = { ...this.model }
       },
-      // 点位状态依据改变时
-      // instrumentStatusJugeChange(e){
-      //   console.log(e)
-      //   this.model.upperLimit = null
-      //   this.model.lowerLimit = null
-      // },
-      // 高低限判断系统参考改变
-      instrumentGDXTChange(e){
-        // e.target.value === 'Tricon'
-        // console.log(e)
-        if(e === '0'){
-          this.model.upperLimitGd = '4258'
-          this.model.lowerLimitGd = '737'
-        }
-        if(e === '1'){
-          this.model.upperLimitGd = '61948'
-          this.model.lowerLimitGd = '10722'
-        }
-        if(e === '2'){
-          this.model.upperLimitGd = ''
-          this.model.lowerLimitGd = ''
-        }
-      },
-      instrumentTBXTChange(e){
-        if(e === '0'){
-          this.model.upperLimitTb = '4095'
-          this.model.lowerLimitTb = '819'
-        }
-        if(e === '1'){
-          this.model.upperLimitTb = '59577'
-          this.model.lowerLimitTb = '11915'
-        }
-        if(e === '2'){
-          this.model.upperLimitTb = ''
-          this.model.lowerLimitTb = ''
-        }
-      },
       add () {
-        this.model.systemTypeGd = this.itSystemDefaultValue.systemType
-        this.model.systemTypeTb = this.itSystemDefaultValue.systemType
-        this.instrumentGDXTChange(this.model.systemTypeGd)
-        this.instrumentTBXTChange(this.model.systemTypeTb)
+        this.model.upperLimitGd = this.itSystemDefaultValue.systemType === '0' ? '4258' : '61948'
+        this.model.lowerLimitGd = this.itSystemDefaultValue.systemType === '0' ? '737' : '10722'
+        this.model.upperLimitTb = this.itSystemDefaultValue.systemType === '0' ? '4095' : '59577'
+        this.model.lowerLimitTb = this.itSystemDefaultValue.systemType === '0' ? '819' : '11915'
         // 设置状态默认值
         this.setDefaultValue()
       },
@@ -527,18 +473,10 @@
           // 高低限赋值--依据转换后还保持刚刚的选择
           this.model.upperLimitGd = record.upperLimit
           this.model.lowerLimitGd = record.lowerLimit
-          this.model.systemTypeGd = record.systemType
-          this.model.systemTypeTb = this.itSystemDefaultValue.systemType
-          this.instrumentGDXTChange(this.model.systemTypeGd)
-          this.instrumentTBXTChange(this.model.systemTypeTb)
         }
         if(this.model.instrumentStatusJuge === '2'){
           this.model.upperLimitTb = record.upperLimit
           this.model.lowerLimitTb = record.lowerLimit
-          this.model.systemTypeTb = record.systemType
-          this.model.systemTypeGd = this.itSystemDefaultValue.systemType
-          this.instrumentGDXTChange(this.model.systemTypeGd)
-          this.instrumentTBXTChange(this.model.systemTypeTb)
           // 仪表状态-阈值Math.round解决相乘会出现很多小数的情况
           this.model.thresholdValueN = Math.round(parseInt(record.thresholdValue)*100)
           // this.model.thresholdValueN = (parseInt(record.thresholdValue)*100).toFixed(0)
@@ -547,12 +485,16 @@
         // this.model.currentValueData = [record.currentValueDeviceId, record.currentValueModuleName, record.currentValueTag+'&'+record.currentValue]
         // 旁路
         if(record.ifBypass === '0'){
+          this.model.bypassNo = '0'
           this.model.bypassNo = record.bypass
         }
         if(record.ifBypass === '1'){
           this.model.bypassNo = '0'
           this.model.bypassData = [record.bypassDeviceId, record.bypassModuleName, record.bypassTag+'&'+record.bypass]
         }
+        if(record.ifBypass === '2'){
+          this.model.bypassNo = record.bypass
+        }
         // 输入卡件状态
         this.model.inputStatusRadio = record.inputStatusTag ? '1' : '0'
         if(record.inputStatusTag){
@@ -627,8 +569,7 @@
             // 旁路位号
             if(this.model.ifBypass === '0'){
               // 否
-              this.model.bypass = this.model.bypassNo
-              // this.model.bypass = this.itSystemDefaultValue.bypassYes
+              this.model.bypass = this.itSystemDefaultValue.bypassYes
             }
             if(this.model.ifBypass === '1'){
               // 是
@@ -637,6 +578,11 @@
               this.model.bypassTag = (this.model.bypassData[2].split('&'))[0]
               this.model.bypass = (this.model.bypassData[2].split('&'))[1]
             }
+            if(this.model.ifBypass === '2'){
+              // 现场旁路
+              this.model.bypass = this.model.bypassNo
+              // this.model.bypass = this.itSystemDefaultValue.bypassYes
+            }
             
             // 输入卡件状态
             if(this.model.inputStatusRadio === '1' && this.model.inputStatusData && this.model.inputStatusData.length  > 0){

+ 7 - 4
src/views/module_interLock/interlockSummarySet/InterlockSummarySet.vue

@@ -97,11 +97,14 @@
             </span>
             <!-- 是否旁路 -->
             <span slot="ifBypass" slot-scope="text, record">
+              <!-- 否:正常状态 -->
+              <span v-if="record.ifBypass === '0'">{{ (record.bypassYesName?record.bypassYesName:itSystemDefaultValue.bypassYesName)+'('+record.bypass+')' }}</span>
+              <!-- 是 -->
               <span v-if="record.ifBypass === '1'">{{ record.bypassTag }}</span>
-              <!-- 否+正常 -->
-              <span v-if="record.ifBypass === '0' && record.bypass === '0'">{{ (record.bypassYesName?record.bypassYesName:itSystemDefaultValue.bypassYesName)+'('+record.bypass+')' }}</span>
-              <!-- +异常 -->
-              <span v-if="record.ifBypass === '0' && record.bypass === '1'">{{ (record.bypassNoName?record.bypassNoName:itSystemDefaultValue.bypassNoName)+'('+record.bypass+')' }}</span>
+              <!-- 现场旁路+正常 -->
+              <span v-if="record.ifBypass === '2' && record.bypass === '0'">{{ (record.bypassYesName?record.bypassYesName:itSystemDefaultValue.bypassYesName)+'('+record.bypass+')' }}</span>
+              <!-- 现场旁路+异常 -->
+              <span v-if="record.ifBypass === '2' && record.bypass === '1'">{{ (record.bypassNoName?record.bypassNoName:itSystemDefaultValue.bypassNoName)+'('+record.bypass+')' }}</span>
             </span>
             <!-- 操作 -->
             <span slot="action" slot-scope="text, record, index">