Sfoglia il codice sorgente

默认系统类别+返回问题+部分权限

yuhan 10 mesi fa
parent
commit
0e3083fec1

+ 19 - 1
src/assets/less/interLock.css

@@ -240,13 +240,31 @@
   width: 24px;
   height: 24px;
   margin: 4px 3px;
-  cursor: pointer;
   background: url(../edit.svg);
+  cursor: pointer;
 }
 .iotmenu-content-container .ant-table .edit-btn:hover,
 .iotmenu-modal-box .ant-table .edit-btn:hover {
   background: url(../edit-hover.svg);
 }
+.iotmenu-content-container .ant-table .edit-view-btn,
+.iotmenu-modal-box .ant-table .edit-view-btn {
+  display: inline-block;
+  width: 24px;
+  height: 24px;
+  margin: 4px 3px;
+  background: url(../edit.svg);
+  cursor: not-allowed;
+}
+.iotmenu-content-container .ant-table .delete-view-btn,
+.iotmenu-modal-box .ant-table .delete-view-btn {
+  display: inline-block;
+  width: 24px;
+  height: 24px;
+  margin: 4px 3px;
+  background: url(../delete.svg);
+  cursor: not-allowed;
+}
 .iotmenu-content-container .ant-table .copy-btn,
 .iotmenu-modal-box .ant-table .copy-btn {
   display: inline-block;

+ 17 - 1
src/assets/less/interLock.less

@@ -215,12 +215,28 @@
       width: 24px;
       height: 24px;
       margin: 4px 3px;
-      cursor: pointer;
       background: url(../edit.svg);
+      cursor: pointer;
     }
     .edit-btn:hover{
       background: url(../edit-hover.svg);
     }
+    .edit-view-btn{
+      display: inline-block;
+      width: 24px;
+      height: 24px;
+      margin: 4px 3px;
+      background: url(../edit.svg);
+      cursor: not-allowed;
+    }
+    .delete-view-btn{
+      display: inline-block;
+      width: 24px;
+      height: 24px;
+      margin: 4px 3px;
+      background: url(../delete.svg);
+      cursor: not-allowed;
+    }
     .copy-btn{
       display: inline-block;
       width: 24px;

+ 37 - 11
src/components/module_interLock/UEquipmentTree/UEquipmentTreeDrag.vue

@@ -16,12 +16,13 @@
         <!-- 树列表 -->
         <div class="interlock-tree-content">
           <a-tree
-            :expanded-keys="expandedKeys"
-            auto-expand-parent
+            v-if="tpmTreeData.length > 0"
             :tree-data="tpmTreeData"
+            :replace-fields="replaceFields"
+            autoExpandParent
+            :expandedKeys="expandedKeys"
             :selectedKeys="selectedKeys"
             @expand="onExpand"
-            :replace-fields="replaceFields"
             @select="selectNode"
             blockNode
             >
@@ -94,21 +95,32 @@
     },
     data () {
       return {
-        expandedKeys: [],
         searchValue: '',
-        autoExpandParent: true,
+        // autoExpandParent: true,
         tpmListData: [], // 原始数据
         tpmTreeData: [], // 树形列表使用数据
         replaceFields: {
+          key: 'id',
           children: 'children',
           title: 'interlockName',
         },
-        selectedKeys: [], // 为了设置再次点击不高亮
+        expandedKeys: ['1808684817591234562'],
+        selectedKeys: [], // 设置再次点击不仍然高亮
         url: {
+          // list: '/base/interlockBase/list', // 修改权限前接口
+          list: '/base/interlockBase/listByUser',
           delete: "/base/interlockBase/delete",
         },
       }
     },
+    computed: {
+      treeSelectKeys() {
+        return this.$store.getters.treeSelectKeys
+      },
+      treeExpandedKeys() {
+        return this.$store.getters.treeExpandedKeys
+      },
+    },
     created() {
       this.getTpmTreeData()
     },
