ba008752 by lihua

解决编辑目录分类上级选择问题

1 parent 1ef132c0
......@@ -432,7 +432,7 @@ const dictFormItems: any = ref([
label: "dicName",
value: "guid",
children: 'childList',
disabled: 'disabled',
disabled: 'editDisabled',
checkStrictly: true,
emitPath: false
},
......@@ -734,7 +734,21 @@ const toEdit = async (data) => {
if (!row.classGuid) return
currEditTableRow.value = row;
classList.value = tableInfo.value.data || [];
dictFormItems.value[1].options = classList.value
dictFormItems.value[1].options = classList.value;
let transferValue = (list, disabled = false) => {
if (list.guid == row.guid) {
disabled = true;
}
list.editDisabled = disabled;
if (list?.childList?.length) {
list.childList?.forEach(d => {
transferValue(d, disabled);
})
}
}
classList.value?.forEach(cd => {
transferValue(cd, false)
})
// dictApi.getDictTable({
// classGuid: row.classGuid
// }).then((res: any) => {
......@@ -794,6 +808,22 @@ const handleDrawSelectChange = (val, row, info) => {
dictFormItems.value.forEach(d => {
d.default = info[d.field] || '';
})
if (drawerInfo.value.type == 'edit') {
let transferValue = (list, disabled = false) => {
if (list.guid == currEditTableRow.value.guid) {
disabled = true;
}
list.editDisabled = disabled;
if (list?.childList?.length) {
list.childList?.forEach(d => {
transferValue(d, disabled);
})
}
}
classList.value?.forEach(cd => {
transferValue(cd, false)
})
}
} else {
ElMessage({
type: "error",
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!