From 0e9500211e1a10a94dbca72e754cc5cf7eb16e3d Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期六, 08 二月 2025 13:53:12 +0800 Subject: [PATCH] 产品结构树: 1、调整权限配置分配部门树组件逻辑 --- src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue | 227 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 225 insertions(+), 2 deletions(-) diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue index 3d1233e..d53279f 100644 --- a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue +++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue @@ -16,6 +16,7 @@ </template> <script> + import dncApi from '@/api/dnc' import NcDocumentTableList from './Document/NcDocumentTableList' import OtherDocumentTableList from './Document/OtherDocumentTableList' import TableContextMenu from '../../../common/TableContextMenu' @@ -33,7 +34,8 @@ }, created() { this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) - this.$bus.$on('importFileSuccess', this.reloadDocumentListData) + this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData) + this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) }, methods: { /** @@ -42,6 +44,7 @@ */ handleTableContextMenuOpen(record) { this.currentRightClickedTableRowInfo = Object.assign({}, record) + console.log('currentRightClickedTableRowInfo', this.currentRightClickedTableRowInfo) this.$refs.tableContextMenuRef.currentMenuLevel = record.param this.$refs.tableContextMenuRef.menuStyle.top = event.clientY + 'px' this.$refs.tableContextMenuRef.menuStyle.left = event.clientX + 'px' @@ -69,7 +72,7 @@ }, /** - * 涓婁紶鏂囦欢鎴愬姛鍚庤Е鍙� + * 鏂囨。浠ュ強NC绋嬪簭瀵煎叆/鍑哄簱/鍏ュ簱鎴愬姛鍚庤Е鍙戦噸鏂板姞杞芥枃妗e垪琛� * @param docClassCode 鏂囨。绫诲埆 * @param attributionId 鑺傜偣Id */ @@ -84,11 +87,231 @@ }, /** + * 鐐瑰嚮涓嬭浇鏃惰Е鍙戜笅杞藉綋鍓嶆枃妗� + */ + handleDownload() { + const that = this + const { docId, docName } = this.currentRightClickedTableRowInfo + dncApi.downloadDocumentApi({ docId, docName }) + .then(res => { + if (res && !res.success) { + that.$notification.error({ + message: '娑堟伅', + description: res.message + }) + } + }) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message + }) + }) + }, + + /** + * 鐐瑰嚮鍑哄簱鏃惰Е鍙戝綋鍓嶆枃妗e嚭搴� + * @param menuLabel + */ + handlePull(menuLabel) { + const that = this + const { docId, docName, param, attributionId } = this.currentRightClickedTableRowInfo + this.$confirm({ + title: '鎻愮ず', + content: `纭${menuLabel}鍚楋紵`, + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + dncApi.documentOutboundApi({ docId, docName }) + .then(res => { + console.log('res------------------', res) + if (res.success) { + this.reloadDocumentListData({ docClassCode: param, attributionId }) + that.$notification.success({ + message: '娑堟伅', + description: `${menuLabel}鎴愬姛` + }) + } else { + that.$notification.error({ + message: '娑堟伅', + description: res.message + }) + } + }) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message + }) + }) + } + }) + }, + + /** + * 鐐瑰嚮鍙栨秷鍑哄簱鏃惰Е鍙戝綋鍓嶆枃妗e彇娑堝嚭搴� + * @param menuLabel + */ + handleCancelPull(menuLabel) { + const that = this + const { docId, param, attributionId } = this.currentRightClickedTableRowInfo + this.$confirm({ + title: '鎻愮ず', + content: `纭${menuLabel}鍚楋紵`, + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + dncApi.documentCancelOutboundApi(docId) + .then(res => { + if (res.success) { + this.reloadDocumentListData({ docClassCode: param, attributionId }) + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + } else { + that.$notification.error({ + message: '娑堟伅', + description: res.message + }) + } + }) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message + }) + }) + } + }) + }, + + + /** + * 鐐瑰嚮鍙戝竷鏃惰Е鍙戝綋鍓嶆枃妗e彂甯� + * @param menuLabel + */ + handlePublish(menuLabel) { + const that = this + const { docId, param, attributionId } = this.currentRightClickedTableRowInfo + this.$confirm({ + title: '鎻愮ず', + content: `纭${menuLabel}鍚楋紵`, + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + dncApi.documentPublishApi(docId) + .then(res => { + if (res.success) { + this.reloadDocumentListData({ docClassCode: param, attributionId }) + this.$bus.$emit('reloadMainBottomTableData', 'documentVersion') + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + } else { + that.$notification.error({ + message: '娑堟伅', + description: res.message + }) + } + }) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message + }) + }) + } + }) + }, + + /** + * 鐐瑰嚮閲嶆柊鍙戝竷鏃惰Е鍙戝綋鍓嶆枃妗i噸鏂板彂甯冮��鍥炰笂涓�鐗堟湰 + * @param menuLabel + */ + handleRepublish(menuLabel) { + const that = this + const { docId, param, attributionId } = this.currentRightClickedTableRowInfo + this.$confirm({ + title: '鎻愮ず', + content: `纭${menuLabel}鍚楋紵`, + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + dncApi.documentRepublishApi(docId) + .then(res => { + if (res.success) { + this.reloadDocumentListData({ docClassCode: param, attributionId }) + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + } else { + that.$notification.error({ + message: '娑堟伅', + description: res.message + }) + } + }) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message + }) + }) + } + }) + }, + + /** + * 鐐瑰嚮褰掓。鏃惰Е鍙戝綋鍓嶆枃妗e綊妗d笖鍚庣画鏃犳硶缁х画鍙戝竷鎴栧綊妗� + * @param menuLabel + */ + handlePigeonhole(menuLabel) { + const that = this + const { docId, param, attributionId } = this.currentRightClickedTableRowInfo + this.$confirm({ + title: '鎻愮ず', + content: `${menuLabel}鍚庝笉鍙彇娑堬紝纭${menuLabel}鍚楋紵`, + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + dncApi.documentPigeonholeApi(docId) + .then(res => { + if (res.success) { + this.reloadDocumentListData({ docClassCode: param, attributionId }) + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + } else { + that.$notification.error({ + message: '娑堟伅', + description: res.message + }) + } + }) + .catch(err => { + that.$notification.error({ + message: '娑堟伅', + description: err.message + }) + }) + } + }) + }, + + /** * 鎺у埗鍙抽敭鑿滃崟鐐瑰嚮鍏抽棴 */ handleMenuClose() { this.$refs.tableContextMenuRef.menuVisible = false document.body.removeEventListener('click', this.handleMenuClose) + }, + + triggerCorrespondingMethod({ methodName, modalTitle }) { + if (this[methodName]) this[methodName](modalTitle) } } } -- Gitblit v1.9.3