Procházet zdrojové kódy

优化:当点击系统时才出现新增按钮

wyh před 9 měsíci
rodič
revize
6049a061b1

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

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

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

@@ -4,7 +4,7 @@
             <u-equipment-tree @select="selectEquipment"></u-equipment-tree>
         </div>
         <div class="right">
-          <interlock-summary-list ref="realForm" :selectData="selectData"></interlock-summary-list>
+          <interlock-summary-list ref="summaryList" :selectData="selectData"></interlock-summary-list>
         </div>
     </div>
 </template>
@@ -26,7 +26,7 @@ import InterlockSummaryList from './InterlockSummaryList.vue';
                 console.log(99,selectedKeys,e)
                 if (selectedKeys.length == 0) {
                     this.$nextTick(()=>{
-                        this.$refs.realForm.searchReset();
+                        this.$refs.summaryList.searchReset();
                     })
                 } else {
                     let str = selectedKeys[0].length
@@ -34,7 +34,7 @@ import InterlockSummaryList from './InterlockSummaryList.vue';
                     this.selectData.num = str
                     this.selectData.id = e.selectedNodes[0].data.props.id
                     this.$nextTick(()=>{
-                        this.$refs.realForm.getDataList();
+                        this.$refs.summaryList.getDataList();
                     })
                 }
             }