网格选择
-
-
- {{ form.girdName || '请选择网格' }}
-
-
-
+
+ {{ form.girdName || '请选择' }}
+
@@ -72,34 +69,22 @@ export default {
created() {
this.$dict.load('girdType', 'girdLevel')
this.areaId = this.user.areaId
- this.getLeafNodes()
+ // this.getLeafNodes()
+ uni.$on('goback', e => {
+ this.getGridInfo(e.id, true)
+ })
},
onShow() {
document.title = "网格管理"
},
+
methods: {
+ toChoose () {
+ uni.navigateTo({
+ url: './SelectGird?isFormMap=1'
+ })
+ },
getLeafNodes() {
- // this.$http.post('/app/appgirdmemberinfo/checkLogOnUser').then((res) => {
- // if (res.code == 0) {
- // if (res.data.checkType != '0') {
- // this.$http.post(`/app/appgirdinfo/queryGirdMemberGirdsById?id=${res.data.appGirdInfo.id}`).then((res) => {
- // if (res?.data) {
- // this.treeList = res.data.filter(v => v.girdLevel === '2')
-
- // const arr = res.data.filter(v => v.points).map(e => {
- // return {
- // id: e.id,
- // girdName: e.girdName,
- // points: e.points.map(p => [p.lng, p.lat])
- // }
- // })
-
- // arr.length > 0 && this.renderGridMap(arr)
- // }
- // })
- // }
- // }
- // })
this.$http.post(`/app/appgirdinfo/queryGirdMemberGirdsById`).then((res) => {
if (res?.data) {
this.treeList = res.data.filter(v => v.girdLevel === '2')
@@ -117,15 +102,25 @@ export default {
})
},
- getGridInfo (id) {
+ getGridInfo (id, flag) {
this.$loading()
this.$http.post(`/app/appgirdinfo/queryDetailById?id=${id}`).then((res) => {
this.$hideLoading()
if (res?.data) {
this.form = res.data
+ if (res.data.points && flag) {
+ const arr = [{
+ id: res.data.id,
+ girdName: res.data.girdName,
+ points: res.data.points.map(p => [p.lng, p.lat])
+ }]
+
+ this.renderGridMap(arr)
+ }
+
this.$nextTick(() => {
- this.show = true
+ !flag && (this.show = true)
})
}
}).catch(() => {
@@ -255,6 +250,11 @@ ai-tree-picker {
line-height: 44px;
color: #333;
+ .grid-select__right {
+ display: flex;
+ align-items: center;
+ }
+
.label {
display: inline-block;
width: 140px;
diff --git a/src/apps/AppGridManagement/SelectGird.vue b/src/apps/AppGridManagement/SelectGird.vue
index 2841e1d9..f433a5ad 100644
--- a/src/apps/AppGridManagement/SelectGird.vue
+++ b/src/apps/AppGridManagement/SelectGird.vue
@@ -143,6 +143,7 @@ export default {
submit() {
if (this.SelectGird.id != null) {
uni.$emit('goback', this.SelectGird)
+ console.log(this.SelectGird)
uni.navigateBack()
} else {
return this.$u.toast('请选择网格')