diff --git a/src/app/ui/collection-tools/collection-tools.component.scss b/src/app/ui/collection-tools/collection-tools.component.scss index 04144b9..7c8c861 100644 --- a/src/app/ui/collection-tools/collection-tools.component.scss +++ b/src/app/ui/collection-tools/collection-tools.component.scss @@ -98,7 +98,7 @@ } .functionalDomainRight { border: 1px solid #464646; - width: 12%; + width: 230px; right: 0; } //左侧导航栏显示隐藏 diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index 5b8bdf6..2adc441 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -894,13 +894,26 @@ export class CollectionToolsComponent implements OnInit { this.canvas.setIconVisible(iconVisibleArr,!node.isLook) } + //计算 可视区域内宽度, 是否缩放背景图 + backGroundScale () { + let that = this + let dad = document.querySelector('.functionalDomainContent').clientWidth + let imgWidth = dad - 460 //可是区域内 宽度 + let img = new Image() + img.src = this.selectingSitePlan.imageUrl; + img.onload = function(){ + img.width > imgWidth? that.canvas.setBackgroundScale(imgWidth/img.width) : null + }; + } + //封装 刷新 tree 数据 renovateTreeData (isRefresh:boolean = true) { + this.allFireElements[this.allFireElements.length-1].children = [] isRefresh? this.canvas.refresh() : null isRefresh? this.canvasData.isChange = false : null //服务中 数据是否改动 改为false isRefresh? this.isShowProperty = true : null isRefresh? this.isShowAttribute = true : null - this.allFireElements[this.allFireElements.length-1].children = [] + this.selectingSitePlan.imageUrl? this.backGroundScale() : null let beforeOneId = this.selectingSitePlan.id || '' //当前 选中 平面图 楼层/区域 id let companyBuildingData = JSON.parse(JSON.stringify( this.canvasData.originalcompanyBuildingData || {} )) // 当前 单位/建筑 数据 @@ -1320,6 +1333,7 @@ export class CollectionToolsComponent implements OnInit { let isSuccess = this.renovateSitePlan() isSuccess.then(res=>{ this.canvas.refreshBackgroundImage() + this.backGroundScale() }) const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; @@ -1331,6 +1345,7 @@ export class CollectionToolsComponent implements OnInit { let isSuccess = this.renovateBuilding() isSuccess.then(res=>{ this.canvas.refreshBackgroundImage() + this.backGroundScale() }) const config = new MatSnackBarConfig(); config.verticalPosition = 'top';