|
|
|
@ -59,10 +59,12 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
blockyl = true |
|
|
|
|
zaixianDr=false |
|
|
|
|
haveNew=false |
|
|
|
|
planMode//预案类型
|
|
|
|
|
//index
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
//this.index = this.getArrayIndex(this.planTemplateData,'单位概况')
|
|
|
|
|
this.haveNew=this.route.snapshot.queryParams.haveNew |
|
|
|
|
this.planMode=this.route.snapshot.queryParams.planMode |
|
|
|
|
console.log(this.route.snapshot.queryParams.wordChange) |
|
|
|
|
this.planLevel = this.route.snapshot.queryParams.planCategory |
|
|
|
|
if (this.route.snapshot.queryParams.pattern == 'false') { |
|
|
|
@ -1920,10 +1922,9 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
width: '290px', |
|
|
|
|
height:'460px', |
|
|
|
|
disableClose:true, |
|
|
|
|
data:{element:element,buildingID:this.buildingsData[0].basicCategoryId} |
|
|
|
|
data:{element:element,buildingID:this.buildingsData[0].basicCategoryId,fid:this.route.snapshot.queryParams.unitTypeId} |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log(result) |
|
|
|
|
if(result!=undefined){ |
|
|
|
|
this.planTemplateData[index].building[this.clicki].body.forEach(item => { |
|
|
|
|
if(item.surveyName==element.surveyName){ |
|
|
|
@ -1934,6 +1935,26 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//消防设施具体属性编辑
|
|
|
|
|
fileAdd(facilityItems,filei,filename){ |
|
|
|
|
let index = this.getArrayIndex(this.planTemplateData,'单位概况') |
|
|
|
|
if(facilityItems.length!=0){ |
|
|
|
|
const dialogRef = this.dialog.open(adddwsurveys, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
width: '240px', |
|
|
|
|
height:'400px', |
|
|
|
|
disableClose:true, |
|
|
|
|
data:{facilityItems:facilityItems,filename,fid:this.route.snapshot.queryParams.unitTypeId} |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log(result) |
|
|
|
|
this.planTemplateData[index].building[this.clicki].body.forEach(element => { |
|
|
|
|
if(element.surveyName=='消防设施'){ |
|
|
|
|
element.attinf[filei].facilityItems=result |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2160,6 +2181,7 @@ export class adddwsurveys{
|
|
|
|
|
addAttinfFile |
|
|
|
|
filenewDate=[] |
|
|
|
|
facilityItems |
|
|
|
|
facilityCategoryId//消防设施内容id
|
|
|
|
|
ngOnInit(): void{ |
|
|
|
|
this.getinf() |
|
|
|
|
console.log(this.data) |
|
|
|
@ -2167,7 +2189,8 @@ export class adddwsurveys{
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async getinf(){ |
|
|
|
|
if(this.data.element.surveyName=='建筑信息'&&this.data.element.attinf==undefined){ |
|
|
|
|
if(this.data.facilityItems==undefined){ |
|
|
|
|
if(this.data.element.surveyName=='建筑信息'&&this.data.element.attinf==undefined){ |
|
|
|
|
this.addAttinfBuild=[] |
|
|
|
|
let paramsdata:any ={ |
|
|
|
|
categoryId:this.data.buildingID |
|
|
|
@ -2235,38 +2258,55 @@ export class adddwsurveys{
|
|
|
|
|
console.log(this.buildnewDate) |
|
|
|
|
console.log(this.addAttinfBuild) |
|
|
|
|
|
|
|
|
|
}else if(this.data.surveyName=='消防设施'&&this.data.attinf==undefined){ |
|
|
|
|
let paramsdata:any ={ |
|
|
|
|
categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId |
|
|
|
|
} |
|
|
|
|
this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{ |
|
|
|
|
console.log(data) |
|
|
|
|
this.addAttinfFile=data |
|
|
|
|
this.addAttinfFile.forEach(element => { |
|
|
|
|
element.completed=false |
|
|
|
|
element.value='' |
|
|
|
|
}else if(this.data.element.surveyName=='消防设施'&&this.data.element.attinf==undefined){ |
|
|
|
|
this.http.get("/api/BuildingTypes").subscribe((buildData:any)=>{ |
|
|
|
|
console.log(buildData) |
|
|
|
|
buildData.forEach(element => { |
|
|
|
|
if(element.id==this.data.fid){ |
|
|
|
|
this.facilityCategoryId=element.facilityCategoryId |
|
|
|
|
let paramsdata:any ={ |
|
|
|
|
categoryId:this.facilityCategoryId |
|
|
|
|
} |
|
|
|
|
this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{ |
|
|
|
|
console.log(data) |
|
|
|
|
this.addAttinfFile=data |
|
|
|
|
this.addAttinfFile.forEach(element => { |
|
|
|
|
element.completed=false |
|
|
|
|
element.value='' |
|
|
|
|
}); |
|
|
|
|
console.log(this.addAttinfFile) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
console.log(this.addAttinfFile) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}else if(this.data.surveyName=='消防设施'&&this.data.attinf!=undefined){ |
|
|
|
|
this.filenewDate=[] |
|
|
|
|
this.addAttinfFile=this.data.attinf |
|
|
|
|
this.addAttinfFile=JSON.parse(JSON.stringify(this.addAttinfFile)) |
|
|
|
|
let paramsdata:any ={ |
|
|
|
|
categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId |
|
|
|
|
} |
|
|
|
|
let restlt=await new Promise((resolve) => { |
|
|
|
|
this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{ |
|
|
|
|
data.forEach((buildDate,buildi,buildarr) => { |
|
|
|
|
this.filenewDate.push(buildDate) |
|
|
|
|
resolve(data) |
|
|
|
|
}); |
|
|
|
|
this.filenewDate.forEach(element => { |
|
|
|
|
element.completed=false |
|
|
|
|
//element.olddata=element.propertyValue
|
|
|
|
|
}); |
|
|
|
|
this.http.get("/api/BuildingTypes").subscribe((buildData:any)=>{ |
|
|
|
|
buildData.forEach(async element => { |
|
|
|
|
if(element.id==this.data.fid){ |
|
|
|
|
this.facilityCategoryId=element.facilityCategoryId |
|
|
|
|
let paramsdata:any ={ |
|
|
|
|
categoryId:this.data.newleftTabledata[this.data.leftclicki].facilityCategoryId |
|
|
|
|
} |
|
|
|
|
let restlt=await new Promise((resolve) => { |
|
|
|
|
this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{ |
|
|
|
|
data.forEach((buildDate,buildi,buildarr) => { |
|
|
|
|
this.filenewDate.push(buildDate) |
|
|
|
|
resolve(data) |
|
|
|
|
}); |
|
|
|
|
this.filenewDate.forEach(element => { |
|
|
|
|
element.completed=false |
|
|
|
|
//element.olddata=element.propertyValue
|
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
})
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
})
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.filenewDate=JSON.parse(JSON.stringify(this.filenewDate)) |
|
|
|
|
let temp=0 |
|
|
|
|
this.filenewDate.forEach((buildval,buindi,buildarr)=>{ |
|
|
|
@ -2294,6 +2334,63 @@ export class adddwsurveys{
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
//消防设施最里层数据
|
|
|
|
|
let apifile |
|
|
|
|
this.facilityItems=JSON.parse(JSON.stringify(this.data.facilityItems))
|
|
|
|
|
console.log(this.facilityItems) |
|
|
|
|
//请求接口,看数据是否有变化
|
|
|
|
|
this.http.get("/api/BuildingTypes").subscribe((buildData:any)=>{ |
|
|
|
|
buildData.forEach(async element => { |
|
|
|
|
if(element.id==this.data.fid){ |
|
|
|
|
this.facilityCategoryId=element.facilityCategoryId |
|
|
|
|
let paramsdata:any ={ |
|
|
|
|
categoryId:this.facilityCategoryId |
|
|
|
|
} |
|
|
|
|
let fileResult=await new Promise((resolve) => { |
|
|
|
|
this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{ |
|
|
|
|
resolve(data) |
|
|
|
|
}) |
|
|
|
|
})
|
|
|
|
|
apifile=fileResult |
|
|
|
|
let apifileData//消防设施最内层数据
|
|
|
|
|
apifile.forEach(element => { |
|
|
|
|
if(element.name==this.data.filename){ |
|
|
|
|
apifileData=element.facilityItems |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
console.log(apifileData) |
|
|
|
|
let temp=0 |
|
|
|
|
apifileData.forEach((buildval,buindi,buildarr)=>{ |
|
|
|
|
temp=0 |
|
|
|
|
this.facilityItems.forEach((addval,addi,addarr)=>{ |
|
|
|
|
if(buildval.name==addval.name){ |
|
|
|
|
temp++ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(temp==0){ |
|
|
|
|
console.log(buildval) |
|
|
|
|
this.facilityItems.push(buildval) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.facilityItems.forEach((addval,addi,addarr)=>{ |
|
|
|
|
temp=0 |
|
|
|
|
apifileData.forEach((buildval,buindi,buildarr)=>{ |
|
|
|
|
if(buildarr[buindi].name==addarr[addi].name){ |
|
|
|
|
temp++ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(temp==0){ |
|
|
|
|
console.log(addarr[addi]) |
|
|
|
|
this.facilityItems.splice(addi,1) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//取消按钮
|
|
|
|
@ -2302,7 +2399,8 @@ close(){
|
|
|
|
|
} |
|
|
|
|
//确定按钮
|
|
|
|
|
defineClick(){ |
|
|
|
|
this.dialogRef.close(this.data.element.surveyName=='建筑信息'?this.addAttinfBuild:this.data.element.surveyName=='消防设施'?this.addAttinfFile:this.facilityItems) |
|
|
|
|
this.dialogRef.close(this.data.element!=undefined&&this.data.element.surveyName=='建筑信息'? |
|
|
|
|
this.addAttinfBuild:this.data.element!=undefined&&this.data.element.surveyName=='消防设施'?this.addAttinfFile:this.facilityItems) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|