yuhan il y a 9 mois
Parent
commit
7bc691ffae

+ 6 - 0
src/assets/less/interLock.css

@@ -393,6 +393,12 @@
 .iotmenu-modal-box .ant-modal .ant-modal-footer .ant-btn {
   font-size: 17px;
 }
+.ant-input[disabled] {
+  color: rgba(0, 0, 0, 0.25) !important;
+  background-color: #f5f5f5 !important;
+  cursor: not-allowed;
+  opacity: 1;
+}
 ::-webkit-scrollbar {
   width: 6px !important;
 }

+ 6 - 0
src/assets/less/interLock.less

@@ -426,6 +426,12 @@
     }
   }
 }
+.ant-input[disabled]{
+  color: rgba(0,0,0,.25) !important;
+  background-color: #f5f5f5 !important;
+  cursor: not-allowed;
+  opacity: 1;
+}
 // 滚动条样式
 ::-webkit-scrollbar{
   width: 6px !important;

+ 8 - 1
src/components/menu/index.js

@@ -80,7 +80,14 @@ export default {
         routes.pop()
         this.selectedKeys = [routes[routes.length - 1].path]
       } else {
-        this.selectedKeys = [routes.pop().path]
+        /* IoT TPM相关 修改框架 */
+        // 设置联锁添加页面高亮联锁总表
+        if(this.$route.path == '/interLock/summary/add'){
+          this.selectedKeys = ['/interLock/summary']
+        } else {
+          this.selectedKeys = [routes.pop().path]
+        }
+        // this.selectedKeys = [routes.pop().path]
       }
       let openKeys = []
       if (this.mode === 'inline') {

+ 1 - 2
src/components/module_interLock/UEquipmentTree/UEquipmentTree.vue

@@ -93,14 +93,13 @@
         // 原版本
         getAction(`/base/interlockBase/list`).then(res=>{
           // if (res.success) {
-            console.log('11111',res)
             // 防止res.result对tpmListData造成地址赋值的问题
             this.tpmListData = JSON.parse(JSON.stringify(res))
             // 现版本
             // this.tpmTreeData = this.tpmListData
             // 原版本
             this.tpmTreeData = this.handleTree(res, "id", "pid")
-            console.log(this.tpmTreeData)
+            // console.log(this.tpmTreeData)
           // } else {
 
           // }

+ 1 - 2
src/components/module_interLock/UEquipmentTree/UEquipmentTreeDrag.vue

@@ -122,14 +122,13 @@
         // 原版本
         getAction(`/base/interlockBase/list`).then(res=>{
           // if (res.success) {
-            console.log('11111',res)
             // 防止res.result对tpmListData造成地址赋值的问题
             this.tpmListData = JSON.parse(JSON.stringify(res))
             // 现版本
             // this.tpmTreeData = this.tpmListData
             // 原版本
             this.tpmTreeData = this.handleTree(res, "id", "pid")
-            console.log(this.tpmTreeData)
+            // console.log(this.tpmTreeData)
           // } else {
 
           // }

+ 10 - 1
src/permission.js

@@ -140,7 +140,16 @@ router.beforeEach((to, from, next) => {
               })
             })
         } else {
-          next()
+          // 从添加页面跳转其他页面后需要删除联锁添加页面
+          if(from.path === '/interLock/summary/add' && !from.meta.replace){
+            // 为了解决循环设置了replace
+            from.meta.replace = true
+            next({ ...to, replace: true })
+            from.meta.replace = false
+          } else {
+            next()
+          }
+          // next()
         }
       }
     } else {

+ 2 - 0
src/store/getters.js

@@ -18,6 +18,8 @@ const getters = {
     return state.enhance.enhanceJs[code]
   },
   sysSafeMode: state => state.user.sysSafeMode,
+  summaryEditInfo: state => state.interLock.summaryEditInfo,
+  summaryEditType: state => state.interLock.summaryEditType,
 
 }
 

+ 2 - 0
src/store/index.js

@@ -6,6 +6,7 @@ import user from './modules/user'
 import permission from './modules/permission'
 import enhance from './modules/enhance'
 import online from './modules/online'
+import interLock from './modules/interLock'
 import getters from './getters'
 
 Vue.use(Vuex)
@@ -17,6 +18,7 @@ export default new Vuex.Store({
     permission,
     enhance,
     online,
+    interLock,
   },
   state: {
 

+ 5 - 0
src/views/module_interLock/InterlockSummary/InterlockSummaryList.vue

@@ -402,6 +402,11 @@
       //     }
       //   }
       // },
+      handleEdit(record){
+        this.$store.commit('SET_SUMMARYEDITINFO', record);
+        this.$store.commit('SET_SUMMARYEDITTYPE', '编辑');
+        this.$router.push({path: '/interLock/summary/add'})
+      },
       // 单元格点击事件
       customCellDetail(record, index, columnValue, columnTitle){
         return {

+ 21 - 13
src/views/module_interLock/InterlockSummary/modules/InterlockConditionForm.vue

@@ -18,7 +18,7 @@
           </a-col>
           <a-col :span="24">
             <a-form-model-item label="联锁设定值" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="interlockSetValue">
-              <a-input v-model="model.interlockSetValue" placeholder="请输入描述"></a-input>
+              <a-input v-model="model.interlockSetValue" placeholder="请输入联锁设定值"></a-input>
             </a-form-model-item>
           </a-col>
           <!-- <a-col :span="24">
@@ -97,12 +97,18 @@
             <a-form-model-item label="仪表状态判定依据" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="instrumentStatusJuge">
               <a-radio-group name="radioGroup" v-model="model.instrumentStatusJuge">
                 <!-- @change="instrumentStatusJugeChange" -->
+                <a-radio :value="'3'"> 默认正常 </a-radio>
                 <a-radio :value="'0'"> 位号读取 </a-radio>
                 <a-radio :value="'1'"> 高低限判断 </a-radio>
                 <a-radio :value="'2'"> 突变超限判断 </a-radio>
               </a-radio-group>
             </a-form-model-item>
           </a-col>
+          <template v-if="model.instrumentStatusJuge === '3'">
+            <a-col :span="24">
+              <a-input v-model="model.instrumentStatusDefault" disabled></a-input>
+            </a-col>
+          </template>
           <template v-if="model.instrumentStatusJuge === '0'">
             <a-col :span="24">
               <a-form-model-item label="仪表位号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="instrumentStatusData">
@@ -291,8 +297,8 @@
           outputStatusDefault: null, // 输出卡件状态默认值默认参数
           mpStatusRadio: '0', // MP状态单选默认-默认值
           mpStatusDefault: null, // MP状态默认值默认参数
-          instrumentStatusJuge: '0', // 仪表判定依据-位号读取
-          // instrumentStatus: null, // 仪表状态默认值默认参数
+          instrumentStatusJuge: '3', // 仪表判定依据-默认正常
+          instrumentStatusDefault: null, // 仪表状态默认值默认参数
           instrumentGDXT: '',
           instrumentTBXT: '',
           upperLimitGd: null,
@@ -317,9 +323,9 @@
           interlockConditionData: [{
             required: true, message: '请选择联锁条件!',
           }],
-          instrumentStatusJuge: [{
-            required: true, message: '请选择仪表状态判定依据!',
-          }],
+          // instrumentStatusJuge: [{
+          //   required: true, message: '请选择仪表状态判定依据!',
+          // }],
           instrumentStatusData: [{
             required: true, message: '请选择仪表状态!',
           }],
@@ -353,9 +359,9 @@
             required: true, message: '请输入阈值!',
           }],
 
-          interlockSetValue: [{
-            required: true, message: '请输入联锁设定值!',
-          }],
+          // interlockSetValue: [{
+          //   required: true, message: '请输入联锁设定值!',
+          // }],
           // currentValueData: [{
           //   required: true, message: '请选择当前值!',
           // }],
@@ -408,10 +414,12 @@
       // 设置状态默认值和初始化值
       setDefaultValue(){
         // 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
+        var controlSystemStatusDefault = this.itSystemDefaultValue.controlSystemStatusNormalName +'('+ this.itSystemDefaultValue.controlSystemStatusNormal+')'
+        this.model.inputStatusDefault = controlSystemStatusDefault
+        this.model.outputStatusDefault = controlSystemStatusDefault
+        this.model.mpStatusDefault = controlSystemStatusDefault
+        // 仪表状态
+        this.model.instrumentStatusDefault = this.itSystemDefaultValue.instrumentStatusNormalName +'('+ this.itSystemDefaultValue.instrumentStatusNormal+')'
         this.model.bypassNo = this.itSystemDefaultValue.bypassYesName +'('+ this.itSystemDefaultValue.bypassYes +')'
         // 初始化
         this.model.thresholdValueN = '1'

+ 12 - 6
src/views/module_interLock/InterlockSummary/modules/InterlockSummaryForm.vue

@@ -69,6 +69,9 @@
             style="margin: 0 12px;">
             <!-- 仪表状态依据 -->
             <span slot="instrumentStatusJuge" slot-scope="text, record">
+              <template v-if="record.instrumentStatusJuge === '3'">
+                <span>默认正常</span>
+              </template>
               <template v-if="record.instrumentStatusJuge === '0'">
                 <span>位号读取</span>
               </template>
@@ -81,6 +84,9 @@
             </span>
             <!-- 仪表状态内容 -->
             <span slot="instrumentStatusContent" slot-scope="text, record">
+              <template v-if="record.instrumentStatusJuge === '3'">
+                <span>{{ record.instrumentStatusTag }}</span>
+              </template>
               <template v-if="record.instrumentStatusJuge === '0'">
                 <span>位号:{{ record.instrumentStatusTag }}</span>
               </template>
@@ -209,12 +215,12 @@
             { required: true, message: '请输入联锁名称!', },
             { validator: (rule, value, callback) => validateDuplicateValue('interlock_summary	', 'interlock_name', value, this.model.id, callback)},
           ],
-          ljgx: [{
-            required: true, message: '请输入逻辑关系!',
-          }],
-          interlockOutValueData: [{
-            required: true, message: '请选择联锁输出值!',
-          }],
+          // ljgx: [{
+          //   required: true, message: '请输入逻辑关系!',
+          // }],
+          // interlockOutValueData: [{
+          //   required: true, message: '请选择联锁输出值!',
+          // }],
         },
         url: {
           interLockSelect: '/sys/dict/loadTreeData',

+ 42 - 31
src/views/module_interLock/baseInterLock/modules/BaseInterLockModal.vue

@@ -7,6 +7,7 @@
     switchFullscreen
     @ok="handleOk"
     @cancel="handleCancel"
+    okText="提交"
     cancelText="关闭">
     <a-spin :spinning="confirmLoading">
       <a-form-model ref="form" :model="model" :rules="validatorRules">
@@ -159,7 +160,7 @@
               </a-tooltip>
             </span>
             <div style="display: flex;align-items: center;">
-              <span style="width: 100px;">投用状态:</span>
+              <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>
@@ -169,7 +170,7 @@
               </a-input-group>
             </div>
             <div style="display: flex;align-items: center;">
-              <span style="width: 100px;">摘除状态:</span>
+              <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>
@@ -210,8 +211,8 @@
           
           bypassYes	: '1', // 旁路正常状态
           bypassNo: '0',
-          bypassYesName: '',
-          bypassNoName: '',
+          bypassYesName: '非旁路',
+          bypassNoName: '旁路',
 
           instrumentStatusNormal: '0', // 仪表正常状态
           instrumentStatusAbnormal: '1',
@@ -416,41 +417,51 @@
         this.$refs.form.clearValidate()
       },
       handleOk () {
-        const that = this;
+        var _this = this
         // 触发表单验证
         this.$refs.form.validate(valid => {
           if (valid) {
-            that.confirmLoading = true;
-            let httpurl = '';
-            let method = '';
-            if(!this.model.id){
-              httpurl+=this.url.add;
-              method = 'post';
-            }else{
-              httpurl+=this.url.edit;
-               method = 'put';
-            }
-             if(this.model.id && this.model.id === this.model[this.pidField]){
-              that.$message.warning("父级节点不能选择自己");
-              that.confirmLoading = false;
-              return;
-            }
-            httpAction(httpurl,this.model,method).then((res)=>{
-              if(res.success){
-                that.$message.success(res.message);
-                this.$emit('ok');
-              }else{
-                that.$message.warning(res.message);
-              }
-            }).finally(() => {
-              that.confirmLoading = false;
-              that.close();
-            })
+            _this.$confirm({
+              title: '提示',
+              content: '是否确定提交',
+              onOk() {
+                _this.submit()
+              },
+              onCancel() {},
+            });
           }else{
              return false
           }
         })
       },
+      submit(){
+        this.confirmLoading = true;
+        let httpurl = '';
+        let method = '';
+        if(!this.model.id){
+          httpurl+=this.url.add;
+          method = 'post';
+        }else{
+          httpurl+=this.url.edit;
+            method = 'put';
+        }
+          if(this.model.id && this.model.id === this.model[this.pidField]){
+          this.$message.warning("父级节点不能选择自己");
+          this.confirmLoading = false;
+          return;
+        }
+        httpAction(httpurl,this.model,method).then((res)=>{
+          if(res.success){
+            this.$message.success(res.message);
+            this.$emit('ok');
+          }else{
+            this.$message.warning(res.message);
+          }
+        }).finally(() => {
+          this.confirmLoading = false;
+          this.close();
+        })
+      },
       handleCancel () {
         this.close()
       },

+ 44 - 35
src/views/module_interLock/baseScheduleSet/modules/BaseScheduleSetModal.vue

@@ -211,46 +211,55 @@
         this.visible = false;
       },
       handleOk () {
-        const that = this;
+        var _this = this
         // 触发表单验证
         this.$refs.form.validate((ok, err) => {
           if (ok) {
-            // that.confirmLoading = true;
-            let httpurl = '';
-            let method = '';
-            if(!this.model.id){
-              httpurl+=this.url.add;
-              method = 'post';
-            }else{
-              httpurl+=this.url.edit;
-              method = 'put';
-            }
-
-            console.log('提交参数',this.model)
-            let time = this.model.time
-            if (this.model.parameter == 'day') {
-              this.model.cronExpression = "0 0 " + time[1] +" * * ? *"
-            }
-            if (this.model.parameter == 'month') {
-              this.model.cronExpression = "0 0 " + time[2] + " " + time[1] +" * ? *"
-            }
-            if (this.model.parameter == 'year') {
-              this.model.cronExpression = "0 0 " + time[3] + " " + time[2] + " " + time[1] +" ? *"
-            }
-            console.log('处理后参数',this.model)
-            httpAction(httpurl,this.model,method).then((res)=>{
-              if(res.success){
-                that.$message.success(res.message);
-                that.$emit('ok');
-                that.close();
-              }else{
-                that.$message.warning(res.message);
-              }
-            }).finally(() => {
-              that.confirmLoading = false;
-            })
+            _this.$confirm({
+              title: '提示',
+              content: '是否确定提交',
+              onOk() {
+                _this.submit()
+              },
+              onCancel() {},
+            });
+          }
+        })
+      },
+      submit(){
+        // that.confirmLoading = true;
+        let httpurl = '';
+        let method = '';
+        if(!this.model.id){
+          httpurl+=this.url.add;
+          method = 'post';
+        }else{
+          httpurl+=this.url.edit;
+          method = 'put';
+        }
 
+        console.log('提交参数',this.model)
+        let time = this.model.time
+        if (this.model.parameter == 'day') {
+          this.model.cronExpression = "0 0 " + time[1] +" * * ? *"
+        }
+        if (this.model.parameter == 'month') {
+          this.model.cronExpression = "0 0 " + time[2] + " " + time[1] +" * ? *"
+        }
+        if (this.model.parameter == 'year') {
+          this.model.cronExpression = "0 0 " + time[3] + " " + time[2] + " " + time[1] +" ? *"
+        }
+        console.log('处理后参数',this.model)
+        httpAction(httpurl,this.model,method).then((res)=>{
+          if(res.success){
+            that.$message.success(res.message);
+            that.$emit('ok');
+            that.close();
+          }else{
+            that.$message.warning(res.message);
           }
+        }).finally(() => {
+          that.confirmLoading = false;
         })
       },
       handleCancel () {