消除异常
This commit is contained in:
@@ -103,24 +103,7 @@ export default {
|
|||||||
getTreeList() {
|
getTreeList() {
|
||||||
this.instance.post(`/app/appgirdinfo/listAll3`).then((res) => {
|
this.instance.post(`/app/appgirdinfo/listAll3`).then((res) => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
this.$nextTick(() => {
|
this.treeObj.treeList = this.$arr2tree(res.data,{parent:"parentGirdId"})
|
||||||
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.getLeafNodes()
|
this.getLeafNodes()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -128,7 +111,7 @@ export default {
|
|||||||
|
|
||||||
onMapInit() {
|
onMapInit() {
|
||||||
this.instance.post("/app/appdvcpconfig/getCorpLocation").then(res => {
|
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))
|
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]) : []
|
points: v.points ? v.points.map(p => [p.lng, p.lat]) : []
|
||||||
}
|
}
|
||||||
}).filter(v => v.points.length)
|
}).filter(v => v.points.length)
|
||||||
|
|
||||||
this.renderGridMap(arr)
|
this.renderGridMap(arr)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user