diff --git a/src/views/system/tags/modules/TagContentDictItemModal.vue b/src/views/system/tags/modules/TagContentDictItemModal.vue index fe4c7e1..18a4784 100644 --- a/src/views/system/tags/modules/TagContentDictItemModal.vue +++ b/src/views/system/tags/modules/TagContentDictItemModal.vue @@ -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) + } + } } } }