bug
This commit is contained in:
@@ -56,7 +56,6 @@ export default {
|
|||||||
params: {
|
params: {
|
||||||
current: this.current,
|
current: this.current,
|
||||||
size: 10,
|
size: 10,
|
||||||
areaId: this.user.areaId,
|
|
||||||
communityName: this.title
|
communityName: this.title
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ export default {
|
|||||||
showSelect: false,
|
showSelect: false,
|
||||||
editor: null,
|
editor: null,
|
||||||
polygons: [],
|
polygons: [],
|
||||||
labels: []
|
labels: [],
|
||||||
|
latLngCenter: [], //中心点
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {...mapState(['user', 'config'])},
|
computed: {...mapState(['user', 'config'])},
|
||||||
@@ -78,6 +79,7 @@ export default {
|
|||||||
// }, 400)
|
// }, 400)
|
||||||
// return false
|
// return false
|
||||||
}
|
}
|
||||||
|
this.form.girdName = e.girdName
|
||||||
this.getGridList(e.id, true)
|
this.getGridList(e.id, true)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -114,14 +116,23 @@ export default {
|
|||||||
this.$http.post(`/app/appgirdinfo/queryChildGirdInfoByGirdId?girdId=${id}`).then((res) => {
|
this.$http.post(`/app/appgirdinfo/queryChildGirdInfoByGirdId?girdId=${id}`).then((res) => {
|
||||||
this.$hideLoading()
|
this.$hideLoading()
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
const arr = res.data.map(v => {
|
const arr = []
|
||||||
return {
|
res.data.map(v => {
|
||||||
|
if(v.points) {
|
||||||
|
arr.push(
|
||||||
|
{
|
||||||
id: v.id,
|
id: v.id,
|
||||||
girdName: v.girdName,
|
girdName: v.girdName,
|
||||||
points: v.points ? v.points.map(p => [p.lng, p.lat]) : []
|
points: v.points ? v.points.map(p => [p.lng, p.lat]) : []
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
if(this.latLngCenter.length) {
|
||||||
|
return
|
||||||
|
}else {
|
||||||
|
this.latLngCenter.push(v.points[0].lat, v.points[0].lng)
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.renderGridMap(arr)
|
this.renderGridMap(arr)
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@@ -159,6 +170,10 @@ export default {
|
|||||||
console.log(paths)
|
console.log(paths)
|
||||||
let {map, lib: TMap, $refs: {AiTMap: {fitBounds}}} = this
|
let {map, lib: TMap, $refs: {AiTMap: {fitBounds}}} = this
|
||||||
if (TMap) {
|
if (TMap) {
|
||||||
|
if(this.latLngCenter.length) {
|
||||||
|
map.setCenter(this.latLngCenter)
|
||||||
|
this.map.setZoom(14)
|
||||||
|
}
|
||||||
const colors = ["#A194F4", "#7CBDF3", "#F3A57D", "#62D063", "#58DBDA", "#F7D151"]
|
const colors = ["#A194F4", "#7CBDF3", "#F3A57D", "#62D063", "#58DBDA", "#F7D151"]
|
||||||
if (this.polygons.length > 0) {
|
if (this.polygons.length > 0) {
|
||||||
this.polygons.forEach(e => e.destroy())
|
this.polygons.forEach(e => e.destroy())
|
||||||
|
|||||||
Reference in New Issue
Block a user