|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
* @Author: sueRimn |
|
|
|
|
* @Date: 2021-06-16 13:56:54 |
|
|
|
|
* @LastEditors: sueRimn |
|
|
|
|
* @LastEditTime: 2021-08-05 16:24:21 |
|
|
|
|
* @LastEditTime: 2021-08-07 14:29:01 |
|
|
|
|
*/ |
|
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
|
import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular/core'; |
|
|
|
@ -168,6 +168,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
this.getRealPicture() |
|
|
|
|
} else if (this.selectedItem == '单位概况') { |
|
|
|
|
await this.getAllBuildings() |
|
|
|
|
await this.getAllBuildingsInfo() |
|
|
|
|
console.log(this.buildZong) |
|
|
|
|
this.planTemplateData[1].building.forEach(element => { |
|
|
|
|
element.body[0].attinf[0].olddata = this.unitData.usci |
|
|
|
|
element.body[0].attinf[1].olddata = this.unitData.buildingTypes[0].name |
|
|
|
@ -175,6 +177,18 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
element.body[0].attinf[3].olddata = this.unitData.phone |
|
|
|
|
element.body[0].attinf[4].olddata = this.unitData.organizationName |
|
|
|
|
element.body[0].attinf[5].olddata = this.unitData.address |
|
|
|
|
if(element.body[1].attinf!=undefined){ |
|
|
|
|
element.body[1].attinf.forEach(eBuild => { |
|
|
|
|
this.buildZong.forEach(oldBuild => { |
|
|
|
|
if(oldBuild.buildingBasicGroups.length>0){ |
|
|
|
|
oldBuild.buildingBasicGroups[0].propertyInfos.forEach(infodata => { |
|
|
|
|
eBuild.olddata=infodata.propertyValue |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[0].value=this.planTemplateData[1].attribute[0].attinf[0].olddata = this.unitData.usci |
|
|
|
@ -183,6 +197,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[3].value=this.planTemplateData[1].attribute[0].attinf[3].olddata = this.unitData.phone |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[4].value=this.planTemplateData[1].attribute[0].attinf[4].olddata = this.unitData.organizationName |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[5].value=this.planTemplateData[1].attribute[0].attinf[5].olddata = this.unitData.address |
|
|
|
|
|
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
} /* else if (this.selectedItem == '单位概况') { |
|
|
|
|
//this.getAllBuildings()
|
|
|
|
@ -191,6 +206,63 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取建筑信息
|
|
|
|
|
buildingsData=[] |
|
|
|
|
buildDataName |
|
|
|
|
buildZong |
|
|
|
|
//获得所有建筑信息
|
|
|
|
|
async getAllBuildingsInfo(){ |
|
|
|
|
const result = await new Promise((resolve) =>{ |
|
|
|
|
this.http.get("/api/Buildings",{ |
|
|
|
|
params:{ |
|
|
|
|
companyId:this.unitId |
|
|
|
|
} |
|
|
|
|
}).subscribe(async (data:any)=>{ |
|
|
|
|
this.buildDataName = data |
|
|
|
|
for (let i = 0; i < data.length; i++){ |
|
|
|
|
this.http.get("/api/BuildingBasicInfos",{ // 循环请求当前单位建筑每一个建筑的信息保存到数组中
|
|
|
|
|
params:{ |
|
|
|
|
companyId :this.unitId, |
|
|
|
|
buildingId:data[i].id, |
|
|
|
|
buildingType:data[i].buildingTypes[0].id |
|
|
|
|
} |
|
|
|
|
}).subscribe((buildingsData:any)=>{ |
|
|
|
|
//console.log(buildingsData)
|
|
|
|
|
this.buildingsData.push(buildingsData[0]) |
|
|
|
|
resolve(this.buildingsData) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
console.log(this.buildingsData) |
|
|
|
|
if (this.planTemplateData[1].building == undefined) { |
|
|
|
|
this.planTemplateData[1].building = [] |
|
|
|
|
if(this.planTemplateData[1].attribute[1].attinf!=undefined){ |
|
|
|
|
this.planTemplateData[1].attribute[1].attinf.forEach(pData => { |
|
|
|
|
this.buildingsData.forEach((bDara,bi,bArr)=>{ |
|
|
|
|
if(bDara.buildingBasicGroups.length>0){ |
|
|
|
|
bDara.buildingBasicGroups[0].propertyInfos.forEach(bInfo => { |
|
|
|
|
pData.propertyValue=pData.olddata=bInfo.propertyValue |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (var i = 0; i < this.buildDataName.length; i++) { |
|
|
|
|
if (i == 0) { |
|
|
|
|
this.planTemplateData[1].building.push({ name: this.buildDataName[i].name, body: this.planTemplateData[1].attribute, completed: true }) |
|
|
|
|
} else { |
|
|
|
|
this.planTemplateData[1].building.push({ name: this.buildDataName[i].name, body: this.planTemplateData[1].attribute, completed: false }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
//console.log(result)
|
|
|
|
|
this.buildZong=result |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取当前单位的二维预案
|
|
|
|
|
TwoDPlanList: any |
|
|
|
|
getTwoDPlanList() { |
|
|
|
@ -205,10 +277,6 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取实景图
|
|
|
|
|
allRealPicture |
|
|
|
|
getRealPicture() { |
|
|
|
@ -419,7 +487,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.allBuildings = data |
|
|
|
|
if (this.planTemplateData[1].building == undefined) { |
|
|
|
|
/* if (this.planTemplateData[1].building == undefined) { |
|
|
|
|
this.planTemplateData[1].building = [] |
|
|
|
|
for (var i = 0; i < this.allBuildings.length; i++) { |
|
|
|
|
if (i == 0) { |
|
|
|
@ -429,10 +497,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//console.log(this.planTemplateData)
|
|
|
|
|
//this.buildingName=this.planTemplateData[1].building[0].name
|
|
|
|
|
} */ |
|
|
|
|
this.group = this.planTemplateData[1].building |
|
|
|
|
//delete this.planTemplateData[0].attribute
|
|
|
|
|
|
|
|
|
|