[update] 标签内容字典配置父级名称编辑的时候不能选中自己本身

(cherry picked from commit cf96b68619)
This commit is contained in:
lideqin
2024-08-15 15:55:07 +08:00
committed by fengchenchen
parent bc06b70ee7
commit fdb300568c
@@ -238,8 +238,23 @@ export default {
if (res.success) {
// todo 不知道为啥发生了改变
this.parentDataPid = res.result.records || []
if (this.model.id) {
this.disabledSelf(this.parentDataPid, this.model.id)
}
}
})
},
// 设置父级名称不能选中自己本身
disabledSelf (treeData, value) {
for (const item of treeData) {
if (item.id === value) {
item.disabled = true
break
}
if (item.children) {
this.disabledSelf(item.children, value)
}
}
}
}
}