|
@@ -34,18 +34,31 @@ export default {
|
|
dynamicLocationList(param, res => {
|
|
dynamicLocationList(param, res => {
|
|
this.LocationList = res.Content[0].List;
|
|
this.LocationList = res.Content[0].List;
|
|
//添加未明确对象
|
|
//添加未明确对象
|
|
|
|
+ this.LocationList = this.delNullItems(this.LocationList)
|
|
this.LocationList.map(item => {
|
|
this.LocationList.map(item => {
|
|
- if (item.List && item.List.length) {
|
|
|
|
|
|
+ if (item.List) {
|
|
item.List.map(child => {
|
|
item.List.map(child => {
|
|
- child.List.unshift({ Name: "未明确业务空间" })
|
|
|
|
|
|
+ if (child.List) {
|
|
|
|
+ child.List.unshift({ Name: '未明确业务空间' })
|
|
|
|
+ }
|
|
})
|
|
})
|
|
item.List.unshift({ Name: '未明确楼层' })
|
|
item.List.unshift({ Name: '未明确楼层' })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
this.LocationList.unshift({ Name: '未明确建筑' })
|
|
this.LocationList.unshift({ Name: '未明确建筑' })
|
|
- //结束
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ delNullItems(arr) {
|
|
|
|
+ let tempArr = JSON.parse(JSON.stringify(arr))
|
|
|
|
+ let options = tempArr.map(item => {
|
|
|
|
+ if (item.Name == 'null') return undefined
|
|
|
|
+ if (item.List && item.List.length) {
|
|
|
|
+ item.List = this.delNullItems(item.List)
|
|
|
|
+ }
|
|
|
|
+ return item
|
|
|
|
+ }).filter(d => d)
|
|
|
|
+ return options
|
|
|
|
+ },
|
|
changeCascader(val) {
|
|
changeCascader(val) {
|
|
clearTimeout(this.timer);
|
|
clearTimeout(this.timer);
|
|
this.timer = setTimeout(() => {
|
|
this.timer = setTimeout(() => {
|