|
|
|
@ -639,24 +639,21 @@ export class planComponent implements OnInit {
|
|
|
|
|
//计算 可视区域内宽度, 是否缩放背景图
|
|
|
|
|
backGroundScale () { |
|
|
|
|
let that = this |
|
|
|
|
let dad = document.querySelector('.functionalDomainContent').clientWidth |
|
|
|
|
let dadHeight = document.querySelector('.functionalDomainContent').clientHeight |
|
|
|
|
let left = document.querySelector('.functionalDomainLeft').clientWidth |
|
|
|
|
let right = document.querySelector('.functionalDomainRight').clientWidth |
|
|
|
|
let imgWidth = dad - left - right//可视区域内 宽度
|
|
|
|
|
let dadWidth = document.querySelector('.canvas').clientWidth |
|
|
|
|
let dadHeight = document.querySelector('.canvas').clientHeight |
|
|
|
|
let img = new Image() |
|
|
|
|
img.src = this.selectingSitePlan.imageUrl; |
|
|
|
|
img.onload = function(){ |
|
|
|
|
if (img.height > dadHeight && img.width > imgWidth) { |
|
|
|
|
let width = imgWidth/img.width |
|
|
|
|
if (img.height > dadHeight && img.width > dadWidth) { |
|
|
|
|
let width = dadWidth/img.width |
|
|
|
|
let height = dadHeight/img.height |
|
|
|
|
that.canvas.setBackgroundScale((width>height? height : width)-0.005) |
|
|
|
|
return |
|
|
|
|
} else if (img.height > dadHeight) { |
|
|
|
|
that.canvas.setBackgroundScale((dadHeight/img.height)-0.005) |
|
|
|
|
return |
|
|
|
|
} else if (img.width > imgWidth) { |
|
|
|
|
that.canvas.setBackgroundScale((imgWidth/img.width)-0.005) |
|
|
|
|
} else if (img.width > dadWidth) { |
|
|
|
|
that.canvas.setBackgroundScale((dadWidth/img.width)-0.005) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
@ -695,7 +692,7 @@ export class planComponent implements OnInit {
|
|
|
|
|
//陈鹏飞↓↓↓
|
|
|
|
|
//陈鹏飞↓↓↓
|
|
|
|
|
//陈鹏飞↓↓↓
|
|
|
|
|
params = {companyId: "5e9964caa760a059e84512e9"} |
|
|
|
|
params = {companyId: sessionStorage.getItem('companyId')} |
|
|
|
|
allFireElements:any = []; //当前 单位/建筑 下的消防要素
|
|
|
|
|
|
|
|
|
|
isShowAttribute:boolean = true; //属性栏 是否显示 默认数据
|
|
|
|
|