|
|
|
@ -12,7 +12,7 @@ import { ActivatedRoute } from '@angular/router';
|
|
|
|
|
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
|
|
|
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
|
|
|
import Viewer from 'viewerjs'; |
|
|
|
|
declare var $:any |
|
|
|
|
declare var $: any |
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-create-plan-online-five', |
|
|
|
|
templateUrl: './create-plan-online-five.component.html', |
|
|
|
@ -79,12 +79,12 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
} else if (this.selectedItem == '单位概况') { |
|
|
|
|
this.getAllBuildings() |
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[0].value=this.unitData.usci |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[1].value=this.unitData.buildingTypes[0].name |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[2].value=this.unitData.contacts |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[3].value=this.unitData.phone |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[4].value=this.unitData.organizationName |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[5].value=this.unitData.address |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[0].value = this.unitData.usci |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[1].value = this.unitData.buildingTypes[0].name |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[2].value = this.unitData.contacts |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[3].value = this.unitData.phone |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[4].value = this.unitData.organizationName |
|
|
|
|
this.planTemplateData[1].attribute[0].attinf[5].value = this.unitData.address |
|
|
|
|
} /* else if (this.selectedItem == '单位概况') { |
|
|
|
|
//this.getAllBuildings()
|
|
|
|
|
} */ else if (this.selectedItem == '预案附件') { |
|
|
|
@ -168,7 +168,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
objName: this.unitData.name, |
|
|
|
|
unitNature: this.unitData.buildingTypes[0].name, |
|
|
|
|
planLevel: '', |
|
|
|
|
disasterType: '0', |
|
|
|
|
disasterType: '火灾', |
|
|
|
|
fireproofingLevel: '', |
|
|
|
|
fireproofingAdminister: this.unitData.organizationName, |
|
|
|
|
putOutFireAdminister: '', |
|
|
|
@ -304,13 +304,13 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.allBuildings = data |
|
|
|
|
if(this.planTemplateData[1].building==undefined){ |
|
|
|
|
this.planTemplateData[1].building=[] |
|
|
|
|
for(var i=0;i<this.allBuildings.length;i++){ |
|
|
|
|
if(i==0){ |
|
|
|
|
this.planTemplateData[1].building.push({name:this.allBuildings[i].name,body:this.planTemplateData[1].attribute,completed:true}) |
|
|
|
|
}else{ |
|
|
|
|
this.planTemplateData[1].building.push({name:this.allBuildings[i].name,body:this.planTemplateData[1].attribute,completed:false}) |
|
|
|
|
if (this.planTemplateData[1].building == undefined) { |
|
|
|
|
this.planTemplateData[1].building = [] |
|
|
|
|
for (var i = 0; i < this.allBuildings.length; i++) { |
|
|
|
|
if (i == 0) { |
|
|
|
|
this.planTemplateData[1].building.push({ name: this.allBuildings[i].name, body: this.planTemplateData[1].attribute, completed: true }) |
|
|
|
|
} else { |
|
|
|
|
this.planTemplateData[1].building.push({ name: this.allBuildings[i].name, body: this.planTemplateData[1].attribute, completed: false }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -318,7 +318,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
//this.buildingName=this.planTemplateData[1].building[0].name
|
|
|
|
|
this.group=this.planTemplateData[1].building |
|
|
|
|
this.group = this.planTemplateData[1].building |
|
|
|
|
//delete this.planTemplateData[0].attribute
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
@ -411,15 +411,15 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
buildingName |
|
|
|
|
clicki = 0 |
|
|
|
|
group |
|
|
|
|
clickBuilding(item,i){ |
|
|
|
|
this.buildingName=item.name |
|
|
|
|
this.clicki=i |
|
|
|
|
console.log(item,this.clicki) |
|
|
|
|
clickBuilding(item, i) { |
|
|
|
|
this.buildingName = item.name |
|
|
|
|
this.clicki = i |
|
|
|
|
console.log(item, this.clicki) |
|
|
|
|
//this.group=this.planTemplateData[1].building[this.clicki].body
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//单位概况增加一行
|
|
|
|
|
unitadd(surveyName, attacki,i) { |
|
|
|
|
unitadd(surveyName, attacki, i) { |
|
|
|
|
this.addNumber++ |
|
|
|
|
if (surveyName == '进攻通道') { |
|
|
|
|
if (this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr == undefined) { |
|
|
|
@ -437,21 +437,21 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
// console.log(this.planTemplateData)
|
|
|
|
|
} |
|
|
|
|
else if(surveyName=='功能分区'){ |
|
|
|
|
else if (surveyName == '功能分区') { |
|
|
|
|
console.log(attacki) |
|
|
|
|
this.planTemplateData[1].building[attacki].body[6].attinf.push({name:'',value:''}) |
|
|
|
|
}else if(surveyName=='重点部位'){ |
|
|
|
|
this.planTemplateData[1].building[attacki].body[5].attinf.push({heafName:'',body:[{name:'重点部位名称',value:''},{name:'重点部位所在位置',value:''},{name:'建筑结构',value:''},{name:'使用性质',value:''},{name:'主要危险性',value:''}]}) |
|
|
|
|
this.planTemplateData[1].building[attacki].body[6].attinf.push({ name: '', value: '' }) |
|
|
|
|
} else if (surveyName == '重点部位') { |
|
|
|
|
this.planTemplateData[1].building[attacki].body[5].attinf.push({ heafName: '', body: [{ name: '重点部位名称', value: '' }, { name: '重点部位所在位置', value: '' }, { name: '建筑结构', value: '' }, { name: '使用性质', value: '' }, { name: '主要危险性', value: '' }] }) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//单位概况删除一行
|
|
|
|
|
unitDel(surveyName, attacki,i) { |
|
|
|
|
unitDel(surveyName, attacki, i) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
let isTrue = confirm('您确定要删除该条信息吗') |
|
|
|
|
if(surveyName=='进攻通道'){ |
|
|
|
|
if(isTrue){ |
|
|
|
|
if (surveyName == '进攻通道') { |
|
|
|
|
if (isTrue) { |
|
|
|
|
if (this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr != undefined) { |
|
|
|
|
this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr.splice(this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr.length - 1, 1) |
|
|
|
|
this.addNumber-- |
|
|
|
@ -462,13 +462,13 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
this.snackBar.open('请先增加一行!', '确定', config); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else if(surveyName=='功能分区'){ |
|
|
|
|
if(isTrue){ |
|
|
|
|
this.planTemplateData[1].building[attacki].body[6].attinf.splice(i,1) |
|
|
|
|
} else if (surveyName == '功能分区') { |
|
|
|
|
if (isTrue) { |
|
|
|
|
this.planTemplateData[1].building[attacki].body[6].attinf.splice(i, 1) |
|
|
|
|
} |
|
|
|
|
}else if(surveyName=='重点部位'){ |
|
|
|
|
if(isTrue){ |
|
|
|
|
this.planTemplateData[1].building[attacki].body[5].attinf.splice(i,1) |
|
|
|
|
} else if (surveyName == '重点部位') { |
|
|
|
|
if (isTrue) { |
|
|
|
|
this.planTemplateData[1].building[attacki].body[5].attinf.splice(i, 1) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -524,13 +524,27 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
quitPreview() { |
|
|
|
|
this.pattern = 'edit' |
|
|
|
|
} |
|
|
|
|
//提交
|
|
|
|
|
submit() { |
|
|
|
|
console.log('提交信息', this.planTemplateData) |
|
|
|
|
let body = { |
|
|
|
|
webTextData: JSON.stringify(this.planTemplateData) |
|
|
|
|
} |
|
|
|
|
this.http.put(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}`, body).subscribe(data => { |
|
|
|
|
// console.log('提交成功',data)
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('提交成功', '确定', config); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//返回顶部
|
|
|
|
|
goBack() { |
|
|
|
|
document.querySelector('#mainbox').scrollIntoView(true) |
|
|
|
|
} |
|
|
|
|
//生成word
|
|
|
|
|
generatingDoc() { |
|
|
|
|
console.log(666,$(".mainbox")) |
|
|
|
|
console.log(666, $(".mainbox")) |
|
|
|
|
$(".mainbox").wordExport('word文档'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|