This commit is contained in:
Cold
2025-12-29 14:12:27 +08:00

View File

@@ -68,6 +68,7 @@
:key="idx"
:label="item.name || ''"
:value="item.name || ''"
:disabled="isDictOptionDisabled(item.name || '', attr)"
/>
</el-select>
</div>
@@ -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({