|
|
|
@ -78,11 +78,32 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
this.getAllBuildings() |
|
|
|
|
this.getSitePlan() |
|
|
|
|
this.getRealPicture() |
|
|
|
|
}else if(this.selectedItem == '单位概况'){ |
|
|
|
|
} else if (this.selectedItem == '单位概况') { |
|
|
|
|
//this.getAllBuildings()
|
|
|
|
|
} else if (this.selectedItem == '预案附件') { |
|
|
|
|
this.getTwoDPlanList() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获取当前单位的二维预案
|
|
|
|
|
TwoDPlanList: any |
|
|
|
|
getTwoDPlanList() { |
|
|
|
|
let paramsData = { |
|
|
|
|
companyId: this.route.snapshot.queryParams.companyId, |
|
|
|
|
pageSize: "999" |
|
|
|
|
} |
|
|
|
|
this.http.get("/api/PlanComponents", { params: paramsData }).subscribe((data: any) => { |
|
|
|
|
this.TwoDPlanList = data.items.filter((item) => { |
|
|
|
|
return item.planType == 1 |
|
|
|
|
}) |
|
|
|
|
console.log(this.TwoDPlanList) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取实景图
|
|
|
|
|
allRealPicture |
|
|
|
|
getRealPicture() { |
|
|
|
@ -125,10 +146,11 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
planTemplateData: any |
|
|
|
|
//获得模板信息
|
|
|
|
|
getTemplateData() { |
|
|
|
|
this.http.get('/api/PlanTemplate').subscribe(data => { |
|
|
|
|
this.planTemplateData = JSON.parse(data[2].data).filter(item => |
|
|
|
|
item.completed == true |
|
|
|
|
) |
|
|
|
|
this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe(data => { |
|
|
|
|
console.log('预案内容',data) |
|
|
|
|
// this.planTemplateData = JSON.parse(data.webdata).filter(item =>
|
|
|
|
|
// item.completed == true
|
|
|
|
|
// )
|
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
this.planTemplateData.forEach(element => { |
|
|
|
|
if (element.groupName == '重点图示') { |
|
|
|
@ -141,6 +163,11 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
element.attribute = [{ name: '', imgArr: [] }] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (element.groupName == '预案附件') { |
|
|
|
|
if (!element.attribute) { |
|
|
|
|
element.attribute = [{ name: '', imgArr: [] }] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (element.groupName == '处置要点') { |
|
|
|
|
if (!element.attribute) { |
|
|
|
|
element.attribute = [{ name: '', content: '' }] |
|
|
|
@ -153,6 +180,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -166,7 +194,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
//通过左侧查看实景图
|
|
|
|
|
gallery |
|
|
|
|
lookkeyImgItemLeft(key1, key2,i) { |
|
|
|
|
lookkeyImgItemLeft(key1, key2, i) { |
|
|
|
|
let dom = document.getElementById(`viewerjs`) |
|
|
|
|
let pObjs = dom.childNodes; |
|
|
|
|
let node = document.createElement("img") |
|
|
|
@ -243,12 +271,12 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.allBuildings = data |
|
|
|
|
this.planTemplateData[0].building=[] |
|
|
|
|
for(var i=0;i<this.allBuildings.length;i++){ |
|
|
|
|
this.planTemplateData[0].building.push({name:this.allBuildings[i].name,body:this.planTemplateData[0].attribute}) |
|
|
|
|
this.planTemplateData[0].building = [] |
|
|
|
|
for (var i = 0; i < this.allBuildings.length; i++) { |
|
|
|
|
this.planTemplateData[0].building.push({ name: this.allBuildings[i].name, body: this.planTemplateData[0].attribute }) |
|
|
|
|
} |
|
|
|
|
this.buildingName=this.allBuildings[0].name |
|
|
|
|
this.group=this.planTemplateData[0].building[this.clicki].body |
|
|
|
|
this.buildingName = this.allBuildings[0].name |
|
|
|
|
this.group = this.planTemplateData[0].building[this.clicki].body |
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -261,11 +289,20 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//打开采集工具
|
|
|
|
|
openPlan(item, index,type?:string) { |
|
|
|
|
openPlan(item, index, type?: string) { |
|
|
|
|
sessionStorage.setItem("gisplan", 'look') |
|
|
|
|
sessionStorage.setItem("companyId", this.unitId) |
|
|
|
|
// console.log(item)
|
|
|
|
|
let data = { select: item, key: index, allBuildings: this.allBuildings,type: type} |
|
|
|
|
console.log(item) |
|
|
|
|
if(type == '预案'){ |
|
|
|
|
sessionStorage.setItem("planId", item.id) |
|
|
|
|
sessionStorage.setItem("companyId", this.route.snapshot.queryParams.companyId) |
|
|
|
|
sessionStorage.setItem("buildingTypeId",this.route.snapshot.queryParams.unitTypeId) |
|
|
|
|
sessionStorage.setItem("editable", "0") |
|
|
|
|
sessionStorage.setItem("planName", item.name) |
|
|
|
|
sessionStorage.setItem("orName", item.name) |
|
|
|
|
sessionStorage.setItem("orId", item.name) |
|
|
|
|
} |
|
|
|
|
let data = { select: item, key: index, allBuildings: this.allBuildings, type: type } |
|
|
|
|
let width = Math.round(document.body.clientWidth * 0.8) + 'px' |
|
|
|
|
let height = Math.round(document.body.clientHeight * 0.9) + 'px' |
|
|
|
|
// console.log('宽度',width)
|
|
|
|
@ -329,18 +366,18 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
//单位概况左侧建筑点击事件
|
|
|
|
|
buildingName |
|
|
|
|
clicki=0 |
|
|
|
|
clicki = 0 |
|
|
|
|
group |
|
|
|
|
clickBuilding(item,i){ |
|
|
|
|
this.buildingName=item.name |
|
|
|
|
this.clicki=i |
|
|
|
|
this.group=this.planTemplateData[0].building[this.clicki].body |
|
|
|
|
clickBuilding(item, i) { |
|
|
|
|
this.buildingName = item.name |
|
|
|
|
this.clicki = i |
|
|
|
|
this.group = this.planTemplateData[0].building[this.clicki].body |
|
|
|
|
//console.log(this.group)
|
|
|
|
|
} |
|
|
|
|
//单位概况增加一行
|
|
|
|
|
unitadd(surveyName,attacki){ |
|
|
|
|
unitadd(surveyName, attacki) { |
|
|
|
|
this.addNumber++ |
|
|
|
|
if(surveyName=='进攻通道'){ |
|
|
|
|
if (surveyName == '进攻通道') { |
|
|
|
|
if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr == undefined) { |
|
|
|
|
this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr = [] |
|
|
|
|
} |
|
|
|
@ -353,16 +390,16 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
|
|
|
|
|
this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr[this.addNumber].tabletd.push('') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(this.planTemplateData) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//单位概况删除一行
|
|
|
|
|
unitDel(surveyName,attacki){ |
|
|
|
|
unitDel(surveyName, attacki) { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
if(surveyName=='进攻通道'){ |
|
|
|
|
if (surveyName == '进攻通道') { |
|
|
|
|
if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].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.addNumber-- |
|
|
|
@ -434,13 +471,13 @@ export class OpenPlanToolDialog {
|
|
|
|
|
|
|
|
|
|
@ViewChild('plan') plan: any //子组件
|
|
|
|
|
|
|
|
|
|
type:any//打开的类型 是平面图还是水源
|
|
|
|
|
type: any//打开的类型 是平面图还是水源
|
|
|
|
|
ngOnInit() { |
|
|
|
|
this.type = this.data.type |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngAfterViewInit(): void { |
|
|
|
|
if(this.type != '水源'){ |
|
|
|
|
if (this.type != '水源' && this.type != '预案') { |
|
|
|
|
this.noticePlan() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|