From 8ef827c62d8c7817ad9f9a21b9b4e5bf63a01202 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期五, 07 三月 2025 17:42:19 +0800 Subject: [PATCH] 添加刀具信息 --- src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue | 50 +++++++++++++++++++++++++++++++++++++------------- 1 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue index b0fecf4..4dcd066 100644 --- a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue +++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue @@ -1,21 +1,23 @@ <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===5||currentTreeNodeInfo.type===6"> - <NcDocumentTableList ref="ncDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" - @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> - </a-tab-pane> + <div v-if="currentTreeNodeInfo.type!==4"> + <a-tabs v-model="activeTabKey" @contextmenu.native="e=>e.preventDefault()" @change="handleTabChange" + v-if="Object.keys(currentTreeNodeInfo).length!==0"> + <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="1" tab="鍏朵粬鏂囨。" v-else> - <OtherDocumentTableList ref="otherDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" - @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> - </a-tab-pane> + <a-tab-pane :key="2" tab="鍏朵粬鏂囨。"> + <OtherDocumentTableList ref="otherDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" + @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> + </a-tab-pane> + </a-tabs> <TableContextMenu :tableRowInfo="currentRightClickedTableRowInfo" ref="tableContextMenuRef"/> <DocumentBatchDeleteModal :currentDocumentInfo="currentRightClickedTableRowInfo" :size="tableContainerSize" @reloadDocumentListData="reloadDocumentListData" ref="documentBatchDeleteModalRef"/> - </a-tabs> + </div> </template> <script> @@ -30,10 +32,11 @@ components: { DocumentBatchDeleteModal, TableContextMenu, OtherDocumentTableList, NcDocumentTableList }, data() { return { - activeTabKey: 1, + activeTabKey: 2, tableContainerSize: 'small', currentRightClickedTableRowInfo: {}, - currentTreeNodeInfo: {} + currentTreeNodeInfo: {}, + hasLoadedDataTabKeyArray: [] } }, created() { @@ -64,17 +67,34 @@ // 浠庢爲缁勪欢鎺ュ彈鏍戣妭鐐逛俊鎭悗浠庣埗缁勪欢娴佸叆瀛愮粍浠� this.currentTreeNodeInfo = treeNodeInfo // 娓呯┖涓婁竴鑺傜偣宸茬粡鍔犺浇杩囧緱鏂囨。鍒楄〃tabKey + this.hasLoadedDataTabKeyArray = [] if (treeNodeInfo.type === 5 || treeNodeInfo.type === 6) { + this.activeTabKey = 1 this.$nextTick(() => { if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) }) } else { + this.activeTabKey = 2 this.$nextTick(() => { if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) }) } + this.hasLoadedDataTabKeyArray.push(this.activeTabKey) }, + /** + * tab鏍忓垏鎹㈡椂瑙﹀彂 + * @param activeTabKey 鍒囨崲鍚庣殑tabKey + */ + handleTabChange(activeTabKey) { + if (!this.hasLoadedDataTabKeyArray.includes(activeTabKey)) { + this.$nextTick(() => { + if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) + }) + // 闃绘鎺ュ彛鍦ㄥ悓涓�鏂囨。涓�娆$偣鍑诲唴澶氭瑙﹀彂 + this.hasLoadedDataTabKeyArray.push(activeTabKey) + } + }, /** * 鏂囨。浠ュ強NC绋嬪簭瀵煎叆/鍑哄簱/鍏ュ簱鎴愬姛鍚庤Е鍙戦噸鏂板姞杞芥枃妗e垪琛� * @param docClassCode 鏂囨。绫诲埆 @@ -146,6 +166,10 @@ }) }, + /** + * 鐐瑰嚮鎵归噺鍒犻櫎鍚庡嚭鐜板脊绐� + * @param modalTitle 寮圭獥鏍囬 + */ handleBatchRemove(modalTitle) { if (!this.$refs.documentBatchDeleteModalRef) return this.$refs.documentBatchDeleteModalRef.title = modalTitle -- Gitblit v1.9.3