|
|
|
@ -133,24 +133,30 @@ export class FunctionDivisionComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
noDataList = [] //没有 创建功能分区 的建筑
|
|
|
|
|
//获得所有建筑的功能分区
|
|
|
|
|
getAllBuildingFunctionalZoning () { |
|
|
|
|
async getAllBuildingFunctionalZoning () { |
|
|
|
|
this.selectBuildingFunctionalZoning = [] |
|
|
|
|
this.allBuildingFunctionalZoning = [] |
|
|
|
|
this.noDataList = [] |
|
|
|
|
this.allBuilding.forEach((element,index) => { |
|
|
|
|
for (let index = 0; index < this.allBuilding.length; index++) { |
|
|
|
|
const element = this.allBuilding[index]; |
|
|
|
|
let data={buildingId: element.id} |
|
|
|
|
this.http.get(`/api/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{ |
|
|
|
|
if (data.length) { |
|
|
|
|
element.functionalZoning = data |
|
|
|
|
this.selectBuildingFunctionalZoning.push([]) //拥有建筑功能分区的提前push空数组
|
|
|
|
|
this.allBuildingFunctionalZoning.push(element) |
|
|
|
|
this.noDataList.push(true) |
|
|
|
|
} else { |
|
|
|
|
this.noDataList.push(false) |
|
|
|
|
} |
|
|
|
|
if (this.noDataList.length === this.allBuilding.length) { this.addVoluntarilyPartition() } |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
await new Promise((resolve,reject)=>{ |
|
|
|
|
this.http.get(`/api/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{ |
|
|
|
|
if (data.length) { |
|
|
|
|
element.functionalZoning = data |
|
|
|
|
this.selectBuildingFunctionalZoning.push([]) //拥有建筑功能分区的提前push空数组
|
|
|
|
|
this.allBuildingFunctionalZoning.push(element) |
|
|
|
|
this.noDataList.push(true) |
|
|
|
|
} else { |
|
|
|
|
this.noDataList.push(false) |
|
|
|
|
} |
|
|
|
|
if (this.noDataList.length === this.allBuilding.length) { this.addVoluntarilyPartition() } |
|
|
|
|
resolve(data) |
|
|
|
|
}) |
|
|
|
|
})
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 没有 创建 建筑功能分区时 自动创建
|
|
|
|
|