From bb755b71ecf0ac7f97a9d61e6cb41e77e1833b15 Mon Sep 17 00:00:00 2001 From: zyn Date: Thu, 8 Dec 2022 14:39:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=E5=91=98=E9=80=89?= =?UTF-8?q?=E6=8B=A9tree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/roleTree/index.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/roleTree/index.vue b/src/components/roleTree/index.vue index 5bf1d07fc..a12c91af1 100644 --- a/src/components/roleTree/index.vue +++ b/src/components/roleTree/index.vue @@ -70,7 +70,8 @@ show-checkbox ref="tree" :lazy="false" - :key="treeKey"> + :key="treeKey" + > {{ node.label }} @@ -159,7 +160,13 @@ } }, methods: { - handleClose (tag) { + nameJoinAccount(treeData1){ + treeData1.forEach(item=>{ + if(item.account) item.name = `${item.name}(${item.account})` + if(item.children) this.nameJoinAccount(item.children) + }) + }, + handleClose (tag) { let arr = [] for (let a = 0; a < this.delList.length; a++) { if (tag.id === this.delList[a].id) { @@ -214,6 +221,7 @@ this.treeData1.forEach(item => { this.defaultKey.push(item.id) }) + this.nameJoinAccount(this.treeData1) this.treeLoading = false }) // this.treeKey++ @@ -333,7 +341,8 @@ } this.open1 = true }, - drawerCheck (data) {//当复选框被点击的时候触发 + drawerCheck (data) { + //当复选框被点击的时候触发 //共两个参数,依次为:传递给 data 属性的数组中该节点所对应的对象、树目前的选中状态对象,包含 checkedNodes、checkedKeys、halfCheckedNodes、halfCheckedKeys 四个属性 if (this.checkBox) { // 单选 // 单选判断