Selaa lähdekoodia

优化:当点击系统时才出现新增按钮(改为类型判断)

wyh 9 kuukautta sitten
vanhempi
commit
90f9fee9ff

+ 6 - 6
src/views/module_interLock/InterlockSummary/InterlockSummaryList.vue

@@ -40,7 +40,7 @@
 
     <!-- 操作按钮区域 -->
     <div class="table-operator">
-      <a-button v-if="num == '5'" @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button v-if="interlockType == '1'" @click="handleAdd" type="primary" icon="plus">新增</a-button>
       <!-- <a-button type="primary" icon="download" @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>
@@ -287,8 +287,8 @@
         dictOptions:{},
         superFieldList:[],
         mouseSummaryid: '',
-        // 判断点击的是否为系统(0为没选中,3为装置,5为系统
-        num: '3',
+        // 判断点击的是否为系统(0为装置,1为系统,2为未选中
+        interlockType: '',
       }
     },
     created() {
@@ -327,8 +327,8 @@
       // 处理父组件传过来的数据
       getDataList(){
         console.log(111,this.selectData)
-        this.num = this.selectData.num
-        if (this.selectData.num == 5) {
+        this.interlockType = this.selectData.interlockType
+        if (this.selectData.interlockType == 1) {
           this.queryParam.interlockApparatusId = ''
           this.queryParam.interlockSystemId = this.selectData.id
         } else {
@@ -338,7 +338,7 @@
         this.loadData()
       },
       searchReset() {
-        this.num = 0
+        this.interlockType = 2
         this.queryParam = {}
         this.loadData(1);
       },

+ 5 - 3
src/views/module_interLock/InterlockSummary/index.vue

@@ -29,9 +29,11 @@ import InterlockSummaryList from './InterlockSummaryList.vue';
                         this.$refs.summaryList.searchReset();
                     })
                 } else {
-                    let str = selectedKeys[0].length
-                    // console.log(88,str)
-                    this.selectData.num = str
+                    let interlockType = e.selectedNodes[0].data.props.interlockType
+                    let pid = e.selectedNodes[0].data.props.pid
+                    // console.log(88,interlockType)
+                    this.selectData.interlockType = interlockType
+                    this.selectData.pid = pid
                     this.selectData.id = e.selectedNodes[0].data.props.id
                     this.$nextTick(()=>{
                         this.$refs.summaryList.getDataList();