From bf784f05ea94c64add0f7093a587f43038b05d59 Mon Sep 17 00:00:00 2001 From: aixianling Date: Tue, 28 Feb 2023 10:12:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=99=A4=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/grid/AppGridMap/components/list.vue | 22 ++------------------ 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/packages/grid/AppGridMap/components/list.vue b/packages/grid/AppGridMap/components/list.vue index df6ea79d..c70d9050 100644 --- a/packages/grid/AppGridMap/components/list.vue +++ b/packages/grid/AppGridMap/components/list.vue @@ -103,24 +103,7 @@ export default { getTreeList() { this.instance.post(`/app/appgirdinfo/listAll3`).then((res) => { if (res?.data) { - this.$nextTick(() => { - this.$refs.tree.setCurrentKey(res.data.id) - }) - - this.treeObj.treeList = res.data.filter(e => !e.parentGirdId) - const parentGirdId = this.treeObj.treeList[0].id - - this.treeObj.treeList.map(p => this.addChild(p, res.data.map(v => { - if (v.id === parentGirdId) { - this.treeObj.defaultExpandedKeys.push(v.id) - } - - return { - ...v - } - }), { - parent: 'parentGirdId' - })) + this.treeObj.treeList = this.$arr2tree(res.data,{parent:"parentGirdId"}) this.getLeafNodes() } }); @@ -128,7 +111,7 @@ export default { onMapInit() { this.instance.post("/app/appdvcpconfig/getCorpLocation").then(res => { - if (res.code === 0) { + if (res?.data) { this.map.setCenter(new this.mapLib.LatLng(res.data.lat, res.data.lng)) } }) @@ -144,7 +127,6 @@ export default { points: v.points ? v.points.map(p => [p.lng, p.lat]) : [] } }).filter(v => v.points.length) - this.renderGridMap(arr) } })