消除异常

This commit is contained in:
aixianling
2023-02-28 10:12:01 +08:00
parent 8539bd5d75
commit bf784f05ea

View File

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