From d2ef30e2038af7e2665f704f0579b2b67e4b3040 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Mon, 9 Oct 2023 17:21:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=9A=E7=BB=84=E7=BB=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=87=92=E5=8A=A0=E8=BD=BD=E5=AD=90=E8=8A=82=E7=82=B9=E6=B2=A1?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=8D=E6=98=BE=E7=A4=BA=E4=B8=8B=E6=8B=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communityParty/partyOrg/orgTree.vue | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/src/views/modules/communityParty/partyOrg/orgTree.vue b/src/views/modules/communityParty/partyOrg/orgTree.vue index 0b2b62e59..07420f7b2 100644 --- a/src/views/modules/communityParty/partyOrg/orgTree.vue +++ b/src/views/modules/communityParty/partyOrg/orgTree.vue @@ -41,8 +41,8 @@ :load="handleTreeNodeExpand" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" ref="table" - > - + :row-class-name="rowClassName" + > { + if(item.childrenQty != 0){ + item.hasChildren = true + } + }) this.tableKey = new Date().getTime(); // 默认加载2级,并且展开,从第三级开始,需要展开上一级动态查询得到 console.log(">>>>", this.partyOrgTree) @@ -285,6 +299,11 @@ export default { }) this.epmetResultResolver.success((data) => { + data.forEach(item=>{ + if(item.childrenQty != 0){ + item.hasChildren = true + } + }) row.children = data; // 清空原有子节点 resolve(row.children); // 重新添加子节点 // this.partyOrgTree.push(data); @@ -379,4 +398,7 @@ export default { margin-top: 20px; text-align: center; } +::v-deep .no-expand>:nth-child(1) .cell .el-table__expand-icon{ + display: none; +}