From da14a1b45c252ade49bdc915c08fdebdc56d7243 Mon Sep 17 00:00:00 2001 From: weicw1996 Date: Tue, 13 Oct 2026 20:00:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(cms):=20=E5=88=86=E7=B1=BB=E6=A0=91?= =?UTF-8?q?=E9=98=B2=E7=8E=AF=E2=80=94=E2=80=94=E4=B8=8A=E7=BA=A7=E5=80=99?= =?UTF-8?q?=E9=80=89=E5=89=94=E9=99=A4=E8=87=AA=E8=BA=AB=E5=AD=90=E6=A0=91?= =?UTF-8?q?=EF=BC=8C=E5=88=97=E8=A1=A8=E8=B7=B3=E8=BF=87=E8=87=AA=E6=8C=87?= =?UTF-8?q?=E5=90=91=E8=84=8F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 与后端 checkParentValid 配套的前端侧防御(分类是自关联结构,成环会让分类树整个渲染不出来): - category-edit:新增 parentOptions 计算属性,修改分类时把「自己及自己的整棵子树」 从上级候选中剔除,避免在界面上就能选出环。 - index:parseData 先过滤掉 categoryId === parentId 的记录(toTreeData 遇到这类数据 会直接 throw,拖垮整个列表),并把被跳过的分类 id 提示给用户,让其去库里修正。 --- .../cms/category/components/category-edit.vue | 25 ++++++++++++++++--- src/views/cms/category/index.vue | 17 ++++++++++++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/views/cms/category/components/category-edit.vue b/src/views/cms/category/components/category-edit.vue index 06b00a5..1a2444d 100644 --- a/src/views/cms/category/components/category-edit.vue +++ b/src/views/cms/category/components/category-edit.vue @@ -25,7 +25,7 @@ -