From 04d6189c7848cee67aaf8fd62b90eb9d9313a0d0 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期四, 16 一月 2025 09:29:24 +0800 Subject: [PATCH] 流程配置管理页面 --- src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue | 42 ++++++++++++++++++++++++++++++++++-------- 1 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue index e6bb019..3d1233e 100644 --- a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue +++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue @@ -1,12 +1,14 @@ <template> <a-tabs v-model="activeTabKey" @contextmenu.native="e=>e.preventDefault()" v-if="Object.keys(currentTreeNodeInfo).length!==0"> - <a-tab-pane :key="1" tab="NC鏂囨。" v-if="currentTreeNodeInfo.type!==1"> - <NcDocumentTableList @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> + <a-tab-pane :key="1" tab="NC鏂囨。" v-if="currentTreeNodeInfo.type===5||currentTreeNodeInfo.type===6"> + <NcDocumentTableList ref="ncDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" + @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> </a-tab-pane> - <a-tab-pane :key="2" tab="鍏朵粬鏂囨。"> - <OtherDocumentTableList @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> + <a-tab-pane :key="1" tab="鍏朵粬鏂囨。" v-else> + <OtherDocumentTableList ref="otherDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" + @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> </a-tab-pane> <TableContextMenu :tableRowInfo="currentRightClickedTableRowInfo" ref="tableContextMenuRef"/> @@ -23,7 +25,7 @@ components: { TableContextMenu, OtherDocumentTableList, NcDocumentTableList }, data() { return { - activeTabKey: '1', + activeTabKey: 1, tableContainerSize: 'small', currentRightClickedTableRowInfo: {}, currentTreeNodeInfo: {} @@ -31,6 +33,7 @@ }, created() { this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) + this.$bus.$on('importFileSuccess', this.reloadDocumentListData) }, methods: { /** @@ -48,13 +51,36 @@ /** * 鎺ユ敹鏍戠粍浠朵紶鏉ョ殑褰撳墠閫変腑鐨勬爲鑺傜偣淇℃伅 - * @param treeNodeInfo + * @param treeNodeInfo 鏍戣妭鐐逛俊鎭� */ receiveCurrentTreeNodeInfo(treeNodeInfo) { // 浠庢爲缁勪欢鎺ュ彈鏍戣妭鐐逛俊鎭悗浠庣埗缁勪欢娴佸叆瀛愮粍浠� this.currentTreeNodeInfo = treeNodeInfo - if (treeNodeInfo.type !== 1) this.activeTabKey = 1 - else this.activeTabKey = 2 + // 娓呯┖涓婁竴鑺傜偣宸茬粡鍔犺浇杩囧緱鏂囨。鍒楄〃tabKey + if (treeNodeInfo.type === 5 || treeNodeInfo.type === 6) { + this.$nextTick(() => { + if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) + }) + } else { + this.$nextTick(() => { + if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) + }) + } + }, + + /** + * 涓婁紶鏂囦欢鎴愬姛鍚庤Е鍙� + * @param docClassCode 鏂囨。绫诲埆 + * @param attributionId 鑺傜偣Id + */ + reloadDocumentListData({ docClassCode, attributionId }) { + // 濡傛灉涓婁紶鐨勬枃妗d笉鏄墍灞炰簬褰撳墠鎵�灞曠ず鑺傜偣鐨勬枃妗e垯涓嶉噸鏂拌幏鍙栨枃妗e垪琛� + if (this.currentTreeNodeInfo.id !== attributionId) return + if (docClassCode === 'NC') { + if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) + } else { + if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) + } }, /** -- Gitblit v1.9.3