|
|
|
@ -20,6 +20,7 @@ import { TreeService } from '../../http-interceptors/tree.service'
|
|
|
|
|
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'; |
|
|
|
|
declare var $: any |
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-create-plan-online-five', |
|
|
|
@ -57,7 +58,9 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
planLevel: string//预案级别
|
|
|
|
|
blockyl = true |
|
|
|
|
zaixianDr=false |
|
|
|
|
haveNew=false |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.haveNew=this.route.snapshot.queryParams.haveNew |
|
|
|
|
console.log(this.route.snapshot.queryParams.wordChange) |
|
|
|
|
this.planLevel = this.route.snapshot.queryParams.planCategory |
|
|
|
|
if (this.route.snapshot.queryParams.pattern == 'false') { |
|
|
|
@ -357,13 +360,29 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
let index = this.getArrayIndex(this.planTemplateData,'单位概况') |
|
|
|
|
this.planTemplateData[index].building.forEach(element => { |
|
|
|
|
if(element.body[0].completed){ |
|
|
|
|
element.body[0].attinf[0].value = element.body[0].attinf[0].olddata = this.unitData.usci |
|
|
|
|
element.body[0].attinf.forEach((arrval,atti,attarr) => { |
|
|
|
|
if(arrval.propertyName=='统一社会信用代码'){ |
|
|
|
|
arrval.value=arrval.olddata=this.unitData.usci |
|
|
|
|
}else if(arrval.propertyName=='单位类型'){ |
|
|
|
|
arrval.value=arrval.olddata=this.unitData.buildingTypes[0].name |
|
|
|
|
}else if(arrval.propertyName=='联系人'){ |
|
|
|
|
arrval.value=arrval.olddata=this.unitData.contacts |
|
|
|
|
}else if(arrval.propertyName=='联系电话'){ |
|
|
|
|
arrval.value=arrval.olddata=this.unitData.phone |
|
|
|
|
}else if(arrval.propertyName=='辖区中队'){ |
|
|
|
|
arrval.value=arrval.olddata=this.unitData.organizationName |
|
|
|
|
}else if(arrval.propertyName=='单位地址'){ |
|
|
|
|
arrval.value=arrval.olddata=this.unitData.address |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
/* element.body[0].attinf[0].value = element.body[0].attinf[0].olddata = this.unitData.usci |
|
|
|
|
element.body[0].attinf[1].value = element.body[0].attinf[1].olddata = this.unitData.buildingTypes[0].name |
|
|
|
|
element.body[0].attinf[2].value = element.body[0].attinf[2].olddata = this.unitData.contacts |
|
|
|
|
element.body[0].attinf[3].value = element.body[0].attinf[3].olddata = this.unitData.phone |
|
|
|
|
element.body[0].attinf[4].value = element.body[0].attinf[4].olddata = this.unitData.organizationName |
|
|
|
|
element.body[0].attinf[5].value = element.body[0].attinf[5].olddata = this.unitData.address |
|
|
|
|
if (element.body[1].attinf != undefined) { |
|
|
|
|
element.body[0].attinf[5].value = element.body[0].attinf[5].olddata = this.unitData.address */ |
|
|
|
|
|
|
|
|
|
if (element.body.length>1&&element.body[1].attinf != undefined) { |
|
|
|
|
element.body[1].attinf.forEach(eBuild => { |
|
|
|
|
this.buildZong.forEach(oldBuild => { |
|
|
|
|
if (oldBuild.buildingBasicGroups.length > 0) { |
|
|
|
@ -378,8 +397,6 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
} else if (this.selectedItem == '预案附件') { |
|
|
|
|
this.getTwoDPlanList() |
|
|
|
@ -567,127 +584,125 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
groupName: "单位概况" |
|
|
|
|
} |
|
|
|
|
getTemplateData() { |
|
|
|
|
|
|
|
|
|
if(this.route.snapshot.queryParams.haveNew!=undefined){ |
|
|
|
|
this.planTemplateData=[] |
|
|
|
|
let obj = { |
|
|
|
|
completed: true, |
|
|
|
|
groupName: "封面", |
|
|
|
|
attribute: { |
|
|
|
|
planNumber: '', |
|
|
|
|
planName: this.route.snapshot.queryParams.planName, |
|
|
|
|
objName: this.unitData.name, |
|
|
|
|
unitNature: this.unitData.buildingTypes[0].name, |
|
|
|
|
planLevel: '', |
|
|
|
|
disasterType: '火灾', |
|
|
|
|
fireproofingLevel: '', |
|
|
|
|
fireproofingAdminister: this.unitData.organizationName, |
|
|
|
|
putOutFireAdminister: '', |
|
|
|
|
producer: { |
|
|
|
|
name: '', |
|
|
|
|
duty: '' |
|
|
|
|
}, |
|
|
|
|
verifier: { |
|
|
|
|
name: '', |
|
|
|
|
duty: '' |
|
|
|
|
}, |
|
|
|
|
auditTime: '' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.planTemplateData.unshift(obj) |
|
|
|
|
|
|
|
|
|
this.planTemplateData.push(this.danweInfo) |
|
|
|
|
this.planTemplateData.push({completed: true,groupName: '新建'}) |
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
}else{ |
|
|
|
|
this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => { |
|
|
|
|
console.log('预案内容', data) |
|
|
|
|
|
|
|
|
|
this.planTemplateData = JSON.parse(data.webTextData).filter(item => |
|
|
|
|
item.completed == true |
|
|
|
|
) |
|
|
|
|
//this.planTemplateData=JSON.parse(data.webTextData)
|
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
if (this.planTemplateData[0].groupName != '封面') { |
|
|
|
|
if(this.route.snapshot.queryParams.haveNew!=undefined&&data.webTextData==null){ |
|
|
|
|
this.planTemplateData=[] |
|
|
|
|
let obj = { |
|
|
|
|
completed: true, |
|
|
|
|
groupName: "封面", |
|
|
|
|
attribute: { |
|
|
|
|
planNumber: '', |
|
|
|
|
planName: this.route.snapshot.queryParams.planName, |
|
|
|
|
objName: this.unitData.name, |
|
|
|
|
unitNature: this.unitData.buildingTypes[0].name, |
|
|
|
|
planLevel: '', |
|
|
|
|
disasterType: '火灾', |
|
|
|
|
fireproofingLevel: '', |
|
|
|
|
fireproofingAdminister: this.unitData.organizationName, |
|
|
|
|
putOutFireAdminister: '', |
|
|
|
|
producer: { |
|
|
|
|
name: '', |
|
|
|
|
duty: '' |
|
|
|
|
}, |
|
|
|
|
verifier: { |
|
|
|
|
name: '', |
|
|
|
|
duty: '' |
|
|
|
|
}, |
|
|
|
|
auditTime: '' |
|
|
|
|
} |
|
|
|
|
completed: true, |
|
|
|
|
groupName: "封面", |
|
|
|
|
attribute: { |
|
|
|
|
planNumber: '', |
|
|
|
|
planName: this.route.snapshot.queryParams.planName, |
|
|
|
|
objName: this.unitData.name, |
|
|
|
|
unitNature: this.unitData.buildingTypes[0].name, |
|
|
|
|
planLevel: '', |
|
|
|
|
disasterType: '火灾', |
|
|
|
|
fireproofingLevel: '', |
|
|
|
|
fireproofingAdminister: this.unitData.organizationName, |
|
|
|
|
putOutFireAdminister: '', |
|
|
|
|
producer: { |
|
|
|
|
name: '', |
|
|
|
|
duty: '' |
|
|
|
|
}, |
|
|
|
|
verifier: { |
|
|
|
|
name: '', |
|
|
|
|
duty: '' |
|
|
|
|
}, |
|
|
|
|
auditTime: '' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.planTemplateData.unshift(obj) |
|
|
|
|
} |
|
|
|
|
else if (this.planTemplateData[0].groupName == '封面') { |
|
|
|
|
this.planTemplateData[0].attribute.objName = this.unitData.name |
|
|
|
|
} |
|
|
|
|
this.planTemplateData.forEach(element => { |
|
|
|
|
if (element.groupName == '重点图示') { |
|
|
|
|
if (!element.attribute) { |
|
|
|
|
element.attribute = [{ name: '', imgArr: [] }] |
|
|
|
|
this.planTemplateData.push(this.danweInfo) |
|
|
|
|
this.planTemplateData.push({completed: true,groupName: '新建'}) |
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
}else if(data.webTextData!=null){ |
|
|
|
|
this.planTemplateData = JSON.parse(data.webTextData).filter(item => |
|
|
|
|
item.completed == true |
|
|
|
|
) |
|
|
|
|
//this.planTemplateData=JSON.parse(data.webTextData)
|
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
if (this.planTemplateData[0].groupName != '封面') { |
|
|
|
|
let obj = { |
|
|
|
|
completed: true, |
|
|
|
|
groupName: "封面", |
|
|
|
|
attribute: { |
|
|
|
|
planNumber: '', |
|
|
|
|
planName: this.route.snapshot.queryParams.planName, |
|
|
|
|
objName: this.unitData.name, |
|
|
|
|
unitNature: this.unitData.buildingTypes[0].name, |
|
|
|
|
planLevel: '', |
|
|
|
|
disasterType: '火灾', |
|
|
|
|
fireproofingLevel: '', |
|
|
|
|
fireproofingAdminister: this.unitData.organizationName, |
|
|
|
|
putOutFireAdminister: '', |
|
|
|
|
producer: { |
|
|
|
|
name: '', |
|
|
|
|
duty: '' |
|
|
|
|
}, |
|
|
|
|
verifier: { |
|
|
|
|
name: '', |
|
|
|
|
duty: '' |
|
|
|
|
}, |
|
|
|
|
auditTime: '' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.planTemplateData.unshift(obj) |
|
|
|
|
} |
|
|
|
|
if (element.groupName == '交通水源') { |
|
|
|
|
if (!element.attribute) { |
|
|
|
|
element.attribute = [{ name: '', imgArr: [] }] |
|
|
|
|
} |
|
|
|
|
else if (this.planTemplateData[0].groupName == '封面') { |
|
|
|
|
this.planTemplateData[0].attribute.objName = this.unitData.name |
|
|
|
|
} |
|
|
|
|
if (element.groupName == '预案附件') { |
|
|
|
|
if (!element.attribute) { |
|
|
|
|
element.attribute = [{ name: '', imgArr: [] }] |
|
|
|
|
this.planTemplateData.forEach(element => { |
|
|
|
|
if (element.groupName == '重点图示') { |
|
|
|
|
if (!element.attribute) { |
|
|
|
|
element.attribute = [{ name: '', imgArr: [] }] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (element.groupName == '处置要点') { |
|
|
|
|
if (!element.attribute) { |
|
|
|
|
element.attribute = [{ name: '', content: '' }] |
|
|
|
|
if (element.groupName == '交通水源') { |
|
|
|
|
if (!element.attribute) { |
|
|
|
|
element.attribute = [{ name: '', imgArr: [] }] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (element.groupName == '特别警示') { |
|
|
|
|
if (!element.attribute) { |
|
|
|
|
element.attribute = [{ name: '特别警示', content: '' }] |
|
|
|
|
if (element.groupName == '预案附件') { |
|
|
|
|
if (!element.attribute) { |
|
|
|
|
element.attribute = [{ name: '', imgArr: [] }] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(element.groupName=='单位概况'){ |
|
|
|
|
this.clickTitleItem(this.planTemplateData[1]) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if(this.planLevel=='4'||this.route.snapshot.queryParams.haveNew){ |
|
|
|
|
this.planTemplateData.push({completed: true,groupName: '新建'}) |
|
|
|
|
} |
|
|
|
|
this.planTemplateData.forEach(element => { |
|
|
|
|
if(element.attribute!=undefined){ |
|
|
|
|
/* element.attribute.forEach((item,index,value) => { |
|
|
|
|
if(value[index].level!=undefined&&value[index].level==1){ |
|
|
|
|
value[index].lieNumber=value[index].tableth.length |
|
|
|
|
if (element.groupName == '处置要点') { |
|
|
|
|
if (!element.attribute) { |
|
|
|
|
element.attribute = [{ name: '', content: '' }] |
|
|
|
|
} |
|
|
|
|
}); */ |
|
|
|
|
for(let i=0;i<element.attribute.length;i++){ |
|
|
|
|
if(element.attribute[i].level!=undefined&&element.attribute[i].level==1){ |
|
|
|
|
element.attribute[i].lieNumber=element.attribute[i].tableth.length |
|
|
|
|
} |
|
|
|
|
if (element.groupName == '特别警示') { |
|
|
|
|
if (!element.attribute) { |
|
|
|
|
element.attribute = [{ name: '特别警示', content: '' }] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(element.groupName=='单位概况'){ |
|
|
|
|
this.clickTitleItem(this.planTemplateData[1]) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
if(this.planLevel=='4'||this.route.snapshot.queryParams.haveNew){ |
|
|
|
|
this.planTemplateData.push({completed: true,groupName: '新建'}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
this.planTemplateData.forEach(element => { |
|
|
|
|
if(element.attribute!=undefined){ |
|
|
|
|
/* element.attribute.forEach((item,index,value) => { |
|
|
|
|
if(value[index].level!=undefined&&value[index].level==1){ |
|
|
|
|
value[index].lieNumber=value[index].tableth.length |
|
|
|
|
} |
|
|
|
|
}); */ |
|
|
|
|
for(let i=0;i<element.attribute.length;i++){ |
|
|
|
|
if(element.attribute[i].level!=undefined&&element.attribute[i].level==1){ |
|
|
|
|
element.attribute[i].lieNumber=element.attribute[i].tableth.length |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//引入数据json
|
|
|
|
@ -1430,6 +1445,9 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
console.log(bodyi) |
|
|
|
|
if(arr[bodyi].zdy==undefined){ |
|
|
|
|
if (surveyName == '进攻通道') { |
|
|
|
|
if(this.planTemplateData[index].building[attacki].body[bodyi].attinf==undefined){ |
|
|
|
|
this.planTemplateData[index].building[attacki].body[bodyi].attinf=[] |
|
|
|
|
} |
|
|
|
|
if (this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr == undefined) { |
|
|
|
|
this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].tabletr = [] |
|
|
|
|
} |
|
|
|
@ -1452,11 +1470,17 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ heafName: '', body: [{ name: '重点部位名称', value: '' }, { name: '重点部位所在位置', value: '' }, { name: '建筑结构', value: '' }, { name: '使用性质', value: '' }, { name: '主要危险性', value: '' }] }) |
|
|
|
|
} |
|
|
|
|
else if(surveyName == '单位基本信息'||surveyName == '建筑信息'){ |
|
|
|
|
if(this.planTemplateData[index].building[attacki].body[bodyi].attinf==undefined){ |
|
|
|
|
this.planTemplateData[index].building[attacki].body[bodyi].attinf=[] |
|
|
|
|
} |
|
|
|
|
this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ propertyName: '', value: '',completed:true,zdy:true }) |
|
|
|
|
} else if(surveyName == '四周毗邻'){ |
|
|
|
|
this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ name: '', value: '',completed:true,zdy:false }) |
|
|
|
|
this.planTemplateData[index].building[attacki].body[bodyi].attinf.push({ name: '', value: '',completed:true,zdy:true }) |
|
|
|
|
}else if(surveyName == '消防设施'){ |
|
|
|
|
if(this.planTemplateData[index].building[attacki].body[bodyi].attinf==undefined){ |
|
|
|
|
this.planTemplateData[index].building[attacki].body[bodyi].attinf=[] |
|
|
|
|
} |
|
|
|
|
if(fileNum==0){ |
|
|
|
|
this.planTemplateData[index].building[attacki].body[bodyi].attinf[i].facilityItems.push({ name: '', value: '',completed:true,zdy:true}) |
|
|
|
|
}else{ |
|
|
|
@ -1844,6 +1868,47 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
//单位概况自定义新增数据
|
|
|
|
|
unitZdyaaa(){ |
|
|
|
|
let list=[] |
|
|
|
|
let index = this.getArrayIndex(this.planTemplateData,'单位概况') |
|
|
|
|
const dialogRef = this.dialog.open(adddwsurvey, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
width: '240px', |
|
|
|
|
height:'420px', |
|
|
|
|
disableClose:true, |
|
|
|
|
data:this.planTemplateData |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log(result) |
|
|
|
|
if(result!=undefined){ |
|
|
|
|
if(result.length>this.planTemplateData.length){ |
|
|
|
|
result.forEach((valuer,i,rarr) => { |
|
|
|
|
let temp=0 |
|
|
|
|
this.planTemplateData[index].attribute.forEach((group,gi,garr) => { |
|
|
|
|
if(valuer.surveyName==group.surveyName){ |
|
|
|
|
temp++ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(temp==0){ |
|
|
|
|
//将缺少的填上
|
|
|
|
|
this.planTemplateData[index].attribute.push(valuer) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
result.forEach((valuer,i,rarr) => { |
|
|
|
|
this.planTemplateData[index].attribute.forEach((group,gi,garr) => { |
|
|
|
|
if(garr[gi].surveyName==rarr[i].surveyName){ |
|
|
|
|
garr[gi].completed=rarr[i].completed |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
this.planTemplateData[index].building[this.clicki].body=this.planTemplateData[index].attribute |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2056,4 +2121,5 @@ export class updataHl{
|
|
|
|
|
} |
|
|
|
|
this.dialogRef.close(result); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|