|
|
|
@ -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 = `<img class='clusterImgCollection' src="${context.data[0].image}" alt="">`; |
|
|
|
|
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() |
|
|
|
|