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/ProductStructureTree.vue | 62 +++++++++++++++++++++--------- 1 files changed, 43 insertions(+), 19 deletions(-) diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue index c19f1d8..1a8ebdf 100644 --- a/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue +++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureTree.vue @@ -36,6 +36,7 @@ <a-icon slot="product" type="shopping"/> <a-icon slot="component" type="camera"/> <a-icon slot="part" type="hdd"/> + <a-icon slot="processSpecVersion" type="tag"/> <a-icon slot="process" type="apartment"/> <a-icon slot="processStep" type="tool"/> </a-tree> @@ -50,6 +51,8 @@ <ComponentModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> <!--闆朵欢寮圭獥--> <PartModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> + <!--宸ヨ壓瑙勭▼鐗堟湰寮圭獥--> + <ProcessSpecVersionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> <!--宸ュ簭寮圭獥--> <ProcessModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> <!--宸ユ寮圭獥--> @@ -66,6 +69,7 @@ import ProductModal from './Product/ProductModal' import ComponentModal from './Component/ComponentModal' import PartModal from './Part/PartModal' + import ProcessSpecVersionModal from './ProcessSpecVersion/ProcessSpecVersionModal' import ProcessModal from './Process/ProcessModal' import ProcessStepModal from './ProcessStep/ProcessStepModal' import AssignPermissionModal from './Permission/AssignPermissionModal' @@ -76,6 +80,7 @@ AssignPermissionModal, ProcessStepModal, ProcessModal, + ProcessSpecVersionModal, PartModal, ComponentModal, ProductModal, @@ -89,6 +94,7 @@ treeDataSource: [], selectedKeys: [], expandedKeys: [], + beforeSearchExpandedKeys: [], searchValue: '', dataList: [], autoExpandParent: true, @@ -116,7 +122,7 @@ this.treeDataSource = res.list this.generateList(this.treeDataSource) // this.expandedKeys = this.allTreeKeys - if (this.expandedKeys.length === 0) this.expandedKeys = [this.treeDataSource[0].id] + if (this.expandedKeys.length === 0) this.expandedKeys = this.beforeSearchExpandedKeys = [this.treeDataSource[0].id] } else { this.$message.warn(res.message) } @@ -151,34 +157,40 @@ // 鏍戣妭鐐瑰彸閿崟鍑昏彍鍗曚腑鍒犻櫎鎸夐挳鏃惰Е鍙� handleDelete() { - this.$confirm({ + const that = this + const { rightClickSelected: { id, type }, $confirm, url, $notification } = that + $confirm({ title: '鎻愮ず', content: '纭鍒犻櫎姝ゆ潯璁板綍鍚楋紵', okText: '纭', okType: 'danger', cancelText: '鍙栨秷', onOk: () => { - console.log('this.rightClickSelected.id', this.rightClickSelected.id) - if (!this.url.delete) { + if (!url.delete) { this.$message.error('璇疯缃畊rl.delete灞炴��!') return } - const that = this - deleteAction(that.url.delete, { id: this.rightClickSelected.id }) + deleteAction(url.delete + `/${id}/${type}`) .then((res) => { if (res.success) { that.getTreeDataByApi() - that.$notification.success({ + $notification.success({ message: '娑堟伅', description: res.message }) } else { - that.$notification.warning({ + $notification.warning({ message: '娑堟伅', description: res.message }) } }) + .finally(() => { + that.$destroyAll() + }) + }, + onCancel: () => { + that.$destroyAll() } }) }, @@ -197,27 +209,36 @@ * @param expandedKeys 灞曞紑椤筴ey */ handleTreeExpand(expandedKeys) { - this.expandedKeys = expandedKeys + this.expandedKeys = this.beforeSearchExpandedKeys = expandedKeys this.autoExpandParent = false }, /* 杈撳叆鏌ヨ鍐呭鍙樺寲鏃惰Е鍙� */ handleSearchInputChange() { let search = this.searchInput - let expandedKeys = this.dataList - .map(item => { - if (item.title != null) { - if (item.title.indexOf(search) > -1) { - return this.getParentKey(item.key, this.treeDataSource) + let expandedKeys + let autoExpandParent + if (search !== '') { + expandedKeys = this.dataList + .map(item => { + if (item.title != null) { + if (item.title.indexOf(search) > -1) { + return this.getParentKey(item.key, this.treeDataSource) + } + return null } - return null - } - }) - .filter((item, i, self) => item && self.indexOf(item) === i) + }) + .filter((item, i, self) => item && self.indexOf(item) === i) + autoExpandParent = true + } else { + expandedKeys = this.beforeSearchExpandedKeys + autoExpandParent = false + } + Object.assign(this, { expandedKeys, searchValue: search, - autoExpandParent: true + autoExpandParent }) }, @@ -278,6 +299,9 @@ case 3: treeNode.slots = { icon: 'part' } break + case 4: + treeNode.slots = { icon: 'processSpecVersion' } + break case 5: treeNode.slots = { icon: 'process' } break -- Gitblit v1.9.3