BUG 29477

This commit is contained in:
aixianling
2022-05-05 15:54:33 +08:00
parent 04f788f0ad
commit ee0d844494
3 changed files with 25 additions and 15 deletions

View File

@@ -46,6 +46,11 @@ export default {
isFormMap: 0, //1为网格地图 一级不允许选中
}
},
computed: {
isMyGirds() {
return !!this.$route.query.self
}
},
onLoad(option) {
if (option.isFormMap) {
this.isFormMap = option.isFormMap
@@ -67,10 +72,14 @@ export default {
},
getAllGrids() {
this.slectList = []
let {girdMemberId} = this.userGird
this.$http.post(`/app/appgirdinfo/queryAppGirdInfoByGirdLevel`, null, {
params: {girdMemberId}
}).then((res) => {
let {girdMemberId} = this.userGird,
url = `/app/appgirdinfo/queryAppGirdInfoByGirdLevel`,
params = {girdMemberId}
if (this.isMyGirds) {
url = `/app/appgirdmemberinfo/queryMyGirdListByLevel2AndUser`
params = {}
}
this.$http.post(url, null, {params}).then((res) => {
if (res?.data) {
let parents = res.data.map(e => e.parentGirdId)
this.allData = res.data.map(e => ({...e, hasChildren: parents.includes(e.id)}))
@@ -80,7 +89,7 @@ export default {
},
treeInit() {
this.treeList = this.allData.filter(e => !e.parentGirdId)
this.treeList = this.allData.filter(e => !e.parentGirdId || this.isMyGirds)
this.treeList.map((item) => {
item.isChecked = false
})