@@ -120,7 +132,7 @@
         // 现版本
         // getAction(`/base/interlockBase/lever12`).then(res=>{
         // 原版本
-        getAction(`/base/interlockBase/list`).then(res=>{
+        getAction(this.url.list).then(res=>{
           // if (res.success) {
             // 防止res.result对tpmListData造成地址赋值的问题
             this.tpmListData = JSON.parse(JSON.stringify(res))
@@ -133,6 +145,8 @@
 
           // }
         })
+        this.selectedKeys = this.treeSelectKeys
+        this.expandedKeys = this.treeExpandedKeys
       },
       filterTreeNode(node) {
         // console.log(node)
@@ -140,8 +154,10 @@
         return node.title.indexOf('设备') !== -1;
       },
       onExpand(expandedKeys) {
+        console.log(expandedKeys)
         this.expandedKeys = expandedKeys;
-        this.autoExpandParent = false;
+        // this.autoExpandParent = false;
+        this.$store.commit('SET_TREEEXPANDEKEYS', expandedKeys);
       },
       onChange(e) {
         const value = e.target.value;
@@ -179,16 +195,26 @@
       // 树节点选择操作
       selectNode(selectedKeys, e){
         if (!e.selected){
-          // 再次点击节点时,不取消高亮
+          // 再次点击节点时,仍然高亮
           return
         }
         this.selectedKeys = selectedKeys
-        this.$emit('select', selectedKeys, e)
+        let selectNode = e.selectedNodes[0].data.props
+        var selectData = {
+          id: selectNode.id,
+          pid: selectNode.pid,
+          interlockType: selectNode.interlockType,
+          limitType: selectNode.limitType,
+        }
+        this.$store.commit('SET_CLICKSYSTEMNODE', selectData);
+        this.$store.commit('SET_TREESELECTKEYS', selectedKeys);
+        this.$emit('select')
       },
       // 树重置/刷新操作
       handleRefresh(){
         this.selectedKeys = []
-        this.$emit('select', this.selectedKeys)
+        this.$store.commit('SET_CLICKSYSTEMNODE', {});
+        this.$emit('select')
       },
       // findParents(treeData,id){
       //   let allparents = []

+ 2 - 0
src/store/getters.js

@@ -21,6 +21,8 @@ const getters = {
   summaryEditInfo: state => state.interLock.summaryEditInfo,
   summaryType: state => state.interLock.summaryType,
   clickSystemNode: state => state.interLock.clickSystemNode,
+  treeSelectKeys: state => state.interLock.treeSelectKeys,
+  treeExpandedKeys: state => state.interLock.treeExpandedKeys,
 
 }
 

+ 13 - 1
src/store/modules/interLock.js

@@ -8,7 +8,9 @@ const interLock = {
     //存储数据,用于组件之间的数据传输
     summaryEditInfo: {},
     summaryType: '新增',
-    clickSystemNode: {}, // 新增联锁时左侧选择的树节点
+    clickSystemNode: {}, // 左侧装置系统选择的联锁信息--用于新增联锁
+    treeSelectKeys: [], // 装置系统树选择的树节点--用于回退页面时显示
+    treeExpandedKeys: [], // 装置系统树展开的树节点--用于回退页面时显示
   },
   // (大概)区别:mutations用来修改state数据 同步
   mutations: {
@@ -27,6 +29,16 @@ const interLock = {
       // Vue.set(state, 'baseInfos', fields)
       state.clickSystemNode = infos
     },
+    SET_TREESELECTKEYS: (state, infos) => {
+      // console.log('fields',fields)
+      // Vue.set(state, 'baseInfos', fields)
+      state.treeSelectKeys = infos
+    },
+    SET_TREEEXPANDEKEYS: (state, infos) => {
+      // console.log('fields',fields)
+      // Vue.set(state, 'baseInfos', fields)
+      state.treeExpandedKeys = infos
+    },
   },
   // (大概)区别:actions用来设计复杂逻辑 异步
   actions: {

+ 30 - 26
src/views/module_interLock/InterlockSummary/InterlockSummaryList.vue

@@ -4,8 +4,11 @@
     <div class="table-page-search-wrapper">
       <!-- <a-form layout="inline" @keyup.enter.native="searchQuery"> -->
         <div class="iotmenu-search-container">
-          <div v-if="selectData.interlockType === '1'" class="item-search-btn">
+          <!-- <div v-if="clickSystemNode.interlockType === '1'" class="item-search-btn">
             <a-button v-has="'add:summary'" @click="handleAdd" type="primary" icon="plus">新增</a-button>
+          </div> -->
+          <div v-if="clickSystemNode.interlockType === '1' && clickSystemNode.limitType === '0'" class="item-search-btn">
+            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
           </div>
           <div class="item-search">
             <a-input placeholder="联锁名称" v-model="queryParam.interlockname" allow-clear @change="searchQuery">
@@ -17,20 +20,20 @@
               <a-icon slot="prefix" type="search" />
             </a-input>
           </div>
-          <div v-if="selectData.interlockType === '1'" class="item-search">
+          <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
             <a-select placeholder="仪表状态" v-model="queryParam.instrumentStatus" allowClear :options="instrumentOptions" @change="searchQuery"></a-select>
           </div>
-          <div v-if="selectData.interlockType === '1'" class="item-search">
+          <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
             <a-select placeholder="控制系统状态" v-model="queryParam.controlSystemStatus" allowClear :options="controlSystemOptions" @change="searchQuery"></a-select>
           </div>
-          <div v-if="selectData.interlockType === '1'" class="item-search">
+          <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
             <a-select placeholder="旁路状态" v-model="queryParam.bypass" allowClear :options="bypassOptions" @change="searchQuery"></a-select>
           </div>
-          <div v-if="selectData.interlockType === '1'" class="item-search">
+          <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
             <!-- <j-dict-select-tag v-model="queryParam.interlockStatus" placeholder="联锁状态" dictCode="interlock_status" @change="searchQuery"/> -->
             <a-select placeholder="联锁状态" v-model="queryParam.interlockStatus" allowClear :options="interlockOptions" @change="searchQuery"></a-select>
           </div>
-          <div v-if="selectData.interlockType === '1'" class="item-search">
+          <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
             <a-select placeholder="回路健康级别" v-model="queryParam.loopHealthLevel" allowClear :options="healthLevelOption" @change="searchQuery"></a-select>
           </div>
         </div>
@@ -174,15 +177,6 @@
     components: {
       InterlockSummaryModal
     },
-    props: {
-      /** 其中:interlockType判断点击的是否为系统(0为装置,1为系统,2为未选中) */
-      selectData: {
-        type: Object,
-        default: function(){
-            return {} // 使用工厂函数返回默认值
-        }
-      },
-    },
     data () {
       return {
         description: '联锁总表管理页面',
@@ -309,6 +303,15 @@
             auth: 'testdemo:action',
             // scopedSlots: { customRender: 'action' },
             customRender: (text,record,index)=> {
+              // if(this.clickSystemNode.interlockType === '1' && this.clickSystemNode.limitType === '0'){
+              var limitType = '0'
+              var onlyViewEdit = (
+                <span class="edit-view-btn"></span>
+              )
+              var onlyViewDel = (
+                <span class="delete-view-btn"></span>
+              )
+
               var childrenEdit = (
                 <a-tooltip>
                   <template slot="title">
@@ -333,7 +336,8 @@
                 </a-popconfirm>
               )
               return {
-                children: [childrenEdit,childrenMore],
+                // children: [childrenEdit,childrenMore],
+                children: limitType === '0' ? [childrenEdit,childrenMore] : [onlyViewEdit, onlyViewDel],
                 attrs: {
                   rowSpan: record.rowSpan
                 }
@@ -342,7 +346,8 @@
           }
         ],
         url: {
-          list: "/detail/interlockDetail/list1",
+          list: "detail/interlockDetail/listPageByUser",
+          // list: "/detail/interlockDetail/list1",
           delete: "/summary/interlockSummary/delete",
           deleteBatch: "/summary/interlockSummary/deleteBatch",
           exportXlsUrl: "/summary/interlockSummary/exportXls",
@@ -376,6 +381,10 @@
       importExcelUrl: function(){
         return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
       },
+      clickSystemNode() {
+        /** 其中:interlockType判断点击的是否为系统(0为装置,1为系统,2为未选中) */
+        return this.$store.getters.clickSystemNode
+      },
     },
     methods: {
       // 合并后悬浮行背景色一起显示--后来取消此需求
@@ -430,7 +439,7 @@
       },
       // 获得当前系统设置的默认参数
       getSystemDefaulOptions(){
-        getAction('/base/interlockBase/queryById', {id: this.selectData.id}).then((res) => {
+        getAction('/base/interlockBase/queryById', {id: this.clickSystemNode.id}).then((res) => {
           console.log(res)
           var result = res.result
 
@@ -507,13 +516,13 @@
         var params = this.getQueryParams();//查询条件
         this.loading = true;
         // 左右两边重置分别控制各自的,所以转换数据换到这里
-        if (this.selectData.interlockType == 1) {
+        if (this.clickSystemNode.interlockType == 1) {
           this.getSystemDefaulOptions()
           params.interlockApparatusId = ''
-          params.interlockSystemId = this.selectData.id
+          params.interlockSystemId = this.clickSystemNode.id
         } else {
           params.interlockSystemId = ''
-          params.interlockApparatusId = this.selectData.id
+          params.interlockApparatusId = this.clickSystemNode.id
         }
         getAction(this.url.list, params).then((res) => {
           if (res.success) {
@@ -638,11 +647,6 @@
       },
       // 新增传值
       handleAdd() {
-        // this.$refs.modalForm.add();
-        // this.$refs.modalForm.title = "新增";
-        // this.$refs.modalForm.disableSubmit = false;
-        // this.$refs.modalForm.addInterlock = this.selectData;
-        this.$store.commit('SET_CLICKSYSTEMNODE', this.selectData);
         this.$store.commit('SET_SUMMARYTYPE', '新增');
         this.$router.push({path: '/interLock/summary/set'})
       },

+ 21 - 14
src/views/module_interLock/InterlockSummary/index.vue

@@ -15,7 +15,7 @@
       </div>
       <div class="iotmenu-content">
         <u-equipment-tree-drag treeTitle="装置系统" @select="selectEquipment">
-          <interlock-summary-list ref="summaryList" :selectData="selectData" @click="summaryListClick"></interlock-summary-list>
+          <interlock-summary-list ref="summaryList" @click="summaryListClick"></interlock-summary-list>
         </u-equipment-tree-drag>
       </div>
     </template>
@@ -27,6 +27,7 @@
 <script>
   import InterlockSummaryList from './InterlockSummaryList.vue';
   import InterlockDetailList from '../interlockSummaryDetail/InterlockSummaryDetailList.vue';
+  import store from '@/store'
 
   export default({
     components: {
@@ -36,25 +37,31 @@
     data () {
       return {
         showPage: 'summary',
-        selectData: {},
         currentData: {}
       }
     },
+    beforeRouteEnter(to, from, next) {
+      if(from.path !== '/interLock/summary/set'){
+        store.commit('SET_CLICKSYSTEMNODE', {});
+        store.commit('SET_TREESELECTKEYS', []);
+        store.commit('SET_TREEEXPANDEKEYS', []);
+      }
+      next()
+    },
+    created() {
+    },
     mounted() {
     },
+    // beforeDestroy() {
+    //   if(this.$route.path !== '/interLock/summary/set'){
+    //     // 除了进入新增编辑页面外,销毁vuex数据
+    //     this.$store.commit('SET_CLICKSYSTEMNODE', {});
+    //     this.$store.commit('SET_TREESELECTKEYS', []);
+    //     this.$store.commit('SET_TREEEXPANDEKEYS', []);
+    //   }
+    // },
     methods: {
-      selectEquipment(selectedKeys,e){
-        if (selectedKeys.length <= 0) {
-          // 左侧树重置
-          this.selectData.interlockType = null
-          this.selectData.pid = null
-          this.selectData.id = null
-        } else {
-          let interlockChooseData = e.selectedNodes[0].data.props
-          this.selectData.interlockType = interlockChooseData.interlockType
-          this.selectData.pid = interlockChooseData.pid
-          this.selectData.id = interlockChooseData.id
-        }
+      selectEquipment(){
         this.$refs.summaryList.loadData();
       },
       summaryListClick(data){

+ 40 - 30
src/views/module_interLock/baseInterLock/modules/BaseInterLockModal.vue

@@ -51,11 +51,23 @@
                 v-model="model.pid"
                 show-search
                 placeholder="请选择装置"
+                @change="pidChange"
                 >
+                <!-- labelInValue -->
                 <a-select-option v-for="(item) in interlockTwoTree" :key="item.key" :value="item.key">{{ item.title }}</a-select-option>
               </a-select>
               <!-- :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
+              ref="systemTypeRef"
+              type="radio"
+              v-model="model.systemType"  dictCode="system_type"
+              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-form-model-item>
           <a-divider orientation="left"> <span>状态值设置</span> </a-divider>
           <!-- 控制系统状态 -->
           <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="controlSystemStatus" ref="controlSystemStatus">
@@ -77,7 +89,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.controlSystemStatusAbnormal" style="width: 15%" @change="controlAbnormalChange">
                   <a-select-option value="0"> 0 </a-select-option>
@@ -108,7 +120,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.bypassNo" style="width: 15%" @change="bypassNoChange">
                   <a-select-option value="0"> 0 </a-select-option>
@@ -139,7 +151,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.instrumentStatusAbnormal" style="width: 15%" @change="instrumentAbnormalChange">
                   <a-select-option value="0"> 0 </a-select-option>
@@ -170,7 +182,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>
@@ -190,6 +202,7 @@
 
   import { httpAction, getAction } from '@/api/manage'
   import { validateDuplicateValue } from '@/utils/util'
+  import {initDictOptions, filterDictText} from '@/components/dict/JDictSelectUtil'
   export default {
     name: "InterlockBaseModal",
     components: { 
@@ -203,6 +216,7 @@
         model:{
           // 设置默认值
           interlockType: '0',
+          systemType: '0',
 
           controlSystemStatusNormal: '0', // 控制系统正常状态
           controlSystemStatusAbnormal: '1',
@@ -214,8 +228,8 @@
           bypassYesName: '非旁路',
           bypassNoName: '旁路',
 
-          instrumentStatusNormal: '0', // 仪表正常状态
-          instrumentStatusAbnormal: '1',
+          instrumentStatusNormal: '1', // 仪表正常状态
+          instrumentStatusAbnormal: '0',
           instrumentStatusNormalName: '正常',
           instrumentStatusAbnormalName: '非正常',
 
@@ -305,13 +319,29 @@
         interlockTwoTree: [],
         // 系统点位值列表
         systemValueOptions: [],
+        // 系统类别dict
+        systemTypeDicts: [],
       }
     },
     created () {
+      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);
+          }
+        });
+      },
+      // 父级节点-装置改变时
+      pidChange(e, option){
+        console.log(e, option)
+      },
       // 输入框内容变化时调用对应的检验
       onStatusChange(ref){
         this.$refs[ref].onFieldChange()
@@ -405,6 +435,7 @@
         this.getData('0', 'interlockTwoTree')
         // this.getSystemValue()
         this.model = Object.assign({}, record);
+        // this.model.pid = {key: record.key}
         this.model.controlSystemStatusAbnormal = this.model.controlSystemStatusNormal === '0' ? '1' : '0'
         this.model.bypassNo = this.model.bypassYes === '0' ? '1' : '0'
         this.model.instrumentStatusAbnormal = this.model.instrumentStatusNormal === '0' ? '1' : '0'
@@ -461,6 +492,9 @@
           this.confirmLoading = false;
           return;
         }
+        var index = this.interlockTwoTree.findIndex(item => item.key === this.model.pid)
+        this.model.groupName = this.interlockTwoTree[index].title + '_' + this.model.interlockName
+        // console.log(this.model.groupName)
         httpAction(httpurl,this.model,method).then((res)=>{
           if(res.success){
             this.$message.success(res.message);
@@ -476,30 +510,6 @@
       handleCancel () {
         this.close()
       },
-      submitSuccess(formData,flag){
-        if(!formData.id){
-          let treeData = this.$refs.treeSelect.getCurrTreeData()
-          this.expandedRowKeys=[]
-          this.getExpandKeysByPid(formData[this.pidField],treeData,treeData)
-          this.$emit('ok',formData,this.expandedRowKeys.reverse());
-        }else{
-          this.$emit('ok',formData,flag);
-        }
-      },
-      getExpandKeysByPid(pid,arr,all){
-        if(pid && arr && arr.length>0){
-          for(let i=0;i<arr.length;i++){
-            if(arr[i].key==pid){
-              this.expandedRowKeys.push(arr[i].key)
-              this.getExpandKeysByPid(arr[i]['parentId'],all,all)
-            }else{
-              this.getExpandKeysByPid(pid,arr[i].children,all)
-            }
-          }
-        }
-      }
-      
-      
     }
   }
 </script>

+ 27 - 23
src/views/module_interLock/interlockHistoryData/InterlockHistoryList.vue

@@ -13,19 +13,19 @@
               <a-icon slot="prefix" type="search" />
             </a-input>
           </div>
-          <div v-if="selectData.interlockType === '1'" class="item-search">
+          <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
             <a-select placeholder="仪表状态" v-model="queryParam.instrumentStatus" allowClear :options="instrumentOptions" @change="searchQuery"></a-select>
           </div>
-          <div v-if="selectData.interlockType === '1'" class="item-search">
+          <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
             <a-select placeholder="控制系统状态" v-model="queryParam.controlSystemStatus" allowClear :options="controlSystemOptions" @change="searchQuery"></a-select>
           </div>
-          <div v-if="selectData.interlockType === '1'" class="item-search">
+          <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
             <a-select placeholder="旁路状态" v-model="queryParam.bypass" allowClear :options="bypassOptions" @change="searchQuery"></a-select>
           </div>
-          <div v-if="selectData.interlockType === '1'" class="item-search">
+          <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
             <a-select placeholder="联锁状态" v-model="queryParam.interlockStatus" allowClear :options="interlockOptions" @change="searchQuery"></a-select>
           </div>
-          <div v-if="selectData.interlockType === '1'" class="item-search">
+          <div v-if="clickSystemNode.interlockType === '1'" class="item-search">
             <a-select placeholder="回路健康级别" v-model="queryParam.loopHealthLevel" allowClear :options="healthLevelOption" @change="searchQuery"></a-select>
           </div>
           <div class="item-search">
@@ -52,7 +52,7 @@
 
     <!-- 操作按钮区域 -->
     <!-- <div class="table-operator"> -->
-      <!-- <a-button v-if="selectData.interlockType == '1'" @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
+      <!-- <a-button v-if="clickSystemNode.interlockType == '1'" @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
       <!-- <a-button type="primary" icon="download" v-has="'export:history'" @click="handleExportXls('历史数据')">导出</a-button> -->
       <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
         <a-button type="primary" icon="import">导入</a-button>
@@ -184,13 +184,13 @@
       // InterlockSummaryModal
     },
     props: {
-      selectData: {
-        /** 其中:interlockType判断点击的是否为系统(0为装置,1为系统,2为未选中) */
-        type: Object,
-        default: function(){
-            return {} // 使用工厂函数返回默认值
-        }
-      },
+      // selectData: {
+      //   /** 其中:interlockType判断点击的是否为系统(0为装置,1为系统,2为未选中) */
+      //   type: Object,
+      //   default: function(){
+      //       return {} // 使用工厂函数返回默认值
+      //   }
+      // },
     },
     data () {
       return {
@@ -367,6 +367,10 @@
       importExcelUrl: function(){
         return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
       },
+      clickSystemNode() {
+        /** 其中:interlockType判断点击的是否为系统(0为装置,1为系统,2为未选中) */
+        return this.$store.getters.clickSystemNode
+      },
     },
     methods: {
       // 单元格点击事件
@@ -394,7 +398,7 @@
       },
       // 获得当前系统设置的默认参数
       getSystemDefaulOptions(){
-        getAction('/base/interlockBase/queryById', {id: this.selectData.id}).then((res) => {
+        getAction('/base/interlockBase/queryById', {id: this.clickSystemNode.id}).then((res) => {
           console.log(res)
           var result = res.result
           if(result.bypassYes === '0'){
@@ -456,13 +460,13 @@
         var params = this.getQueryParams();//查询条件
         this.loading = true;
         // 左右两边重置分别控制各自的,所以转换数据换到这里
-        if (this.selectData.interlockType == 1) {
+        if (this.clickSystemNode.interlockType == 1) {
           this.getSystemDefaulOptions()
           params.interlockApparatusId = ''
-          params.interlockSystemId = this.selectData.id
+          params.interlockSystemId = this.clickSystemNode.id
         } else {
           params.interlockSystemId = ''
-          params.interlockApparatusId = this.selectData.id
+          params.interlockApparatusId = this.clickSystemNode.id
         }
         getAction(this.url.list, params).then((res) => {
           if (res.success) {
@@ -630,12 +634,12 @@
         })
       },
       // 新增传值
-      handleAdd() {
-        this.$refs.modalForm.add();
-        this.$refs.modalForm.title = "新增";
-        this.$refs.modalForm.disableSubmit = false;
-        this.$refs.modalForm.addInterlock = this.selectData;
-      },
+      // handleAdd() {
+      //   this.$refs.modalForm.add();
+      //   this.$refs.modalForm.title = "新增";
+      //   this.$refs.modalForm.disableSubmit = false;
+      //   this.$refs.modalForm.addInterlock = this.clickSystemNode;
+      // },
       handleDetail(record){
         console.log(record)
         this.$router.push({path: '/interLock/history/detail',query:{summaryid:record.summaryid}})

+ 23 - 13
src/views/module_interLock/interlockHistoryData/index.vue

@@ -10,7 +10,8 @@
           <!-- <interlock-history-index></interlock-history-index> -->
           <div class="iotmenu-content">
             <u-equipment-tree-drag treeTitle="装置系统" @select="selectEquipment" :hasHandleBtn="false">
-              <interlock-history-list ref="summaryList" :selectData="selectData" @click="historyListClick"></interlock-history-list>
+              <interlock-history-list ref="summaryList" @click="historyListClick"></interlock-history-list>
+              <!-- :selectData="selectData"  -->
             </u-equipment-tree-drag>
           </div>
         </a-tab-pane>
@@ -44,27 +45,36 @@
     data () {
       return {
         showPage: 'history',
-        selectData: {},
+        // selectData: {},
         currentData: {}
       }
     },
     created () {
+      this.$store.commit('SET_CLICKSYSTEMNODE', {});
+      this.$store.commit('SET_TREESELECTKEYS', []);
+      this.$store.commit('SET_TREEEXPANDEKEYS', []);
     },
     mounted () {
     },
+    // beforeDestroy() {
+    //   this.$store.commit('SET_CLICKSYSTEMNODE', {});
+    //   this.$store.commit('SET_TREESELECTKEYS', []);
+    //   this.$store.commit('SET_TREEEXPANDEKEYS', []);
+    //   console.log('s2222222', this.$store.getters.treeExpandedKeys)
+    // },
     methods: {
       selectEquipment(selectedKeys,e){
-        if (selectedKeys.length <= 0) {
-          // 左侧树重置
-          this.selectData.interlockType = null
-          this.selectData.pid = null
-          this.selectData.id = null
-        } else {
-          let interlockChooseData = e.selectedNodes[0].data.props
-          this.selectData.interlockType = interlockChooseData.interlockType
-          this.selectData.pid = interlockChooseData.pid
-          this.selectData.id = interlockChooseData.id
-        }
+        // if (selectedKeys.length <= 0) {
+        //   // 左侧树重置
+        //   this.selectData.interlockType = null
+        //   this.selectData.pid = null
+        //   this.selectData.id = null
+        // } else {
+        //   let interlockChooseData = e.selectedNodes[0].data.props
+        //   this.selectData.interlockType = interlockChooseData.interlockType
+        //   this.selectData.pid = interlockChooseData.pid
+        //   this.selectData.id = interlockChooseData.id
+        // }
         this.$refs.summaryList.loadData();
       },
       historyListClick(data){

+ 45 - 13
src/views/module_interLock/interlockSummarySet/InterlockConditionForm.vue

@@ -135,22 +135,27 @@
             </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-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-group>
+                  <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="请输入高限"></a-input>
+                <a-input v-model="model.upperLimitGd" placeholder="请输入高限" :disabled="model.systemTypeGd !== '2'"></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="请输入低限"></a-input>
+                <a-input v-model="model.lowerLimitGd" placeholder="请输入低限" :disabled="model.systemTypeGd !== '2'"></a-input>
               </a-form-model-item>
             </a-col>
           </template>
@@ -168,10 +173,15 @@
             </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-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-group>
+                  <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">
@@ -180,16 +190,16 @@
                   <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="请输入高限"></a-input>
+                    <a-input v-model="model.upperLimitTb" placeholder="请输入高限" :disabled="model.systemTypeTb !== '2'"></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="请输入低限"></a-input>
+                    <a-input v-model="model.lowerLimitTb" placeholder="请输入低限" :disabled="model.systemTypeTb !== '2'"></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="请输入阈值"></a-input>
+                    <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-form-model-item>
                   <div style="width: 30px;text-align: center;"> % </div>
@@ -462,26 +472,40 @@
       // },
       // 高低限判断系统参考改变
       instrumentGDXTChange(e){
-        if(e.target.value === 'Tricon'){
+        // e.target.value === 'Tricon'
+        // console.log(e)
+        if(e === '0'){
           this.model.upperLimitGd = '4258'
           this.model.lowerLimitGd = '737'
         }
-        if(e.target.value === 'TSxPlus'){
+        if(e === '1'){
           this.model.upperLimitGd = '61948'
           this.model.lowerLimitGd = '10722'
         }
+        if(e === '2'){
+          this.model.upperLimitGd = ''
+          this.model.lowerLimitGd = ''
+        }
       },
       instrumentTBXTChange(e){
-        if(e.target.value === 'Tricon'){
+        if(e === '0'){
           this.model.upperLimitTb = '4095'
           this.model.lowerLimitTb = '819'
         }
-        if(e.target.value === 'TSxPlus'){
+        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.setDefaultValue()
       },
@@ -503,10 +527,18 @@
           // 高低限赋值--依据转换后还保持刚刚的选择
           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)