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 | 51 ++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue index 9a6a8e1..3d1233e 100644 --- a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue +++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue @@ -1,37 +1,39 @@ <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 :currentTableRowInfo="currentTableRowInfo" ref="tableContextMenuRef"/> + <TableContextMenu :tableRowInfo="currentRightClickedTableRowInfo" ref="tableContextMenuRef"/> </a-tabs> </template> <script> - import ProcessTableList from './Process/ProcessTableList' import NcDocumentTableList from './Document/NcDocumentTableList' import OtherDocumentTableList from './Document/OtherDocumentTableList' import TableContextMenu from '../../../common/TableContextMenu' export default { name: 'ProductStructureMainTop', - components: { TableContextMenu, OtherDocumentTableList, NcDocumentTableList, ProcessTableList }, + components: { TableContextMenu, OtherDocumentTableList, NcDocumentTableList }, data() { return { - activeTabKey: '1', + activeTabKey: 1, tableContainerSize: 'small', - currentTableRowInfo: {}, + currentRightClickedTableRowInfo: {}, currentTreeNodeInfo: {} } }, created() { this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) + this.$bus.$on('importFileSuccess', this.reloadDocumentListData) }, methods: { /** @@ -39,7 +41,7 @@ * @param record 褰撳墠琛ㄦ牸琛屼俊鎭� */ handleTableContextMenuOpen(record) { - this.currentTableRowInfo = Object.assign({}, record) + this.currentRightClickedTableRowInfo = Object.assign({}, record) this.$refs.tableContextMenuRef.currentMenuLevel = record.param this.$refs.tableContextMenuRef.menuStyle.top = event.clientY + 'px' this.$refs.tableContextMenuRef.menuStyle.left = event.clientX + 'px' @@ -49,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