From b17befa5f98a65db76cd51e309e72873695f340a Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Tue, 16 Dec 2025 12:20:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BD=91=E5=9D=80=E7=AE=A1=E7=90=86?= =?UTF-8?q?=EF=BC=8C=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ManagePage.vue | 54 +++++++++++----------------------------- 1 file changed, 15 insertions(+), 39 deletions(-) diff --git a/src/views/ManagePage.vue b/src/views/ManagePage.vue index 2dcf587..8bfd517 100644 --- a/src/views/ManagePage.vue +++ b/src/views/ManagePage.vue @@ -166,8 +166,8 @@ -
-
+
+
-
- - -
-
+
@@ -198,27 +194,7 @@
-
-
- - -
-
- - -
-
-
-
- - -
-
- - -
-
-
+
@@ -228,13 +204,6 @@
-
-
- - -
-
-
@@ -387,12 +356,9 @@ export default { // 可用的分组列表(编辑或复制时根据选择的大分类过滤) availableCategories() { - if (this.isCopyMode && this.toolForm.superCategoryId) { + if (this.toolForm.superCategoryId) { return this.categories.filter(c => c.superCategoryId === this.toolForm.superCategoryId) } - if (this.toolForm.id) { - return this.currentCategories - } return [] } }, @@ -823,8 +789,13 @@ export default { // 工具管理 showAddToolDialog(category) { this.currentCategory = category + // 获取当前分组所属的大分类 + const currentCategory = this.categories.find(c => c.id === category.id) + const superCategoryId = currentCategory ? currentCategory.superCategoryId : this.activeSuperCategoryId + this.toolForm = { id: null, + superCategoryId: superCategoryId, categoryId: category.id, name: '', desc: '', @@ -840,8 +811,13 @@ export default { editTool(category, tool) { this.currentCategory = category this.isCopyMode = false + // 获取当前分组所属的大分类 + const currentCategory = this.categories.find(c => c.id === tool.categoryId) + const superCategoryId = currentCategory ? currentCategory.superCategoryId : this.activeSuperCategoryId + this.toolForm = { id: tool.id, + superCategoryId: superCategoryId, categoryId: tool.categoryId, name: tool.name, desc: tool.desc,