Browse Source

[修改]在线编制预案建筑信息丢失问题

tangshan
chenjingyu 3 years ago
parent
commit
9049382a9e
  1. 1
      src/app/key-unit/key-unit-management/key-unit-management.component.ts
  2. 1
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  3. 85
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  4. 25
      src/app/ui/plan-template/plan-template.component.ts
  5. 5
      src/app/ui/plan-template/upPlan.html

1
src/app/key-unit/key-unit-management/key-unit-management.component.ts

@ -617,6 +617,7 @@ export class KeyUnitManagementComponent implements OnInit {
this.http.post(`/api/ContentVerifies/Batch`,this.deleteAudia).subscribe(data=>{
this.snackBar.open('操作成功','确定',config);
this.getAllKeyUnit()
this.deleteAll=[]
},err=>{
this.snackBar.open(err,'确定',config);
})

1
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html

@ -923,7 +923,6 @@
<!-- <textarea style="height: 100%;width: 100%;" [(ngModel)]="parts.body[0].name" disabled></textarea> -->
</th>
<td style="border: 1px solid #999;
font-size: 16px;
text-align: center;">
{{parts.body[0].value}}

85
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

@ -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

25
src/app/ui/plan-template/plan-template.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-05-31 10:40:01
* @LastEditors: sueRimn
* @LastEditTime: 2021-08-04 15:30:24
* @LastEditTime: 2021-08-07 15:21:06
*/
import { Component, Inject, OnInit,ViewEncapsulation } from '@angular/core';
@ -139,7 +139,7 @@ export class PlanTemplateComponent implements OnInit {
width: '340px',
height:'340px',
disableClose:true,
data:{item:item,plandata:this.newleftTabledata}
data:{item:item,plandata:this.newleftTabledata,operation}
});
dialogRef.afterClosed().subscribe(async result => {
console.log(result)
@ -867,16 +867,23 @@ getattinf(){
})
}else if(value.surveyName=='建筑信息'&&value.attinf!=undefined){
this.addAttinfBuild=value.attinf
/* console.log(this.addAttinfBuild)
value.attinf.forEach((datavalue,index,dataarr) => {
this.addAttinfBuild.forEach((value,i,arr)=>{
if(dataarr[index].propertyName==arr[i].propertyName){
if(dataarr[index].completed==true&&arr[i].completed==false){
arr[i].completed= dataarr[index].completed
let paramsdata:any ={
categoryId:this.data.newleftTabledata[this.data.leftclicki].basicCategoryId
}
this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{
this.addAttinfBuild=data[0].propertyInfos
this.addAttinfBuild.forEach((element,ei,earr) => {
value.attinf.forEach((elattinf,fi,farr) => {
if(earr[ei].propertyName==farr[fi].propertyName){
earr[ei].completed=farr[fi].completed
}
});
element.olddata=element.propertyValue
});
console.log(this.addAttinfBuild)
})
}); */
}else if(value.surveyName=='消防设施'&&value.attinf==undefined){
let paramsdata:any ={
categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId

5
src/app/ui/plan-template/upPlan.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2021-05-21 10:43:28
* @LastEditors: sueRimn
* @LastEditTime: 2021-06-15 10:47:09
* @LastEditTime: 2021-08-07 15:04:56
-->
<!--
* @Descripttion:
@ -16,7 +16,8 @@
-->
<div class="box">
<div class="top">
<span style="font-size: 20px;">修改预案模板</span>
<span style="font-size: 20px;" *ngIf="data.operation=='edit'">修改预案模板</span>
<span style="font-size: 20px;" *ngIf="data.operation=='copy'">复制预案模板</span>
</div>
<!-- <div class="queryField">
<label style="margin-right: 10px;">预案名称:</label>

Loading…
Cancel
Save