Browse Source

系统各状态默认参数设置

yuhan 4 months ago
parent
commit
3cc62b7ec0
1 changed files with 171 additions and 48 deletions
  1. 171 48
      src/views/module_interLock/baseInterLock/modules/BaseInterLockModal.vue

+ 171 - 48
src/views/module_interLock/baseInterLock/modules/BaseInterLockModal.vue

@@ -56,23 +56,119 @@
               <!-- :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" -->
           </a-form-model-item>
           <a-divider orientation="left"> <span style="font-size: 12px;">状态值设置</span> </a-divider>
-          <a-form-model-item label="输入卡件状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inputStatusNormal">
-            <j-dict-select-tag v-model="model.inputStatusNormal"  placeholder="请设置状态" dictCode="input_status_normal"/>
+          <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mpStatusNormal">
+            <span slot="label">
+              控制系统状态&nbsp;
+              <a-tooltip title="选择对应状态代表的参数值并自定义系统中显示的名称">
+                <a-icon type="question-circle-o" />
+              </a-tooltip>
+            </span>
+            <div style="display: flex;align-items: center;">
+              <span style="width: 100px;">正常状态:</span>
+              <a-input-group compact>
+                <a-select v-model="model.controlSystemStatusNormal" style="width: 15%" @change="controlNormalChange">
+                  <a-select-option value="0"> 0 </a-select-option>
+                  <a-select-option value="1"> 1 </a-select-option>
+                </a-select>
+                <a-input v-model="model.controlSystemStatusNormalName" default-value="正常" placeholder="请输入改状态系统中显示名称" style="width: 85%"/>
+              </a-input-group>
+            </div>
+            <div style="display: flex;align-items: center;">
+              <span style="width: 100px;">异常状态:</span>
+              <a-input-group compact>
+                <a-select v-model="model.controlSystemStatusAbnormal" style="width: 15%" @change="controlAbnormalChange">
+                  <a-select-option value="0"> 0 </a-select-option>
+                  <a-select-option value="1"> 1 </a-select-option>
+                </a-select>
+                <a-input v-model="model.controlSystemStatusAbnormalName" default-value="非正常" placeholder="请输入改状态系统中显示名称" style="width: 85%"/>
+              </a-input-group>
+            </div>
           </a-form-model-item>
-          <a-form-model-item label="输出卡件状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="outputStatusNormal">
-            <j-dict-select-tag v-model="model.outputStatusNormal"  placeholder="请设置状态" dictCode="output_status_normal"/>
+          <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mpStatusNormal">
+            <span slot="label">
+              旁路状态&nbsp;
+              <a-tooltip title="选择对应状态代表的参数值并自定义系统中显示的名称">
+                <a-icon type="question-circle-o" />
+              </a-tooltip>
+            </span>
+            <div style="display: flex;align-items: center;">
+              <span style="width: 100px;">正常状态:</span>
+              <a-input-group compact>
+                <a-select v-model="model.bypassYes" style="width: 15%" @change="bypassYesChange">
+                  <a-select-option value="0"> 0 </a-select-option>
+                  <a-select-option value="1"> 1 </a-select-option>
+                </a-select>
+                <a-input v-model="model.bypassYesName" default-value="是" placeholder="请输入改状态系统中显示名称" style="width: 85%"/>
+              </a-input-group>
+            </div>
+            <div style="display: flex;align-items: center;">
+              <span style="width: 100px;">异常状态:</span>
+              <a-input-group compact>
+                <a-select v-model="model.bypassNo" style="width: 15%" @change="bypassNoChange">
+                  <a-select-option value="0"> 0 </a-select-option>
+                  <a-select-option value="1"> 1 </a-select-option>
+                </a-select>
+                <a-input v-model="model.bypassNoName" default-value="否" placeholder="请输入改状态系统中显示名称" style="width: 85%"/>
+              </a-input-group>
+            </div>
           </a-form-model-item>
