From fdb300568cf8890670c5ec98c7d0c4ab35180c0b Mon Sep 17 00:00:00 2001 From: lideqin <694785430@qq.com> Date: Thu, 15 Aug 2024 11:31:01 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E6=A0=87=E7=AD=BE=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E9=85=8D=E7=BD=AE=E7=88=B6=E7=BA=A7=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E7=BC=96=E8=BE=91=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E9=80=89=E4=B8=AD=E8=87=AA=E5=B7=B1=E6=9C=AC=E8=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit cf96b686195e8fc3074481bd167a4e579bb2382b) --- .../tags/modules/TagContentDictItemModal.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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) + } + } } } }