From d88f7da28ee6b3e0db26473faf9dae4b58380c70 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Thu, 13 Jun 2024 16:06:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E7=A7=BB=E9=A3=8E=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=94=B9=E6=88=90=E6=87=92=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../partyBuilding/activitys.vue | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/views/modules/communityParty/partyBuilding/activitys.vue b/src/views/modules/communityParty/partyBuilding/activitys.vue index 4475c8c..a50479f 100644 --- a/src/views/modules/communityParty/partyBuilding/activitys.vue +++ b/src/views/modules/communityParty/partyBuilding/activitys.vue @@ -75,9 +75,10 @@ class="resi-table" v-loading="tableLoading" :data="tableData" - default-expand-all row-key="id" - :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" + lazy + :load="nextTree" + :tree-props="{ children: 'children',hasChildren: 'hasChildren'}" :header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }" :height="tableHeight" > @@ -290,19 +291,40 @@ export default { let params = { limit: this.pageSize, page: this.pageNo, + parentId:0, ...this.formData, }; - const { data, code, msg } = await requestGet(url, params); if (code === 0) { // this.total = data.total; + data.forEach(item=>{ + item.hasChildren =true; + }) this.tableData = data; } else { this.$message.error(msg); } this.tableLoading = false; }, - + async nextTree(tree, treeNode, resolve){ + const url = "/resi/partymember/icpartyplace/getPageList"; + let params = { + limit: this.pageSize, + page: this.pageNo, + parentId:tree.id, + ...this.formData, + }; + const { data, code, msg } = await requestGet(url, params); + if (code === 0) { + data.forEach(item=>{ + item.hasChildren =true; + }) + resolve(data) + } else { + resolve(null) + this.$message.error(msg); + } + }, getTypeLable(type) { if (type) { const lable = this.unitList.filter((item) => item.value == type)[0]