-          <a-form-model-item label="MP状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mpStatusNormal">
-            <j-dict-select-tag v-model="model.mpStatusNormal"  placeholder="请设置状态" dictCode="mp_status_normal"/>
+          <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mpStatusNormal">
+            <span slot="label">
+              仪表状态(位号读取)&nbsp;
+              <a-tooltip title="选择对应状态代表的参数值并自定义系统中显示的名称">
+                <a-icon type="question-circle-o" />
+              </a-tooltip>
+            </span>
+            <div style="display: flex;align-items: center;">
+              <span style="width: 100px;">正常状态:</span>
+              <a-input-group compact>
+                <a-select v-model="model.instrumentStatusNormal" style="width: 15%" @change="instrumentNormalChange">
+                  <a-select-option value="0"> 0 </a-select-option>
+                  <a-select-option value="1"> 1 </a-select-option>
+                </a-select>
+                <a-input v-model="model.instrumentStatusNormalName" default-value="正常" placeholder="请输入改状态系统中显示名称" style="width: 85%"/>
+              </a-input-group>
+            </div>
+            <div style="display: flex;align-items: center;">
+              <span style="width: 100px;">异常状态:</span>
+              <a-input-group compact>
+                <a-select v-model="model.instrumentStatusAbnormal" style="width: 15%" @change="instrumentAbnormalChange">
+                  <a-select-option value="0"> 0 </a-select-option>
+                  <a-select-option value="1"> 1 </a-select-option>
+                </a-select>
+                <a-input v-model="model.instrumentStatusAbnormalName" default-value="非正常" placeholder="请输入改状态系统中显示名称" style="width: 85%"/>
+              </a-input-group>
+            </div>
           </a-form-model-item>
-          <a-form-model-item label="旁路状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bypassYes">
-            <j-dict-select-tag v-model="model.bypassYes"  placeholder="请设置状态" dictCode="bypass_yes"/>
-          </a-form-model-item>
-          <a-form-model-item label="仪表状态(位号读取)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="instrumentStatusNormal">
-            <j-dict-select-tag v-model="model.instrumentStatusNormal"  placeholder="请设置状态" dictCode="instrument_status_normal"/>
+          <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mpStatusNormal">
+            <span slot="label">
+              联锁状态&nbsp;
+              <a-tooltip title="选择对应状态代表的参数值并自定义系统中显示的名称">
+                <a-icon type="question-circle-o" />
+              </a-tooltip>
+            </span>
+            <div style="display: flex;align-items: center;">
+              <span style="width: 100px;">投用状态:</span>
+              <a-input-group compact>
+                <a-select v-model="model.interlockStatusTy" style="width: 15%" @change="interlockTyChange">
+                  <a-select-option value="0"> 0 </a-select-option>
+                  <a-select-option value="1"> 1 </a-select-option>
+                </a-select>
+                <a-input v-model="model.interlockStatusTyName" default-value="投用" placeholder="请输入改状态系统中显示名称" style="width: 85%"/>
+              </a-input-group>
+            </div>
+            <div style="display: flex;align-items: center;">
+              <span style="width: 100px;">摘除状态:</span>
+              <a-input-group compact>
+                <a-select v-model="model.interlockStatusWty" style="width: 15%" @change="interlockWtyChange">
+                  <a-select-option value="0"> 0 </a-select-option>
+                  <a-select-option value="1"> 1 </a-select-option>
+                </a-select>
+                <a-input v-model="model.interlockStatusWtyName" default-value="未投用" placeholder="请输入改状态系统中显示名称" style="width: 85%"/>
+              </a-input-group>
+            </div>
           </a-form-model-item>
         </template>
-        
       </a-form-model>
     </a-spin>
   </j-modal>
