|
|
@ -4,7 +4,7 @@ |
|
|
|
* @Author: sueRimn |
|
|
|
* @Author: sueRimn |
|
|
|
* @Date: 2021-06-16 13:56:54 |
|
|
|
* @Date: 2021-06-16 13:56:54 |
|
|
|
* @LastEditors: sueRimn |
|
|
|
* @LastEditors: sueRimn |
|
|
|
* @LastEditTime: 2021-06-29 17:00:09 |
|
|
|
* @LastEditTime: 2021-06-30 14:01:35 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular/core'; |
|
|
|
import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular/core'; |
|
|
@ -77,12 +77,13 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
this.getRealPicture() |
|
|
|
this.getRealPicture() |
|
|
|
}else if(this.selectedItem == '单位概况'){ |
|
|
|
}else if(this.selectedItem == '单位概况'){ |
|
|
|
this.getAllBuildings() |
|
|
|
this.getAllBuildings() |
|
|
|
this.planTemplateData[0].attribute[0].attinf[0].value=this.unitData.usci |
|
|
|
console.log(this.planTemplateData) |
|
|
|
this.planTemplateData[0].attribute[0].attinf[1].value=this.unitData.buildingTypes[0].name |
|
|
|
this.planTemplateData[1].attribute[0].attinf[0].value=this.unitData.usci |
|
|
|
this.planTemplateData[0].attribute[0].attinf[2].value=this.unitData.contacts |
|
|
|
this.planTemplateData[1].attribute[0].attinf[1].value=this.unitData.buildingTypes[0].name |
|
|
|
this.planTemplateData[0].attribute[0].attinf[3].value=this.unitData.phone |
|
|
|
this.planTemplateData[1].attribute[0].attinf[2].value=this.unitData.contacts |
|
|
|
this.planTemplateData[0].attribute[0].attinf[4].value=this.unitData.organizationName |
|
|
|
this.planTemplateData[1].attribute[0].attinf[3].value=this.unitData.phone |
|
|
|
this.planTemplateData[0].attribute[0].attinf[5].value=this.unitData.address |
|
|
|
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 == '单位概况') { |
|
|
|
} /* else if (this.selectedItem == '单位概况') { |
|
|
|
//this.getAllBuildings()
|
|
|
|
//this.getAllBuildings()
|
|
|
|
} */ else if (this.selectedItem == '预案附件') { |
|
|
|
} */ else if (this.selectedItem == '预案附件') { |
|
|
@ -302,16 +303,23 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.allBuildings = data |
|
|
|
this.allBuildings = data |
|
|
|
if(this.planTemplateData[0].building==undefined){ |
|
|
|
if(this.planTemplateData[1].building==undefined){ |
|
|
|
this.planTemplateData[0].building=[] |
|
|
|
this.planTemplateData[1].building=[] |
|
|
|
} |
|
|
|
|
|
|
|
for(var i=0;i<this.allBuildings.length;i++){ |
|
|
|
for(var i=0;i<this.allBuildings.length;i++){ |
|
|
|
this.planTemplateData[0].building.push({name:this.allBuildings[i].name,body:this.planTemplateData[0].attribute}) |
|
|
|
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}) |
|
|
|
} |
|
|
|
} |
|
|
|
this.buildingName=this.planTemplateData[0].building[this.clicki].name |
|
|
|
|
|
|
|
this.group=this.planTemplateData[0].building[this.clicki].body |
|
|
|
} |
|
|
|
//delete this.planTemplateData[0].attribute
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
|
|
|
//this.buildingName=this.planTemplateData[1].building[0].name
|
|
|
|
|
|
|
|
this.group=this.planTemplateData[1].building |
|
|
|
|
|
|
|
//delete this.planTemplateData[0].attribute
|
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
//获取总平面图
|
|
|
|
//获取总平面图
|
|
|
@ -405,47 +413,48 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
clickBuilding(item,i){ |
|
|
|
clickBuilding(item,i){ |
|
|
|
this.buildingName=item.name |
|
|
|
this.buildingName=item.name |
|
|
|
this.clicki=i |
|
|
|
this.clicki=i |
|
|
|
this.group=this.planTemplateData[0].building[this.clicki].body |
|
|
|
console.log(item,this.clicki) |
|
|
|
|
|
|
|
//this.group=this.planTemplateData[1].building[this.clicki].body
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
//单位概况增加一行
|
|
|
|
//单位概况增加一行
|
|
|
|
unitadd(surveyName, attacki) { |
|
|
|
unitadd(surveyName, attacki,i) { |
|
|
|
this.addNumber++ |
|
|
|
this.addNumber++ |
|
|
|
if (surveyName == '进攻通道') { |
|
|
|
if (surveyName == '进攻通道') { |
|
|
|
if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr == undefined) { |
|
|
|
if (this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr == undefined) { |
|
|
|
this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr = [] |
|
|
|
this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr = [] |
|
|
|
} |
|
|
|
} |
|
|
|
this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr.push({ tabletd: [] }) |
|
|
|
this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr.push({ tabletd: [] }) |
|
|
|
for (var j = 0; j < this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tableth.length; j++) { |
|
|
|
for (var j = 0; j < this.planTemplateData[1].building[attacki].body[4].attinf[i].tableth.length; j++) { |
|
|
|
if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr != undefined) { |
|
|
|
if (this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr != undefined) { |
|
|
|
this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr[this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr.length - 1].tabletd.push('') |
|
|
|
this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr[this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr.length - 1].tabletd.push('') |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
|
this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr[this.addNumber].tabletd.push('') |
|
|
|
this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr[this.addNumber].tabletd.push('') |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// console.log(this.planTemplateData)
|
|
|
|
// console.log(this.planTemplateData)
|
|
|
|
} |
|
|
|
} |
|
|
|
else if(surveyName=='功能分区'){ |
|
|
|
else if(surveyName=='功能分区'){ |
|
|
|
console.log(this.clicki) |
|
|
|
console.log(attacki) |
|
|
|
this.planTemplateData[0].building[this.clicki].body[6].attinf.push({name:'',value:''}) |
|
|
|
this.planTemplateData[1].building[attacki].body[6].attinf.push({name:'',value:''}) |
|
|
|
}else if(surveyName=='重点部位'){ |
|
|
|
}else if(surveyName=='重点部位'){ |
|
|
|
this.planTemplateData[0].building[this.clicki].body[5].attinf.push({heafName:'',body:[{name:'重点部位名称',value:''},{name:'重点部位所在位置',value:''},{name:'建筑结构',value:''},{name:'使用性质',value:''},{name:'主要危险性',value:''}]}) |
|
|
|
this.planTemplateData[1].building[attacki].body[5].attinf.push({heafName:'',body:[{name:'重点部位名称',value:''},{name:'重点部位所在位置',value:''},{name:'建筑结构',value:''},{name:'使用性质',value:''},{name:'主要危险性',value:''}]}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//单位概况删除一行
|
|
|
|
//单位概况删除一行
|
|
|
|
unitDel(surveyName, attacki) { |
|
|
|
unitDel(surveyName, attacki,i) { |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.duration = 3000 |
|
|
|
config.duration = 3000 |
|
|
|
let isTrue = confirm('您确定要删除该条信息吗') |
|
|
|
let isTrue = confirm('您确定要删除该条信息吗') |
|
|
|
if(surveyName=='进攻通道'){ |
|
|
|
if(surveyName=='进攻通道'){ |
|
|
|
if(isTrue){ |
|
|
|
if(isTrue){ |
|
|
|
if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr != undefined) { |
|
|
|
if (this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr != undefined) { |
|
|
|
this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr.splice(this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr.length - 1, 1) |
|
|
|
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-- |
|
|
|
this.addNumber-- |
|
|
|
if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr.length == 0) { |
|
|
|
if (this.planTemplateData[1].building[attacki].body[4].attinf[i].tabletr.length == 0) { |
|
|
|
this.addNumber = -1 |
|
|
|
this.addNumber = -1 |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -454,11 +463,11 @@ export class CreatePlanOnlineFiveComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
}else if(surveyName=='功能分区'){ |
|
|
|
}else if(surveyName=='功能分区'){ |
|
|
|
if(isTrue){ |
|
|
|
if(isTrue){ |
|
|
|
this.planTemplateData[0].building[this.clicki].body[6].attinf.splice(attacki,1) |
|
|
|
this.planTemplateData[1].building[attacki].body[6].attinf.splice(i,1) |
|
|
|
} |
|
|
|
} |
|
|
|
}else if(surveyName=='重点部位'){ |
|
|
|
}else if(surveyName=='重点部位'){ |
|
|
|
if(isTrue){ |
|
|
|
if(isTrue){ |
|
|
|
this.planTemplateData[0].building[this.clicki].body[5].attinf.splice(attacki,1) |
|
|
|
this.planTemplateData[1].building[attacki].body[5].attinf.splice(i,1) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|