|
|
@ -155,19 +155,30 @@ export class FunctionDivisionComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
// 没有 创建 建筑功能分区时 自动创建
|
|
|
|
// 没有 创建 建筑功能分区时 自动创建
|
|
|
|
addVoluntarilyPartition () { |
|
|
|
addVoluntarilyPartition () { |
|
|
|
let isFalse = [] |
|
|
|
let isNotHave:boolean = false |
|
|
|
this.noDataList.forEach(item=> { item===false? isFalse.push(1) : null }) |
|
|
|
this.noDataList.forEach(item=> { |
|
|
|
if (isFalse.length === this.allBuilding.length) { //没有 建筑功能分区时
|
|
|
|
if (item === true) { |
|
|
|
let data = { |
|
|
|
isNotHave = true |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
if (!isNotHave) { //所有建筑都没有 功能分区时
|
|
|
|
|
|
|
|
let bodyData = [{ |
|
|
|
buildingId: this.allBuilding[0].id, |
|
|
|
buildingId: this.allBuilding[0].id, |
|
|
|
region: "", |
|
|
|
region: "", |
|
|
|
area: 0, |
|
|
|
area: 0, |
|
|
|
details: "" |
|
|
|
details: "" |
|
|
|
} |
|
|
|
}] |
|
|
|
this.http.post('/api/BuildingFunctionalDivisions',data,{params:{companyId : this.route.snapshot.queryParams.id}}).subscribe(data=>{ |
|
|
|
let params = {buildingId:this.allBuilding[0].id, companyId:this.companyId} |
|
|
|
this.getAllBuilding() |
|
|
|
this.http.post('/api/BuildingFunctionalDivisions/Batch',bodyData,{params:params}).subscribe(datas=>{ |
|
|
|
|
|
|
|
let newParams = {buildingId: this.allBuilding[0].id} |
|
|
|
|
|
|
|
this.http.get(`/api/BuildingFunctionalDivisions`,{params:newParams}).subscribe((data:any)=>{ |
|
|
|
|
|
|
|
this.allBuilding[0].functionalZoning = data |
|
|
|
|
|
|
|
this.selectBuildingFunctionalZoning.push([]) //拥有建筑功能分区的提前push空数组
|
|
|
|
|
|
|
|
this.allBuildingFunctionalZoning.push(this.allBuilding[0]) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} //if
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//封装函数刷新当前建筑功能分区
|
|
|
|
//封装函数刷新当前建筑功能分区
|
|
|
|