diff --git a/src/apps/AppGridManagement/Map.vue b/src/apps/AppGridManagement/Map.vue index a9e940f7..07159a31 100644 --- a/src/apps/AppGridManagement/Map.vue +++ b/src/apps/AppGridManagement/Map.vue @@ -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) => {