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) { // 单选 // 单选判断