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,