[update] 标签内容字典配置父级名称编辑的时候不能选中自己本身
(cherry picked from commit cf96b68619)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user