From c2f832b451003a3f12ca8ea31f0a966eea4a5e7f Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Mon, 22 Mar 2021 15:05:33 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=AE=8C=E5=96=84=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fire-force/fire-force.component.ts | 61 +++++++++++++++++-- .../linkage-forces.component.ts | 8 ++- .../water-collection.component.ts | 13 +++- 3 files changed, 74 insertions(+), 8 deletions(-) diff --git a/src/app/data-collection/fire-force/fire-force.component.ts b/src/app/data-collection/fire-force/fire-force.component.ts index 7df5cb5..6a6b9a2 100644 --- a/src/app/data-collection/fire-force/fire-force.component.ts +++ b/src/app/data-collection/fire-force/fire-force.component.ts @@ -115,7 +115,7 @@ export class FireForceComponent implements OnInit { context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2)); context.marker.setContent(div) }; - var _renderMarker = (context)=> { + var _renderMarker = (context)=>{ var content = ``; var offset = new AMap.Pixel(-15, -15); context.marker.setContent(content) @@ -126,9 +126,62 @@ export class FireForceComponent implements OnInit { renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 renderMarker: _renderMarker, // 自定义非聚合点样式 }); - this.cluster.on('click',(e)=>{ + this.cluster.on('click',(e)=>{ if(e.clusterData.length == 1){ - + let node = e.clusterData[0].data + // console.log(node) + this.clearData() + this.selectedFireForce = node.fireForceDetailInfo + this.selectedFireForceId = node.fireForceDetailId + if(node.forceType != 0){//如果是其他消防力量 + this.selectedFireForceLevel = 4 + }else{ + this.selectedFireForceLevel = node.level + } + this.FireForceDetailInfo.stationName = node.fireForceDetailInfo.name + + if(node.fireForceDetailId){ + let type + if(node.forceType == 0){ + type = 0 + }else{ + type = 1 + } + this.isMasklayer = true + this.http.get(`/api/FireForceDetail/${type}/${node.id}`).subscribe((data:any) => { + this.isMasklayer = false + this.FireForceDetailInfo = data + if(data.location && data.location.x){//如果已经标注单位坐标 + this.positionLngLat = data.location + } + //相关资料 + data.relevantInfomationData ? this.AttachmentArr = JSON.parse(data.relevantInfomationData) : null + + if(node.forceType == 0 && node.level == 0){ + this.ZongpersonCountData = JSON.parse(data.personCountData) + this.ZongcontactData = JSON.parse(data.contactData) + } + if(node.forceType == 0 && node.level == 1){ + this.ZongpersonCountData = JSON.parse(data.personCountData) + this.ZhicontactData = JSON.parse(data.contactData) + } + if(node.forceType == 0 && (node.level == 2 || node.level == 3)){ + this.DaZhongpersonCountData = JSON.parse(data.personCountData) + this.DaZhongcontactData = JSON.parse(data.contactData) + } + if(node.forceType != 0){ + this.otherpersonCountData = JSON.parse(data.personCountData) + this.othercontactData = JSON.parse(data.contactData) + } + }) + } + //寻找管辖单位 + this.allFireForceList.forEach(item => { + if(item.id == node.parentId){ + this.superior.name = item.name + this.superior.code = item.code + } + }) } }) }); @@ -230,7 +283,7 @@ export class FireForceComponent implements OnInit { code:'' } selectTreeNode(node){ - console.log(node) + // console.log(node) this.isGisTopBox = false if(this.selectedFireForceId != node.id){ this.clearData() diff --git a/src/app/data-collection/linkage-forces/linkage-forces.component.ts b/src/app/data-collection/linkage-forces/linkage-forces.component.ts index 84647be..3ceabef 100644 --- a/src/app/data-collection/linkage-forces/linkage-forces.component.ts +++ b/src/app/data-collection/linkage-forces/linkage-forces.component.ts @@ -159,7 +159,11 @@ export class LinkageForcesComponent implements OnInit { }); this.cluster.on('click',(e)=>{ if(e.clusterData.length == 1){ - + let item = e.clusterData[0].data + this.clearData() + this.LinkageForceDetailInfo = item + item.location?this.positionLngLat = item.location:null + this.AttachmentArr = JSON.parse(item.relevantInfomationData) } }) }); @@ -225,7 +229,7 @@ export class LinkageForcesComponent implements OnInit { //选择要显示的联动力量 selectedLinkageForce(item){ - console.log(123,item) + // console.log(123,item) this.isGisTopBox = false if(this.LinkageForceDetailInfo.id != item.id){ this.clearData() diff --git a/src/app/data-collection/water-collection/water-collection.component.ts b/src/app/data-collection/water-collection/water-collection.component.ts index 29e3e8b..901b5e9 100644 --- a/src/app/data-collection/water-collection/water-collection.component.ts +++ b/src/app/data-collection/water-collection/water-collection.component.ts @@ -116,7 +116,16 @@ export class WaterCollectionComponent implements OnInit { }); this.cluster.on('click',(e)=>{ if(e.clusterData.length == 1){ - + let item = e.clusterData[0].data + console.log(item) + this.selectedLiIndex = null + this.clearData() + this.selectedWaterTypeIndex = item.waterSourceType//点击的水源类型 + this.waterData = item + item.waterSourceType == 0 && item.detailData ? this.fireCockData = JSON.parse(item.detailData) : null + item.waterSourceType == 1 && item.detailData ? this.poolData = JSON.parse(item.detailData) : null + item.waterSourceType == 2 && item.detailData ? this.naturalWaterData = JSON.parse(item.detailData) : null + this.positionLngLat = item.location } }) }); @@ -198,7 +207,6 @@ export class WaterCollectionComponent implements OnInit { //点击水源列表 selectedLiIndex:any clickWaterLi(item,index){ - console.log(item) if(this.selectedLiIndex != index){ this.selectedLiIndex = index this.clearData() @@ -212,6 +220,7 @@ export class WaterCollectionComponent implements OnInit { this.map.remove(this.newPositionMarker); } if(item.location.x){//如果已经标注单位坐标 + // console.log(item) this.map.setCenter([item.location.x,item.location.y]); this.newPositionMarker = new AMap.Marker({ position: [item.location.x,item.location.y],