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