This commit is contained in:
yanran200730
2022-01-18 18:26:43 +08:00
parent 97bc7155bb
commit f4b0823b8f

View File

@@ -72,7 +72,13 @@ export default {
this.areaId = this.user.areaId
// this.getLeafNodes()
uni.$on('goback', e => {
this.getGridInfo(e.id, true)
if (e.girdLevel == '0') {
setTimeout(() => {
this.$u.toast('请选择二级或者三级网格')
}, 400)
return false
}
this.getGridList(e.id, true)
})
},
onShow() {
@@ -103,6 +109,26 @@ export default {
})
},
getGridList (id) {
this.$loading()
this.$http.post(`/app/appgirdinfo/queryChildGirdInfoByGirdId?girdId=${id}`).then((res) => {
this.$hideLoading()
if (res?.data) {
const arr = res.data.map(v => {
return {
id: v.id,
girdName: v.girdName,
points: v.points ? v.points.map(p => [p.lng, p.lat]) : []
}
})
this.renderGridMap(arr)
}
}).catch(() => {
this.$hideLoading()
})
},
getGridInfo (id, flag) {
this.$loading()
this.$http.post(`/app/appgirdinfo/queryDetailById?id=${id}`).then((res) => {