|
|
|
@ -265,8 +265,31 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
console.log(this.newleftTabledata) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//自定义新增分组
|
|
|
|
|
zdyaddGroup(){ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
if(this.unitName==undefined){ |
|
|
|
|
this.snackBar.open('请选择预案模板!','确定',config); |
|
|
|
|
}else{ |
|
|
|
|
const dialogRef = this.dialog.open(zdyaddGroup, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
width: '340px', |
|
|
|
|
height:'200px', |
|
|
|
|
disableClose:true, |
|
|
|
|
data:this.newleftTabledata[this.leftclicki].data==null?null:this.newleftTabledata[this.leftclicki].data==0?null:this.newleftTabledata[this.leftclicki].data |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log(result) |
|
|
|
|
if(result!=undefined){ |
|
|
|
|
this.newleftTabledata[this.leftclicki].data.push({groupName:result,completed: true,attribute:[],zdy:true}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//删除分组
|
|
|
|
|
deleteGroup(groupName){ |
|
|
|
@ -283,7 +306,9 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
//新增属性
|
|
|
|
|
groupName |
|
|
|
|
addAttribute(groupName){ |
|
|
|
|
ziint=0 |
|
|
|
|
addAttribute(zi,groupName){ |
|
|
|
|
this.ziint=zi |
|
|
|
|
this.groupPanle=true |
|
|
|
|
this.groupName=groupName |
|
|
|
|
if(groupName=='单位概况'){ |
|
|
|
@ -348,6 +373,26 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
this.groupPanle=true |
|
|
|
|
this.accordion.closeAll() |
|
|
|
|
} |
|
|
|
|
//自定义新增属性
|
|
|
|
|
zdyaddAttribute(){ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
const dialogRef = this.dialog.open(zdyaddattinf, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
width: '340px', |
|
|
|
|
height:'200px', |
|
|
|
|
disableClose:true, |
|
|
|
|
data:this.newleftTabledata[this.leftclicki].data==null?null:this.newleftTabledata[this.leftclicki].data==0?null:this.newleftTabledata[this.leftclicki].data |
|
|
|
|
}); |
|
|
|
|
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:[]}) |
|
|
|
|
} |
|
|
|
|
console.log(this.group) |
|
|
|
|
}); |
|
|
|
|
this.accordion.closeAll() |
|
|
|
|
} |
|
|
|
|
//删除具体属性
|
|
|
|
|
delAttribute(groupName,surveyName){ |
|
|
|
|
let isTrue = confirm('您确定要删除吗') |
|
|
|
@ -367,13 +412,49 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
//新增属性信息
|
|
|
|
|
danweiInfTable=[] |
|
|
|
|
addAttInfo(surveyName){ |
|
|
|
|
if(surveyName=='进攻通道'){ |
|
|
|
|
if(this.group[0].attribute[4].attinf==undefined){ |
|
|
|
|
this.group[0].attribute[4].attinf=[] |
|
|
|
|
this.group[0].attribute[4].attinf.push({head:'',tableth:[],completed:true}) |
|
|
|
|
}else{ |
|
|
|
|
this.group[0].attribute[4].attinf.push({head:'',tableth:[],completed:true}) |
|
|
|
|
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}) |
|
|
|
|
}else{ |
|
|
|
|
this.group[0].attribute[suri].attinf.push({head:'',tableth:[],completed:true}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
const dialogRef = this.dialog.open(zdydisaster, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
width: '340px', |
|
|
|
|
height:'450px', |
|
|
|
|
disableClose:true, |
|
|
|
|
data:this.group |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log(result) |
|
|
|
|
if(result!=undefined){ |
|
|
|
|
this.group[0].attribute.forEach((value,index,array)=>{ |
|
|
|
|
if(array[index].surveyName==surveyName){ |
|
|
|
|
if(array[index].attinf==undefined){ |
|
|
|
|
array[index].attinf=[] |
|
|
|
|
array[index].attinf.push(result) |
|
|
|
|
}else{ |
|
|
|
|
array[index].attinf.push(result) |
|
|
|
|
} |
|
|
|
|
if(result.level==2){ |
|
|
|
|
for(var i=0;i<result.hNumber;i++){ |
|
|
|
|
array[index].attinf[array[index].attinf.length-1].tableth.push([{head:'',body:''}]) |
|
|
|
|
for(var j=0;j<result.lieNumber-1;j++){ |
|
|
|
|
array[index].attinf[array[index].attinf.length-1].tableth[i].push({head:'',body:''}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//console.log(this.newleftTabledata)
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
@ -385,7 +466,7 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
data:{newleftTabledata:this.newleftTabledata,surveyName:surveyName,leftclicki:this.leftclicki} |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log(result) |
|
|
|
|
//console.log(result)
|
|
|
|
|
if(result!=undefined){ |
|
|
|
|
this.newleftTabledata[this,this.leftclicki].data.forEach((value,index,array)=>{ |
|
|
|
|
if(value.groupName=='单位概况'){ |
|
|
|
@ -463,7 +544,27 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//进攻通道
|
|
|
|
|
//单位概况自定义新增表格数据
|
|
|
|
|
zdyattackAdd(suri,i,level){ |
|
|
|
|
/* this.group[0].attribute.forEach((value,index,array)=>{ |
|
|
|
|
if (array[index].groupName==name) { |
|
|
|
|
if(level==1){ |
|
|
|
|
this.group[index].attribute[i].tableth.push('') |
|
|
|
|
}else if(level==2){ |
|
|
|
|
this.group[index].attribute[i].tableth.push({head:'',body:''}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) */ |
|
|
|
|
this.group[0].attribute[suri].attinf[i].tableth.push('') |
|
|
|
|
} |
|
|
|
|
//单位概况自定义删除一条数据
|
|
|
|
|
zdyDelDisaster(suri,attributei){ |
|
|
|
|
let isTrue = confirm('您确定要删除该条信息吗') |
|
|
|
|
if(isTrue){ |
|
|
|
|
this.group[0].attribute[suri].attinf.splice(attributei,1) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//进攻通道,灾情设定及其他增加表格数据
|
|
|
|
|
attackAdd(name,i,level){ |
|
|
|
@ -624,15 +725,14 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
//第二层向上排序
|
|
|
|
|
zaiTop(zi,attributei){ |
|
|
|
|
console.log(zi,attributei) |
|
|
|
|
var temp |
|
|
|
|
if(attributei!=0){ |
|
|
|
|
for (let index = attributei-1; index >=0; index--) { |
|
|
|
|
if(this.group[zi].attribute[index].completed){ |
|
|
|
|
temp=this.group[zi].attribute[index] |
|
|
|
|
temp=this.group[zi].attribute[index] |
|
|
|
|
this.group[zi].attribute[index]=this.group[zi].attribute[attributei] |
|
|
|
|
this.group[zi].attribute[attributei]=temp |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -644,12 +744,10 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
var temp |
|
|
|
|
if (attributei!=this.group[zi].attribute.length-1) { |
|
|
|
|
for (let index = attributei+1; index < this.group[zi].attribute.length; index++) { |
|
|
|
|
if(this.group[zi].attribute[index].completed){ |
|
|
|
|
temp=this.group[zi].attribute[index] |
|
|
|
|
this.group[zi].attribute[index]=this.group[zi].attribute[attributei] |
|
|
|
|
this.group[zi].attribute[attributei]=temp |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
temp=this.group[zi].attribute[index] |
|
|
|
|
this.group[zi].attribute[index]=this.group[zi].attribute[attributei] |
|
|
|
|
this.group[zi].attribute[attributei]=temp |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -720,6 +818,38 @@ export class PlanTemplateComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//单位概况自定义内容向上排序
|
|
|
|
|
adyTop(suri,attributei){ |
|
|
|
|
var temp |
|
|
|
|
if(attributei!=0){ |
|
|
|
|
for (let index = attributei-1; index >=0; index--) { |
|
|
|
|
if(this.group[0].attribute[suri].completed){ |
|
|
|
|
temp=this.group[0].attribute[suri].attinf[index] |
|
|
|
|
this.group[0].attribute[suri].attinf[index]=this.group[0].attribute[suri].attinf[attributei] |
|
|
|
|
this.group[0].attribute[suri].attinf[attributei]=temp |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//自定义单位概况内容乡下排序
|
|
|
|
|
adyDown(suri,attributei){ |
|
|
|
|
var temp |
|
|
|
|
if (attributei!=this.group[0].attribute[suri].attinf.length-1) { |
|
|
|
|
for (let index = attributei+1; index < this.group[0].attribute[suri].attinf.length; index++) { |
|
|
|
|
if(this.group[0].attribute[suri].completed){ |
|
|
|
|
temp=this.group[0].attribute[suri].attinf[index] |
|
|
|
|
this.group[0].attribute[suri].attinf[index]=this.group[0].attribute[suri].attinf[attributei] |
|
|
|
|
this.group[0].attribute[suri].attinf[attributei]=temp |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//新建预案
|
|
|
|
|
@Component({ |
|
|
|
@ -930,6 +1060,35 @@ export class addGroup{
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//自定义新增分组
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'zdyaddGroup', |
|
|
|
|
templateUrl: './zdyaddgroup.html', |
|
|
|
|
styleUrls: ['./addgroup.scss'] |
|
|
|
|
}) |
|
|
|
|
export class zdyaddGroup{ |
|
|
|
|
constructor(private http: HttpClient,public dialogRef: MatDialogRef<addGroup>,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} |
|
|
|
|
ngOnInit(): void{ |
|
|
|
|
//console.log(this.data)
|
|
|
|
|
} |
|
|
|
|
groupName |
|
|
|
|
//取消按钮
|
|
|
|
|
close(){ |
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
} |
|
|
|
|
//确定提交
|
|
|
|
|
newGroup(){ |
|
|
|
|
console.log(this.groupName) |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
if(this.groupName==''||this.groupName==undefined){ |
|
|
|
|
this.snackBar.open('请输入分组名称!','确定',config); |
|
|
|
|
}else{ |
|
|
|
|
this.dialogRef.close(this.groupName); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//单位概况新增弹窗
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'adddwsurvey', |
|
|
|
@ -971,6 +1130,35 @@ defineClick(){
|
|
|
|
|
this.dialogRef.close(this.addwsurvey) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//单位概况自定义新增弹窗
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'zdyaddattinf', |
|
|
|
|
templateUrl: './zdyaddgroup.html', |
|
|
|
|
styleUrls: ['./addgroup.scss'] |
|
|
|
|
}) |
|
|
|
|
export class zdyaddattinf{ |
|
|
|
|
constructor(private http: HttpClient,public dialogRef: MatDialogRef<addGroup>,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} |
|
|
|
|
ngOnInit(): void{ |
|
|
|
|
//console.log(this.data)
|
|
|
|
|
} |
|
|
|
|
groupName |
|
|
|
|
//取消按钮
|
|
|
|
|
close(){ |
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
} |
|
|
|
|
//确定提交
|
|
|
|
|
newGroup(){ |
|
|
|
|
console.log(this.groupName) |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
if(this.groupName==''||this.groupName==undefined){ |
|
|
|
|
this.snackBar.open('请输入属性名称!','确定',config); |
|
|
|
|
}else{ |
|
|
|
|
this.dialogRef.close(this.groupName); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//编辑单位概况单位基本信息属性信息弹窗
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'addattinf', |
|
|
|
@ -1087,7 +1275,51 @@ defineClick(){
|
|
|
|
|
this.addAttinfBuild:this.data.surveyName=='消防设施'?this.addAttinfFile:this.facilityItems) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//单位概况自定义新增四个分类
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'zdydisaster', |
|
|
|
|
templateUrl: './Disaster.html', |
|
|
|
|
styleUrls: ['./addKeyname.scss'] |
|
|
|
|
}) |
|
|
|
|
export class zdydisaster{ |
|
|
|
|
constructor(private http: HttpClient,public dialogRef: MatDialogRef<disaster>,@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) {} |
|
|
|
|
ngOnInit(): void{ |
|
|
|
|
console.log(this.data) |
|
|
|
|
} |
|
|
|
|
level//类型
|
|
|
|
|
headName//表头名称
|
|
|
|
|
lieNumber//列数
|
|
|
|
|
hNumber//行数
|
|
|
|
|
//取消按钮
|
|
|
|
|
close(){ |
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
} |
|
|
|
|
//确定按钮
|
|
|
|
|
newdisaster(){ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
if(this.level==undefined||this.level==''){ |
|
|
|
|
this.snackBar.open('请选择类型!','确定',config); |
|
|
|
|
}else if(this.headName==undefined||this.headName==''){ |
|
|
|
|
this.snackBar.open('请输入表头名称!','确定',config); |
|
|
|
|
}else{ |
|
|
|
|
let tree={ |
|
|
|
|
json:[], |
|
|
|
|
name: '' |
|
|
|
|
} |
|
|
|
|
let attrubute={ |
|
|
|
|
headName:this.headName, |
|
|
|
|
level:this.level, |
|
|
|
|
tableth:this.level==1||this.level==2?[]:this.level==3?'':tree, |
|
|
|
|
lieNumber:this.lieNumber, |
|
|
|
|
hNumber:this.hNumber |
|
|
|
|
} |
|
|
|
|
this.dialogRef.close(attrubute); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//灾情设定弹窗
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'disaster', |
|
|
|
|