Browse Source

[完善]更改单位分数接口;修改功能分区获得数据顺序bug

tangshan
邵佳豪 3 years ago
parent
commit
6b25328241
  1. 4
      angular.json
  2. 34
      src/app/key-unit/function-division/function-division.component.ts
  3. 8
      src/app/tabbar/tabbar.component.ts

4
angular.json

@ -63,8 +63,8 @@
"budgets": [
{
"type": "initial",
"maximumWarning": "8mb",
"maximumError": "8mb"
"maximumWarning": "18mb",
"maximumError": "18mb"
},
{
"type": "anyComponentStyle",

34
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)
})
})
}
}
// 没有 创建 建筑功能分区时 自动创建

8
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//下载帮助文档进度

Loading…
Cancel
Save