Browse Source

[新增]在线编制预案自定义功能

tangshan
陈敬瑜 3 years ago
parent
commit
7a33791569
  1. 2
      src/app/plan-management/create-plan-online-five/addattinf.html
  2. 4
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  3. 23
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

2
src/app/plan-management/create-plan-online-five/addattinf.html

@ -23,7 +23,7 @@
</div>
<div class="center" *ngIf="this.data.facilityItems!=null">
<div class="group" *ngFor="let item of facilityItems" >
<mat-checkbox class="example-margin" color='primary' [(ngModel)]="item.completed" >{{item.name}}</mat-checkbox>
<mat-checkbox class="example-margin" color='primary' [(ngModel)]="item.completed" *ngIf="item.zdy==undefined">{{item.name}}</mat-checkbox>
</div>
</div>
<div class="bottom">

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

@ -717,7 +717,7 @@
height: 40px;
line-height: 40px;">{{itemunit.name}}</span>
<img src="../../../assets/images/update.png" *ngIf="planMode==4&&pattern == 'edit'" (click)='unitZdyaaa()'>
<span style="float: right;margin-right: 30px;cursor: pointer;" (click)='zdyDw()'>自定义</span>
<span style="float: right;margin-right: 30px;cursor: pointer;" *ngIf="planMode==4&&pattern == 'edit'" (click)='zdyDw()'>自定义</span>
</div>
<div class="unitbody" *ngFor="let element of itemunit.body;let elei=index" style=" height: 100%;
width: 100%;
@ -845,7 +845,7 @@
<img src="../../../assets/images/addyello.png"
*ngIf="pattern == 'edit'"
(click)='unitadd(element.surveyName,uniti,attacki,0)'><!-- &&attack.zdy!=undefined -->
<img src="../../../assets/images/updateyello.png" (click)='fileAdd(attack.facilityItems,attacki,attack.name)'>
<img src="../../../assets/images/updateyello.png" (click)='fileAdd(attack.facilityItems,attacki,attack.name)' *ngIf="pattern == 'edit'&&attack.zdy==undefined">
</div>
<div class="fileBody">
<div *ngFor="let info of attack.facilityItems;let filenum=index">

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

@ -588,7 +588,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
getTemplateData() {
this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => {
console.log('预案内容', data)
if(this.route.snapshot.queryParams.haveNew!=undefined&&data.webTextData==null){
if(this.route.snapshot.queryParams.haveNew!=undefined&&this.route.snapshot.queryParams.planMode==4){
this.planTemplateData=[]
let obj = {
completed: true,
@ -1486,7 +1486,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
if(fileNum==0){
this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].facilityItems.push({ name: '', value: '',completed:true,zdy:true})
}else{
this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ propertyName: '', value: '',completed:true,zdy:true,facilityItems:[] })
this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ name: '', value: '',completed:true,zdy:true,facilityItems:[] })
}
}
@ -2199,9 +2199,9 @@ export class adddwsurveys{
constructor(private http: HttpClient,public dialogRef: MatDialogRef<adddwsurveys>,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {}
addAttinfBuild=[]
buildnewDate=[]
addAttinfFile
addAttinfFile//过滤消防设施外层数据
filenewDate=[]
facilityItems
facilityItems//过滤消防设施最内层数据
facilityCategoryId//消防设施内容id
zdyData//模板传过来自定义的数据
ngOnInit(): void{
@ -2372,10 +2372,19 @@ export class adddwsurveys{
}else{
//消防设施最里层数据
let apifile
this.facilityItems=JSON.parse(JSON.stringify(this.data.facilityItems))
this.facilityItems=this.data.facilityItems.filter(element => {
return element.zdy==undefined
});
this.zdyData=this.data.facilityItems.filter(element => {
return element.zdy!=undefined
});
this.facilityItems=JSON.parse(JSON.stringify(this.facilityItems))
console.log(this.facilityItems)
//请求接口,看数据是否有变化
this.http.get("/api/BuildingTypes").subscribe((buildData:any)=>{
let paramsdata:any ={
categoryId:this.data.fid
}
this.http.get("/api/FacilityGroups",{params:paramsdata}).subscribe((buildData:any)=>{
buildData.forEach(async element => {
if(element.id==this.data.fid){
this.facilityCategoryId=element.facilityCategoryId
@ -2424,7 +2433,7 @@ export class adddwsurveys{
}
})
})
this.facilityItems.push(...this.zdyData)
}

Loading…
Cancel
Save