This commit is contained in:
yanran200730
2023-02-28 10:38:44 +08:00
2 changed files with 79 additions and 103 deletions

View File

@@ -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)
}
})