|
|
|
@ -21,6 +21,7 @@ import Viewer from 'viewerjs';
|
|
|
|
|
import { async } from 'rxjs/internal/scheduler/async'; |
|
|
|
|
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; |
|
|
|
|
import { adddwsurvey, addGroup } from '@src/app/ui/plan-template/plan-template.component'; |
|
|
|
|
import { zdyaddattinf } from '../../ui/plan-template/plan-template.component' |
|
|
|
|
declare var $: any |
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-create-plan-online-five', |
|
|
|
@ -1947,14 +1948,34 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log(result) |
|
|
|
|
this.planTemplateData[index].building[this.clicki].body.forEach(element => { |
|
|
|
|
if(element.surveyName=='消防设施'){ |
|
|
|
|
element.attinf[filei].facilityItems=result |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if(result!=undefined){ |
|
|
|
|
this.planTemplateData[index].building[this.clicki].body.forEach(element => { |
|
|
|
|
if(element.surveyName=='消防设施'){ |
|
|
|
|
element.attinf[filei].facilityItems=result |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//单位概况自定义
|
|
|
|
|
zdyDw(){ |
|
|
|
|
let index = this.getArrayIndex(this.planTemplateData,'单位概况') |
|
|
|
|
const dialogRef = this.dialog.open(zdyaddattinf, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
width: '340px', |
|
|
|
|
height:'200px', |
|
|
|
|
disableClose:true, |
|
|
|
|
//data:this.planTemplateData
|
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
if(result!=undefined){ |
|
|
|
|
this.planTemplateData[index].building[this.clicki].body.push({surveyName:result.groupName,completed: true,attinf:[],zdy:true}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2182,6 +2203,7 @@ export class adddwsurveys{
|
|
|
|
|
filenewDate=[] |
|
|
|
|
facilityItems |
|
|
|
|
facilityCategoryId//消防设施内容id
|
|
|
|
|
zdyData//模板传过来自定义的数据
|
|
|
|
|
ngOnInit(): void{ |
|
|
|
|
this.getinf() |
|
|
|
|
console.log(this.data) |
|
|
|
@ -2208,10 +2230,15 @@ export class adddwsurveys{
|
|
|
|
|
}) |
|
|
|
|
}else if(this.data.element.surveyName=='建筑信息'&&this.data.element.attinf!=undefined){ |
|
|
|
|
this.buildnewDate=[] //接受接口返回的新数据
|
|
|
|
|
this.addAttinfBuild=this.data.element.attinf //模板传过来的数据
|
|
|
|
|
this.addAttinfBuild=this.data.element.attinf.filter(item=>{ |
|
|
|
|
return item.zdy==undefined |
|
|
|
|
}) //模板传过来的非自定义数据
|
|
|
|
|
this.zdyData=this.data.element.attinf.filter(item=>{ |
|
|
|
|
return item.zdy!=undefined |
|
|
|
|
})//模板传过来自定义数据
|
|
|
|
|
this.addAttinfBuild=JSON.parse(JSON.stringify(this.addAttinfBuild)) |
|
|
|
|
let paramsdata:any ={ |
|
|
|
|
categoryId:this.data.buildingId |
|
|
|
|
categoryId:this.data.buildingID |
|
|
|
|
} |
|
|
|
|
/* 请求接口,做差异化对比 */ |
|
|
|
|
let restlt=await new Promise((resolve) => { |
|
|
|
@ -2255,6 +2282,7 @@ export class adddwsurveys{
|
|
|
|
|
this.addAttinfBuild.splice(addi,1) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.addAttinfBuild.push(...this.zdyData) |
|
|
|
|
console.log(this.buildnewDate) |
|
|
|
|
console.log(this.addAttinfBuild) |
|
|
|
|
|
|
|
|
@ -2280,16 +2308,22 @@ export class adddwsurveys{
|
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}else if(this.data.surveyName=='消防设施'&&this.data.attinf!=undefined){ |
|
|
|
|
}else if(this.data.element.surveyName=='消防设施'&&this.data.element.attinf!=undefined){ |
|
|
|
|
this.filenewDate=[] |
|
|
|
|
this.addAttinfFile=this.data.attinf |
|
|
|
|
this.addAttinfFile=this.data.element.attinf.filter(element => { |
|
|
|
|
return element.zdy==undefined |
|
|
|
|
}); |
|
|
|
|
this.zdyData=this.data.element.attinf.filter(element => { |
|
|
|
|
return element.zdy!=undefined |
|
|
|
|
}); |
|
|
|
|
this.addAttinfFile=JSON.parse(JSON.stringify(this.addAttinfFile)) |
|
|
|
|
console.log(this.addAttinfFile) |
|
|
|
|
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 |
|
|
|
|
categoryId:this.facilityCategoryId |
|
|
|
|
} |
|
|
|
|
let restlt=await new Promise((resolve) => { |
|
|
|
|
this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((data:any)=>{ |
|
|
|
@ -2324,15 +2358,16 @@ export class adddwsurveys{
|
|
|
|
|
this.addAttinfFile.forEach((addval,addi,addarr)=>{ |
|
|
|
|
temp=0 |
|
|
|
|
this.filenewDate.forEach((buildval,buindi,buildarr)=>{ |
|
|
|
|
if(buildarr[buindi].name==addarr[addi].name){ |
|
|
|
|
if(buildarr[buindi].id==addarr[addi].id){ |
|
|
|
|
temp++ |
|
|
|
|
} |
|
|
|
|
if(temp==0){ |
|
|
|
|
this.addAttinfFile.splice(addi,1) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(temp==0){ |
|
|
|
|
console.log(addarr[addi]) |
|
|
|
|
this.addAttinfFile.splice(addi,1) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
this.addAttinfFile.push(...this.zdyData) |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
//消防设施最里层数据
|
|
|
|
@ -2379,11 +2414,12 @@ export class adddwsurveys{
|
|
|
|
|
if(buildarr[buindi].name==addarr[addi].name){ |
|
|
|
|
temp++ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(temp==0){ |
|
|
|
|
console.log(addarr[addi]) |
|
|
|
|
this.facilityItems.splice(addi,1) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|