@@ -94,11 +190,14 @@
         disableEdit: false,
         model:{
           interlockType: '0',
-          inputStatusNormal: '0',
-          outputStatusNormal	: '0',
-          mpStatusNormal: '0',
-          bypassYes: '0',
-          instrumentStatusNormal: '0',
+          controlSystemStatusNormal: '0', // 控制系统正常状态
+          controlSystemStatusAbnormal: '1',
+          bypassYes	: '1', // 旁路正常状态
+          bypassNo: '0',
+          instrumentStatusNormal: '0', // 仪表正常状态
+          instrumentStatusAbnormal: '1',
+          interlockStatusTy: '1', // 联锁正常状态
+          interlockStatusWty: '0',
         },
         labelCol: {
           xs: { span: 24 },
@@ -111,14 +210,14 @@
 
         confirmLoading: false,
         validatorRules: {
-          interlockType: [{required: true, message: '请选择类型'}],
-          interlockName: [{required: true, message: '请输入名称'}],
-          pid: [{required: true, message: '请选择上级'}],
-          inputStatusNormal: [{required: true, message: '请设置状态'}],
-          outputStatusNormal: [{required: true, message: '请设置状态'}],
-          mpStatusNormal: [{required: true, message: '请设置状态'}],
-          bypassYes: [{required: true, message: '请设置状态'}],
-          instrumentStatusNormal: [{required: true, message: '请设置状态'}],
+          // interlockType: [{required: true, message: '请选择类型'}],
+          // interlockName: [{required: true, message: '请输入名称'}],
+          // pid: [{required: true, message: '请选择上级'}],
+          // inputStatusNormal: [{required: true, message: '请设置状态'}],
+          // outputStatusNormal: [{required: true, message: '请设置状态'}],
+          // mpStatusNormal: [{required: true, message: '请设置状态'}],
+          // bypassYes: [{required: true, message: '请设置状态'}],
+          // instrumentStatusNormal: [{required: true, message: '请设置状态'}],
         },
         url: {
           add: "/base/interlockBase/add",
@@ -140,6 +239,31 @@
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
     },
     methods: {
+      // 参数值选择改变时
+      controlNormalChange(e){
+        this.model.controlSystemStatusAbnormal = e === '0' ? '1' : '0'
+      },
+      controlAbnormalChange(e){
+        this.model.controlSystemStatusNormal = e === '0' ? '1' : '0'
+      },
+      bypassYesChange(e){
+        this.model.bypassNo = e === '0' ? '1' : '0'
+      },
+      bypassNoChange(e){
+        this.model.bypassYes = e === '0' ? '1' : '0'
+      },
+      instrumentNormalChange(e){
+        this.model.instrumentStatusAbnormal = e === '0' ? '1' : '0'
+      },
+      instrumentAbnormalChange(e){
+        this.model.instrumentStatusNormal = e === '0' ? '1' : '0'
+      },
+      interlockTyChange(e){
+        this.model.interlockStatusWty = e === '0' ? '1' : '0'
+      },
+      interlockWtyChange(e){
+        this.model.interlockStatusTy = e === '0' ? '1' : '0'
+      },
       // 获取系统点位值设置数据
       getSystemValue(){
         getAction(this.url.getSystemValue).then(res => {
@@ -148,27 +272,27 @@
           }
         })
       },
-      change(e){
-        console.log(e)
-        var index = this.systemValueOptions.findIndex(item => item.value === e)
-        console.log(this.separateNumbersAndSymbols(this.systemValueOptions[index].label))
-      },
-      // 拆分数字和文字方法
-      separateNumbersAndSymbols(input) {
-        let numbers = [];
-        let words = [];
-        // 使用正则表达式分割字符串
-        let parts = input.split(/(\d+)/)
-        // 循环处理分割结果
-        parts.forEach(part => {
-          if (part.match(/\d+/)) { // 匹配数字
-            numbers.push(Number(part));
-          } else if (part) { // 匹配非数字符号
-            words.push(part);
-          }
-        });
-        return { numbers, words };
-      },
+      // change(e){
+      //   console.log(e)
+      //   var index = this.systemValueOptions.findIndex(item => item.value === e)
+      //   console.log(this.separateNumbersAndSymbols(this.systemValueOptions[index].label))
+      // },
+      // // 拆分数字和文字方法
+      // separateNumbersAndSymbols(input) {
+      //   let numbers = [];
+      //   let words = [];
+      //   // 使用正则表达式分割字符串
+      //   let parts = input.split(/(\d+)/)
+      //   // 循环处理分割结果
+      //   parts.forEach(part => {
+      //     if (part.match(/\d+/)) { // 匹配数字
+      //       numbers.push(Number(part));
+      //     } else if (part) { // 匹配非数字符号
+      //       words.push(part);
+      //     }
+      //   });
+      //   return { numbers, words };
+      // },
       // getInterlockTwoTree(){
       //   getAction(this.url.lever12).then(res => {
       //     console.log(res)
@@ -214,8 +338,7 @@
       handleOk () {
         const that = this;
         // 触发表单验证
-        console.log(this.model)
-       this.$refs.form.validate(valid => {
+        this.$refs.form.validate(valid => {
           if (valid) {
             that.confirmLoading = true;
             let httpurl = '';