|
|
@ -1077,24 +1077,21 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
//计算 可视区域内宽度, 是否缩放背景图
|
|
|
|
//计算 可视区域内宽度, 是否缩放背景图
|
|
|
|
backGroundScale () { |
|
|
|
backGroundScale () { |
|
|
|
let that = this |
|
|
|
let that = this |
|
|
|
let dad = document.querySelector('.functionalDomainContent').clientWidth |
|
|
|
let dadWidth = document.querySelector('.canvas').clientWidth |
|
|
|
let dadHeight = document.querySelector('.functionalDomainContent').clientHeight |
|
|
|
let dadHeight = document.querySelector('.canvas').clientHeight |
|
|
|
let left = document.querySelector('.functionalDomainLeft').clientWidth |
|
|
|
|
|
|
|
let right = document.querySelector('.functionalDomainRight').clientWidth |
|
|
|
|
|
|
|
let imgWidth = dad - left - right//可视区域内 宽度
|
|
|
|
|
|
|
|
let img = new Image() |
|
|
|
let img = new Image() |
|
|
|
img.src = this.selectingSitePlan.imageUrl; |
|
|
|
img.src = this.selectingSitePlan.imageUrl; |
|
|
|
img.onload = function(){ |
|
|
|
img.onload = function(){ |
|
|
|
if (img.height > dadHeight && img.width > imgWidth) { |
|
|
|
if (img.height > dadHeight && img.width > dadWidth) { |
|
|
|
let width = imgWidth/img.width |
|
|
|
let width = dadWidth/img.width |
|
|
|
let height = dadHeight/img.height |
|
|
|
let height = dadHeight/img.height |
|
|
|
that.canvas.setBackgroundScale((width>height? height : width)-0.005) |
|
|
|
that.canvas.setBackgroundScale((width>height? height : width)-0.005) |
|
|
|
return |
|
|
|
return |
|
|
|
} else if (img.height > dadHeight) { |
|
|
|
} else if (img.height > dadHeight) { |
|
|
|
that.canvas.setBackgroundScale((dadHeight/img.height)-0.005) |
|
|
|
that.canvas.setBackgroundScale((dadHeight/img.height)-0.005) |
|
|
|
return |
|
|
|
return |
|
|
|
} else if (img.width > imgWidth) { |
|
|
|
} else if (img.width > dadWidth) { |
|
|
|
that.canvas.setBackgroundScale((imgWidth/img.width)-0.005) |
|
|
|
that.canvas.setBackgroundScale((dadWidth/img.width)-0.005) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
@ -1674,6 +1671,7 @@ export class CollectionToolsComponent implements OnInit { |
|
|
|
let params = {componentId: sessionStorage.getItem('planId')} |
|
|
|
let params = {componentId: sessionStorage.getItem('planId')} |
|
|
|
this.http.get('/api/Disasters',{params:params}).subscribe((data:any)=>{ |
|
|
|
this.http.get('/api/Disasters',{params:params}).subscribe((data:any)=>{ |
|
|
|
this.allFirePlan = data |
|
|
|
this.allFirePlan = data |
|
|
|
|
|
|
|
this.getDisposalNode() |
|
|
|
if (!data.length) { |
|
|
|
if (!data.length) { |
|
|
|
let msg = { |
|
|
|
let msg = { |
|
|
|
name: '灾情', |
|
|
|
name: '灾情', |
|
|
|