Merge branch 'dev' of https://gitee.com/red-future---jilin-g/admin-ui into dev
This commit is contained in:
@@ -68,6 +68,7 @@
|
|||||||
:key="idx"
|
:key="idx"
|
||||||
:label="item.name || ''"
|
:label="item.name || ''"
|
||||||
:value="item.name || ''"
|
:value="item.name || ''"
|
||||||
|
:disabled="isDictOptionDisabled(item.name || '', attr)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
@@ -249,6 +250,13 @@ const onDictKeyChange = (attr: CustomAttr) => {
|
|||||||
attr.options = [];
|
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 = () => {
|
const addAttr = () => {
|
||||||
ruleForm.attrs.push({
|
ruleForm.attrs.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user