BUG 30099

This commit is contained in:
aixianling
2022-06-09 16:51:17 +08:00
parent 0a49f98892
commit 1fb21fdbd3

View File

@@ -126,7 +126,7 @@
style="margin-bottom: 10px;"
size="small"
placeholder="请输入网格名称/网格员姓名/网格员电话"
v-model="name"
v-model="name" @change="$refs.tree.filter(name)"
suffix-icon="iconfont iconSearch">
</el-input>
<el-tree
@@ -199,12 +199,6 @@ export default {
...mapState(['user'])
},
watch: {
name(val) {
this.$refs.tree.filter(val)
}
},
created() {
this.getDict()
this.getGirdList()
@@ -235,8 +229,8 @@ export default {
getGirdList() {
this.instance.post(`/app/appgirdinfo/listAllByTop`).then(res => {
if (res.code == 0) {
this.tree = this.formatList(res.data)
if (res?.data) {
this.tree = this.formatList([res.data])
}
})
},
@@ -256,7 +250,7 @@ export default {
},
formatList(list) {
var arr = []
let arr = []
for (let item of list) {
if (item.girdMemberList && item.girdMemberList.length) {
let userList = JSON.parse(JSON.stringify(item.girdMemberList)).map(v => {
@@ -273,14 +267,11 @@ export default {
]
delete item.girdMemberList
}
if (item.girdList && item.girdList.length) {
this.formatList(item.girdList)
}
arr.push(item)
}
return arr
},