diff --git a/angular.json b/angular.json index f8d3f75..a5689c7 100644 --- a/angular.json +++ b/angular.json @@ -63,8 +63,8 @@ "budgets": [ { "type": "initial", - "maximumWarning": "8mb", - "maximumError": "8mb" + "maximumWarning": "18mb", + "maximumError": "18mb" }, { "type": "anyComponentStyle", diff --git a/src/app/key-unit/function-division/function-division.component.ts b/src/app/key-unit/function-division/function-division.component.ts index 0f75c4b..3251d28 100644 --- a/src/app/key-unit/function-division/function-division.component.ts +++ b/src/app/key-unit/function-division/function-division.component.ts @@ -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) + }) + }) + } + + } // 没有 创建 建筑功能分区时 自动创建 diff --git a/src/app/tabbar/tabbar.component.ts b/src/app/tabbar/tabbar.component.ts index 22b415c..ee414e3 100644 --- a/src/app/tabbar/tabbar.component.ts +++ b/src/app/tabbar/tabbar.component.ts @@ -76,11 +76,9 @@ export class TabbarComponent implements OnInit { } //根据usci获取当前单位的分数信息 getIntegrityScore(){ - let params:any = { - USCI : this.route.snapshot.queryParams.usci - } - this.http.get('/api/Companies',{params:params}).subscribe((data:any) => { - this.companyIntegrityScore = data.items[0].companyIntegrityScore + let unitId = sessionStorage.getItem('companyId') + this.http.get(`/api/Companies/${unitId}`).subscribe((data:any) => { + this.companyIntegrityScore = data.companyIntegrityScore }) } isSpinner:boolean = false//下载帮助文档进度