From e553cd922235449368e7d44747bee50e1a7d4b3f Mon Sep 17 00:00:00 2001 From: WUSIJIAN <13825895+wsj0228@user.noreply.gitee.com> Date: Mon, 29 Dec 2025 10:18:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E5=AD=97=E5=85=B8=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=B7=BB=E5=8A=A0=E9=80=89=E9=A1=B9=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E9=80=BB=E8=BE=91,=E9=98=B2=E6=AD=A2=E5=90=8C?= =?UTF-8?q?=E4=B8=80=E5=AD=97=E5=85=B8=E8=A2=AB=E5=A4=9A=E4=B8=AA=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E9=87=8D=E5=A4=8D=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/category/component/editCategory.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/views/assets/category/component/editCategory.vue b/src/views/assets/category/component/editCategory.vue index 2dc877e..e1c5acb 100644 --- a/src/views/assets/category/component/editCategory.vue +++ b/src/views/assets/category/component/editCategory.vue @@ -68,6 +68,7 @@ :key="idx" :label="item.name || ''" :value="item.name || ''" + :disabled="isDictOptionDisabled(item.name || '', attr)" /> @@ -249,6 +250,13 @@ const onDictKeyChange = (attr: CustomAttr) => { attr.options = []; }; +// 判断字典选项是否应被禁用 +const isDictOptionDisabled = (dictName: string, currentAttr: CustomAttr) => { + if (!dictName) return false; + // 检查该字典名称是否已被其他属性使用 + return ruleForm.attrs.some((attr) => attr !== currentAttr && isDictType(attr.type) && attr.name === dictName); +}; + // 添加自定义属性 const addAttr = () => { ruleForm.attrs.push({