From 4768227216a14ec612c2121e496796e63584e56c Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Fri, 17 Feb 2023 14:47:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=95=E5=BC=80=E5=A4=9A=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/base/community/community.vue | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/views/modules/base/community/community.vue b/src/views/modules/base/community/community.vue index 571533aa2..f4c1f3b44 100644 --- a/src/views/modules/base/community/community.vue +++ b/src/views/modules/base/community/community.vue @@ -470,6 +470,7 @@ export default { this.getHouseList(); }, async lazyLoadTree(node, resolve) { + console.log(node); const url = `/actual/base/communityBuilding/tree/nextTreeNode?id=${node.data.id}&level=${node.data.level}`; const { data, code, msg } = await requestGet(url); if (code === 0) { @@ -536,24 +537,23 @@ export default { }, //回车搜索组织 async handleChangeSerch (){ - this.startLoading() - this.$refs.ref_tree.$data.store.lazy = !this.filterText + this.startLoading() + this.$refs.ref_tree.$data.store.lazy = !this.filterText if(this.filterText.length > 0 && this.filterText!=''){ const url = `/actual/base/communityBuilding/tree/search?keyword=${this.filterText}` const {data,code,msg} = await requestGet(url) if(data[0].children.length>0){ this.treeData = data - this.autoOpenArr.push(this.treeData[0].id); + for(let i in this.treeData[0].children){ + this.autoOpenArr.push(this.treeData[0].id,this.treeData[0].children[i].id,this.treeData[0].children[0].children[0].id); + } }else{ this.treeData = [] - setTimeout(() => { - this.loadTree() - }, 5) - this.$message.error('暂未找到!') } }else { this.treeData = [] + this.autoOpenArr = [] this.loadTree() } this.endLoading() @@ -665,9 +665,6 @@ export default { const url = "/actual/base/communityBuilding/tree/initTree" const { data, code, msg } = await requestGet(url) if (code === 0) { - this.openNodes = [] - this.openNodes.push(data.id) - this.treeData = [] this.treeData.push(data) if (!isRefresh && data) { @@ -736,7 +733,6 @@ export default { this.updateStartDate = '' this.updateEndDate = '' this.showRoomTable = false - this.selObj = JSON.parse(JSON.stringify(obj)) this.getTreeObj(obj) await nextTick(1000)