|
|
|
@ -29,10 +29,6 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.getLeftdata() |
|
|
|
|
this.tree = { |
|
|
|
|
json:this.treedate, |
|
|
|
|
config: this.treeConfig |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
groupPanle=true//分组展开
|
|
|
|
|
attPanle=true |
|
|
|
@ -41,23 +37,7 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
/* {planCategory:3,basicCategoryId:"5e7c49e861550e2754d461ce",buildingTypeId: "5e7c8ffba3050b1a840ed4b6",unitname:'高层建筑',data:[]}, |
|
|
|
|
{planCategory:5,basicCategoryId:"60127efe2757e904e5721d83",buildingTypeId: "5e7c9018a3050b1a840ed4b7",unitname:'地下建筑',data:[]} */ |
|
|
|
|
] |
|
|
|
|
//树形结构数据
|
|
|
|
|
treedate=[ |
|
|
|
|
{ |
|
|
|
|
"guid": "bc4c7a02-5379-4046-92be-12c67af4295a", |
|
|
|
|
"displayName": "Elentrix", |
|
|
|
|
"children": [ |
|
|
|
|
/* "85d412c2-ebc1-4d56-96c9-7da433ac9bb2", |
|
|
|
|
"28aac445-83b1-464d-9695-a4157dab6eac" */ |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
tree |
|
|
|
|
treeConfig = { |
|
|
|
|
nodeWidth: 90, |
|
|
|
|
nodeHeight: 60 |
|
|
|
|
}; |
|
|
|
|
group=[] |
|
|
|
|
getLeftdata(){ |
|
|
|
|
this.http.get("/api/PlanTemplate").subscribe((data:any)=>{ |
|
|
|
@ -234,11 +214,6 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
if(this.unitName==undefined){ |
|
|
|
|
this.snackBar.open('请选择预案模板!','确定',config); |
|
|
|
|
}else{ |
|
|
|
|
/* this.newleftTabledata.forEach((value,index,array)=>{ |
|
|
|
|
if(array[index].buildingTypeId==this.buildingTypeId){ |
|
|
|
|
this.group=array[index].data |
|
|
|
|
} |
|
|
|
|
}) */ |
|
|
|
|
const dialogRef = this.dialog.open(addGroup, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
width: '240px', |
|
|
|
|
height:'620px', |
|
|
|
@ -247,19 +222,6 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log(result,this.newleftTabledata) |
|
|
|
|
/* if(result.length>this.newleftTabledata[this.leftclicki].data.length){ |
|
|
|
|
this.newleftTabledata[this.leftclicki].data.forEach((item,i,value)=>{ |
|
|
|
|
result.forEach((element,ri,rval) => { |
|
|
|
|
if(value[i].groupName==rval[ri].groupName){ |
|
|
|
|
console.log('000') |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.newleftTabledata[this.leftclicki].data.push(result) |
|
|
|
|
} */ |
|
|
|
|
//this.newleftTabledata[this.leftclicki].data.push({groupName: '预案附件', completed: false})
|
|
|
|
|
console.log(result) |
|
|
|
|
this.newleftTabledata.forEach((value,index,array)=>{ |
|
|
|
|
if(array[index].buildingTypeId==this.buildingTypeId&&array[index].planCategory==this.planCategory){ |
|
|
|
|
if(result!=undefined){ |
|
|
|
@ -269,7 +231,12 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
array[index].data=result |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
array[index].data[i].completed=rarr[i].completed |
|
|
|
|
array[index].data.forEach((group,gi,garr) => { |
|
|
|
|
if(garr[gi].groupName==rarr[i].groupName){ |
|
|
|
|
garr[gi].completed=rarr[i].completed |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
//array[index].data[i].completed=rarr[i].completed
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
@ -299,9 +266,13 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log(result) |
|
|
|
|
if(result!=undefined){ |
|
|
|
|
this.newleftTabledata[this.leftclicki].data.push({groupName:result,completed: true,attribute:[],zdy:true}) |
|
|
|
|
if(this.newleftTabledata[this.leftclicki].data==null){ |
|
|
|
|
//this.newleftTabledata[this.leftclicki].data=[]
|
|
|
|
|
this.newleftTabledata[this.leftclicki].data=result.addgtoup |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.newleftTabledata[this.leftclicki].data.push({groupName:result.groupName,completed: true,attribute:[],zdy:true}) |
|
|
|
|
} |
|
|
|
|
this.group=this.newleftTabledata[this.leftclicki].data |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -344,7 +315,12 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
if(array[index].attribute==null){ |
|
|
|
|
array[index].attribute=result |
|
|
|
|
}else{ |
|
|
|
|
array[index].attribute[i].completed=rarr[i].completed |
|
|
|
|
array[index].attribute.forEach((att,atti,attary) => { |
|
|
|
|
if(rarr[i].surveyName==attary[atti].surveyName){ |
|
|
|
|
attary[atti].completed=rarr[i].completed |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
//array[index].attribute[i].completed=rarr[i].completed
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
@ -403,7 +379,10 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log(result) |
|
|
|
|
if(result!=undefined){ |
|
|
|
|
this.newleftTabledata[this.leftclicki].data[0].attribute.push({completed: true, surveyName: result,zdy:true,attinf:[]}) |
|
|
|
|
if(this.newleftTabledata[this.leftclicki].data[0].attribute==null){ |
|
|
|
|
this.newleftTabledata[this.leftclicki].data[0].attribute=result.addwsurvey |
|
|
|
|
} |
|
|
|
|
this.newleftTabledata[this.leftclicki].data[0].attribute.push({completed: true, surveyName: result.groupName,zdy:true,attinf:[]}) |
|
|
|
|
} |
|
|
|
|
console.log(this.group) |
|
|
|
|
}); |
|
|
|
@ -436,6 +415,7 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
addAttInfo(surveyName,suri){ |
|
|
|
|
if(surveyName!='单位基本信息'&&surveyName!='建筑信息'&&surveyName!='四周毗邻'&&surveyName!='消防设施'&&surveyName!='重点部位'&&surveyName!='功能分区'){ |
|
|
|
|
if(surveyName=='进攻通道'){ |
|
|
|
|
//进攻通道只有表格
|
|
|
|
|
if(this.group[0].attribute[suri].attinf==undefined){ |
|
|
|
|
this.group[0].attribute[suri].attinf=[] |
|
|
|
|
this.group[0].attribute[suri].attinf.push({head:'',tableth:[],completed:true}) |
|
|
|
@ -530,13 +510,13 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
console.log(this.newleftTabledata) |
|
|
|
|
} |
|
|
|
|
//消防设施表格具体属性编辑
|
|
|
|
|
fileAdd(facilityItems,filei){ |
|
|
|
|
fileAdd(facilityItems,filei,filename){ |
|
|
|
|
if(facilityItems.length!=0){ |
|
|
|
|
const dialogRef = this.dialog.open(addattinf, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
width: '240px', |
|
|
|
|
height:'400px', |
|
|
|
|
disableClose:true, |
|
|
|
|
data:{facilityItems:facilityItems} |
|
|
|
|
data:{facilityItems:facilityItems,filename,newleftTabledata:this.newleftTabledata,leftclicki:this.leftclicki} |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log(result) |
|
|
|
@ -550,7 +530,7 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.group=this.newleftTabledata[this,this.leftclicki].data |
|
|
|
|
this.group=this.newleftTabledata[this.leftclicki].data |
|
|
|
|
} |
|
|
|
|
console.log(this.newleftTabledata) |
|
|
|
|
}); |
|
|
|
@ -652,242 +632,6 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
let linshi=[ |
|
|
|
|
{ |
|
|
|
|
"attribute": [ |
|
|
|
|
{ |
|
|
|
|
"attinf": [ |
|
|
|
|
{ |
|
|
|
|
"value": "", |
|
|
|
|
"olddata": "", |
|
|
|
|
"completed": false, |
|
|
|
|
"propertyName": "统一社会信用代码", |
|
|
|
|
"propertyType": 0 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"value": "", |
|
|
|
|
"olddata": "", |
|
|
|
|
"completed": false, |
|
|
|
|
"propertyName": "单位类型", |
|
|
|
|
"propertyType": 0 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"value": "", |
|
|
|
|
"olddata": "", |
|
|
|
|
"completed": true, |
|
|
|
|
"propertyName": "单位地址", |
|
|
|
|
"propertyType": 0, |
|
|
|
|
"analysisWord": { |
|
|
|
|
"valueAxis": [ 1, 1 ], |
|
|
|
|
"tableIndex": 0, |
|
|
|
|
"valueField": "propertyValue" |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"value": "", |
|
|
|
|
"olddata": "", |
|
|
|
|
"completed": true, |
|
|
|
|
"propertyName": "联系人", |
|
|
|
|
"propertyType": 0, |
|
|
|
|
"analysisWord": { |
|
|
|
|
"valueAxis": [ 1, 5 ], |
|
|
|
|
"tableIndex": 0, |
|
|
|
|
"valueField": "propertyValue" |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"value": "", |
|
|
|
|
"olddata": "", |
|
|
|
|
"completed": false, |
|
|
|
|
"propertyName": "辖区中队", |
|
|
|
|
"propertyType": 0 |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"value": "", |
|
|
|
|
"olddata": "", |
|
|
|
|
"completed": true, |
|
|
|
|
"propertyName": "联系电话", |
|
|
|
|
"propertyType": 0, |
|
|
|
|
"analysisWord": { |
|
|
|
|
"valueAxis": [ 1, 5 ], |
|
|
|
|
"tableIndex": 0, |
|
|
|
|
"valueField": "propertyValue" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
"completed": true, |
|
|
|
|
"surveyName": "单位基本信息" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": false, |
|
|
|
|
"surveyName": "建筑信息" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"attinf": [ |
|
|
|
|
{ |
|
|
|
|
"name": "东", |
|
|
|
|
"value": "", |
|
|
|
|
"analysisWord": { |
|
|
|
|
"valueAxis": [ 2, 2 ], |
|
|
|
|
"tableIndex": 0, |
|
|
|
|
"valueField": "value" |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"name": "西", |
|
|
|
|
"value": "", |
|
|
|
|
"analysisWord": { |
|
|
|
|
"valueAxis": [ 2, 4 ], |
|
|
|
|
"tableIndex": 0, |
|
|
|
|
"valueField": "value" |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"name": "南", |
|
|
|
|
"value": "", |
|
|
|
|
"analysisWord": { |
|
|
|
|
"valueAxis": [ 3, 2 ], |
|
|
|
|
"tableIndex": 0, |
|
|
|
|
"valueField": "value" |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"name": "北", |
|
|
|
|
"value": "", |
|
|
|
|
"analysisWord": { |
|
|
|
|
"valueAxis": [ 3, 4 ], |
|
|
|
|
"tableIndex": 0, |
|
|
|
|
"valueField": "value" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
"completed": true, |
|
|
|
|
"surveyName": "四周毗邻" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": false, |
|
|
|
|
"surveyName": "消防设施" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": false, |
|
|
|
|
"surveyName": "进攻通道" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"attinf": [ |
|
|
|
|
{ |
|
|
|
|
"body": [ |
|
|
|
|
{ |
|
|
|
|
"name": "重点部位名称", |
|
|
|
|
"value": "" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"name": "重点部位所在位置", |
|
|
|
|
"value": "" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"name": "建筑结构", |
|
|
|
|
"value": "" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"name": "使用性质", |
|
|
|
|
"value": "" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"name": "主要危险性", |
|
|
|
|
"value": "" |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
"heafName": "" |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
"completed": false, |
|
|
|
|
"surveyName": "重点部位" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"attinf": [ |
|
|
|
|
{ |
|
|
|
|
"name": "", |
|
|
|
|
"value": "" |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
"completed": false, |
|
|
|
|
"surveyName": "功能分区" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"zdy": true, |
|
|
|
|
"attinf": [ |
|
|
|
|
{ |
|
|
|
|
"level": "3", |
|
|
|
|
"tableth": "", |
|
|
|
|
"headName": "备注详情", |
|
|
|
|
"analysisWord": { |
|
|
|
|
"valueAxis": [ 4, 1 ], |
|
|
|
|
"tableIndex": 0, |
|
|
|
|
"valueField": "tableth" |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
"completed": true, |
|
|
|
|
"surveyName": "备注" |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
"completed": true, |
|
|
|
|
"groupName": "单位概况" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": false, |
|
|
|
|
"groupName": "灾情设定" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": false, |
|
|
|
|
"groupName": "力量调集" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": false, |
|
|
|
|
"groupName": "组织指挥" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": false, |
|
|
|
|
"groupName": "作战行动" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": false, |
|
|
|
|
"groupName": "社会联动" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": false, |
|
|
|
|
"groupName": "勤务保障" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": false, |
|
|
|
|
"groupName": "特别警示" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": false, |
|
|
|
|
"groupName": "辅助决策" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": true, |
|
|
|
|
"groupName": "交通水源", |
|
|
|
|
"manualWord": { |
|
|
|
|
"valueAxis": [ 1, 6 ], |
|
|
|
|
"KeyAxis": [ 0, 6 ], |
|
|
|
|
"tableIndex": 0 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": true, |
|
|
|
|
"groupName": "重点图示" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": false, |
|
|
|
|
"groupName": "处置要点" |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
"completed": false, |
|
|
|
|
"groupName": "预案附件" |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
let body={ |
|
|
|
|
id:this.Id, |
|
|
|
@ -1108,7 +852,7 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
////修改多行文本,表格行列数量
|
|
|
|
|
//修改多行文本,表格行列数量
|
|
|
|
|
updataHl(...num:number[]){ |
|
|
|
|
const dialogRef = this.dialog.open(updataHl, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
width: '340px', |
|
|
|
@ -1258,6 +1002,7 @@ export class addPlanname{
|
|
|
|
|
close(){ |
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
} |
|
|
|
|
//确定按钮
|
|
|
|
|
newplan(){ |
|
|
|
|
this.unitname=document.getElementById('unit').innerText |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
@ -1404,17 +1149,7 @@ export class addGroup{
|
|
|
|
|
//复选框点击事件
|
|
|
|
|
clicki |
|
|
|
|
checkClick(){ |
|
|
|
|
//this.clicki=i
|
|
|
|
|
//console.log(e,item)
|
|
|
|
|
/* if (e.checked) { |
|
|
|
|
this.groupName.push(item) |
|
|
|
|
}else { |
|
|
|
|
this.groupName.forEach((value,index,array)=>{ |
|
|
|
|
if(value==item){ |
|
|
|
|
this.groupName.splice(index,1) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} */ |
|
|
|
|
|
|
|
|
|
console.log(this.data) |
|
|
|
|
} |
|
|
|
|
//确定提交
|
|
|
|
@ -1450,20 +1185,52 @@ export class zdyaddGroup{
|
|
|
|
|
//console.log(this.data)
|
|
|
|
|
} |
|
|
|
|
groupName |
|
|
|
|
addgtoup=[ |
|
|
|
|
{groupName:'单位概况',completed:false},{groupName:'灾情设定',completed:false},{groupName:'力量调集',completed:false}, |
|
|
|
|
{groupName:'组织指挥',completed:false},{groupName:'作战行动',completed:false},{groupName:'社会联动',completed:false}, |
|
|
|
|
{groupName:'勤务保障',completed:false},{groupName:'特别警示',completed:false},{groupName:'辅助决策',completed:false}, |
|
|
|
|
{groupName:'交通水源',completed:false},{groupName:'重点图示',completed:false},{groupName:'处置要点',completed:false}, |
|
|
|
|
{groupName:'预案附件',completed:false} |
|
|
|
|
] |
|
|
|
|
newGroups:boolean |
|
|
|
|
//取消按钮
|
|
|
|
|
close(){ |
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
} |
|
|
|
|
//判断是否是分组存在的数据
|
|
|
|
|
groupHave(){ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
try{ |
|
|
|
|
this.addgtoup.forEach(item=>{ |
|
|
|
|
if(item.groupName==this.groupName){ |
|
|
|
|
this.newGroups=false |
|
|
|
|
this.snackBar.open('您输入的内容跟新增分组里面的内容重复,请点击新增分组寻找!','确定',config); |
|
|
|
|
throw Error(); |
|
|
|
|
}else{ |
|
|
|
|
this.newGroups=true |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}catch(e){ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//确定提交
|
|
|
|
|
newGroup(){ |
|
|
|
|
console.log(this.groupName) |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
config.duration = 5000 |
|
|
|
|
if(this.groupName==''||this.groupName==undefined){ |
|
|
|
|
this.snackBar.open('请输入分组名称!','确定',config); |
|
|
|
|
}else{ |
|
|
|
|
this.dialogRef.close(this.groupName); |
|
|
|
|
if(this.newGroups==true){ |
|
|
|
|
|
|
|
|
|
this.dialogRef.close({groupName:this.groupName,addgtoup:this.addgtoup}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1478,17 +1245,17 @@ export class adddwsurvey{
|
|
|
|
|
addwsurvey=[ |
|
|
|
|
{surveyName:'单位基本信息',completed:false},{surveyName:'建筑信息',completed:false}, |
|
|
|
|
{surveyName:'四周毗邻',completed:false,attinf:[{name:'东',value:''},{name:'西',value:''},{name:'南',value:''},{name:'北',value:''}]}, |
|
|
|
|
{surveyName:'消防设施',completed:false},{surveyName:'进攻通道',completed:false}, |
|
|
|
|
{surveyName:'消防设施',completed:false}, |
|
|
|
|
{surveyName:'重点部位',completed:false,attinf:[{heafName:'',body:[{name:'重点部位名称',value:''},{name:'重点部位所在位置',value:''},{name:'建筑结构',value:''},{name:'使用性质',value:''},{name:'主要危险性',value:''}]}]}, |
|
|
|
|
{surveyName:'功能分区',completed:false,attinf:[{name:'',value:''}]} |
|
|
|
|
] |
|
|
|
|
]//{surveyName:'进攻通道',completed:false},
|
|
|
|
|
ngOnInit(): void{ |
|
|
|
|
console.log(this.data) |
|
|
|
|
this.data=JSON.parse(JSON.stringify(this.data)) |
|
|
|
|
this.data.forEach(element => { |
|
|
|
|
if(element.groupName=='单位概况'&&element.attribute!=undefined){ |
|
|
|
|
this.addwsurvey=element.attribute |
|
|
|
|
/* element.attribute.forEach((datavalue,index,dataarr) => { |
|
|
|
|
//this.addwsurvey=element.attribute
|
|
|
|
|
element.attribute.forEach((datavalue,index,dataarr) => { |
|
|
|
|
this.addwsurvey.forEach((value,i,arr)=>{ |
|
|
|
|
if(dataarr[index].surveyName==arr[i].surveyName){ |
|
|
|
|
if(dataarr[index].completed==true&&arr[i].completed==false){ |
|
|
|
@ -1496,7 +1263,7 @@ ngOnInit(): void{
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); */ |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
console.log(this.addwsurvey) |
|
|
|
@ -1521,11 +1288,39 @@ export class zdyaddattinf{
|
|
|
|
|
ngOnInit(): void{ |
|
|
|
|
//console.log(this.data)
|
|
|
|
|
} |
|
|
|
|
newGroups:boolean |
|
|
|
|
groupName |
|
|
|
|
addwsurvey=[ |
|
|
|
|
{surveyName:'单位基本信息',completed:false},{surveyName:'建筑信息',completed:false}, |
|
|
|
|
{surveyName:'四周毗邻',completed:false,attinf:[{name:'东',value:''},{name:'西',value:''},{name:'南',value:''},{name:'北',value:''}]}, |
|
|
|
|
{surveyName:'消防设施',completed:false},{surveyName:'进攻通道',completed:false}, |
|
|
|
|
{surveyName:'重点部位',completed:false,attinf:[{heafName:'',body:[{name:'重点部位名称',value:''},{name:'重点部位所在位置',value:''},{name:'建筑结构',value:''},{name:'使用性质',value:''},{name:'主要危险性',value:''}]}]}, |
|
|
|
|
{surveyName:'功能分区',completed:false,attinf:[{name:'',value:''}]} |
|
|
|
|
] |
|
|
|
|
//取消按钮
|
|
|
|
|
close(){ |
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
} |
|
|
|
|
//判断是否跟系统内置的名称重复
|
|
|
|
|
groupHave(){ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
try{ |
|
|
|
|
this.addwsurvey.forEach(item=>{ |
|
|
|
|
if(item.surveyName==this.groupName){ |
|
|
|
|
this.newGroups=false |
|
|
|
|
this.snackBar.open('您输入的内容跟编辑里面的内容重复,请点击编辑寻找!','确定',config); |
|
|
|
|
//跳出foreach循环
|
|
|
|
|
throw Error(); |
|
|
|
|
}else{ |
|
|
|
|
this.newGroups=true |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}catch(e){ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//确定提交
|
|
|
|
|
newGroup(){ |
|
|
|
|
console.log(this.groupName) |
|
|
|
@ -1535,7 +1330,10 @@ export class zdyaddattinf{
|
|
|
|
|
if(this.groupName==''||this.groupName==undefined){ |
|
|
|
|
this.snackBar.open('请输入属性名称!','确定',config); |
|
|
|
|
}else{ |
|
|
|
|
this.dialogRef.close(this.groupName); |
|
|
|
|
if(this.newGroups){ |
|
|
|
|
this.dialogRef.close({groupName:this.groupName,addwsurvey:this.addwsurvey}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1608,12 +1406,13 @@ async getattinf(){
|
|
|
|
|
//console.log(this.addAttinfBuild)
|
|
|
|
|
}) |
|
|
|
|
}else if(value.surveyName=='建筑信息'&&value.attinf!=undefined){ |
|
|
|
|
this.buildnewDate=[] |
|
|
|
|
this.addAttinfBuild=value.attinf |
|
|
|
|
this.buildnewDate=[] //接受接口返回的新数据
|
|
|
|
|
this.addAttinfBuild=value.attinf //模板传过来的数据
|
|
|
|
|
this.addAttinfBuild=JSON.parse(JSON.stringify(this.addAttinfBuild)) |
|
|
|
|
let paramsdata:any ={ |
|
|
|
|
categoryId:this.data.newleftTabledata[this.data.leftclicki].basicCategoryId |
|
|
|
|
} |
|
|
|
|
/* 请求接口,做差异化对比 */ |
|
|
|
|
let restlt=await new Promise((resolve) => { |
|
|
|
|
this.http.get("/api/BasicGroups",{params:paramsdata}).subscribe((data:any)=>{ |
|
|
|
|
data.forEach((buildDate,buildi,buildarr) => { |
|
|
|
@ -1627,6 +1426,7 @@ async getattinf(){
|
|
|
|
|
}) |
|
|
|
|
})
|
|
|
|
|
this.buildnewDate=JSON.parse(JSON.stringify(this.buildnewDate)) |
|
|
|
|
//差异化比较
|
|
|
|
|
let temp=0 |
|
|
|
|
this.buildnewDate.forEach((buildval,buindi,buildarr)=>{ |
|
|
|
|
temp=0 |
|
|
|
@ -1636,6 +1436,7 @@ async getattinf(){
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(temp==0){ |
|
|
|
|
//模板数据少于接口数据
|
|
|
|
|
console.log(buildval) |
|
|
|
|
this.addAttinfBuild.push(buildval) |
|
|
|
|
} |
|
|
|
@ -1649,6 +1450,7 @@ async getattinf(){
|
|
|
|
|
}) |
|
|
|
|
if(temp==0){ |
|
|
|
|
console.log(addarr[addi]) |
|
|
|
|
//模板数据多了
|
|
|
|
|
this.addAttinfBuild.splice(addi,1) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -1683,7 +1485,7 @@ async getattinf(){
|
|
|
|
|
}); |
|
|
|
|
this.filenewDate.forEach(element => { |
|
|
|
|
element.completed=false |
|
|
|
|
element.olddata=element.propertyValue |
|
|
|
|
//element.olddata=element.propertyValue
|
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
})
|
|
|
|
@ -1691,26 +1493,26 @@ async getattinf(){
|
|
|
|
|
let temp=0 |
|
|
|
|
this.filenewDate.forEach((buildval,buindi,buildarr)=>{ |
|
|
|
|
temp=0 |
|
|
|
|
this.filenewDate.forEach((addval,addi,addarr)=>{ |
|
|
|
|
if(buildval.propertyName==addval.propertyName){ |
|
|
|
|
this.addAttinfFile.forEach((addval,addi,addarr)=>{ |
|
|
|
|
if(buildval.name==addval.name){ |
|
|
|
|
temp++ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(temp==0){ |
|
|
|
|
console.log(buildval) |
|
|
|
|
this.filenewDate.push(buildval) |
|
|
|
|
this.addAttinfFile.push(buildval) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.filenewDate.forEach((addval,addi,addarr)=>{ |
|
|
|
|
this.addAttinfFile.forEach((addval,addi,addarr)=>{ |
|
|
|
|
temp=0 |
|
|
|
|
this.filenewDate.forEach((buildval,buindi,buildarr)=>{ |
|
|
|
|
if(buildarr[buindi].propertyName==addarr[addi].propertyName){ |
|
|
|
|
if(buildarr[buindi].name==addarr[addi].name){ |
|
|
|
|
temp++ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(temp==0){ |
|
|
|
|
console.log(addarr[addi]) |
|
|
|
|
this.filenewDate.splice(addi,1) |
|
|
|
|
this.addAttinfFile.splice(addi,1) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -1718,11 +1520,52 @@ async getattinf(){
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}else{ |
|
|
|
|
//消防设施最里层数据
|
|
|
|
|
let apifile |
|
|
|
|
this.facilityItems=JSON.parse(JSON.stringify(this.data.facilityItems))
|
|
|
|
|
console.log(this.facilityItems) |
|
|
|
|
/* this.facilityItems.forEach(element => { |
|
|
|
|
element.completed=false |
|
|
|
|
}); */ |
|
|
|
|
//请求接口,看数据是否有变化
|
|
|
|
|
let paramsdata:any ={ |
|
|
|
|
categoryId:this.data.newleftTabledata[this.data.leftclicki].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) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|