Browse Source

[完善]完善优化问题

zhuzhou
邵佳豪 4 years ago
parent
commit
c2f832b451
  1. 61
      src/app/data-collection/fire-force/fire-force.component.ts
  2. 8
      src/app/data-collection/linkage-forces/linkage-forces.component.ts
  3. 13
      src/app/data-collection/water-collection/water-collection.component.ts

61
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 = `<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()

8
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()

13
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],

Loading…
Cancel
Save