Browse Source

[完善]1.修复粘贴素材后消防设施不刷新问题 2.修复切换楼层后素材名称状态不维持状态问题

develop
邵佳豪 4 years ago
parent
commit
466021347c
  1. 4
      src/app/ui/collection-tools/collection-tools.component.html
  2. 47
      src/app/ui/collection-tools/collection-tools.component.ts

4
src/app/ui/collection-tools/collection-tools.component.html

@ -15,9 +15,9 @@
<mat-icon style="padding-bottom: 7px;">screen_share</mat-icon>
</button>
<span title="基本信息名称显示/隐藏" style="margin-right:20px;user-select: none;margin-left: 12px;" class="nameShow" (click)="basicInfoClick()">
<span [ngClass]="{'icongray': !basicInfo}" title="基本信息名称显示/隐藏" style="margin-right:20px;user-select: none;margin-left: 12px;" class="nameShow" (click)="basicInfoClick()">
基本信息名称
<mat-icon [ngClass]="{'icongray': !basicInfo}">visibility</mat-icon>
<mat-icon>visibility</mat-icon>
</span>
<span style="position: absolute;right: 60px;cursor: pointer;">

47
src/app/ui/collection-tools/collection-tools.component.ts

@ -477,6 +477,7 @@ export class CollectionToolsComponent implements OnInit {
this.canvas.paste(companyId,buildingId,floorId)
this.canvasData.isChange = true
this.renovateTreeData(false)
}
basicInfo:boolean = true //基本信息名称显隐
@ -487,11 +488,11 @@ export class CollectionToolsComponent implements OnInit {
this.canvas.setNameVisible(this.basicInfo,0)
}
//点击想定作业名称
wantToWorkClick(){
this.wantToWork = !this.wantToWork
this.canvas.setNameVisible(this.basicInfo,1)
}
// //点击想定作业名称
// wantToWorkClick(){
// this.wantToWork = !this.wantToWork
// this.canvas.setNameVisible(this.basicInfo,1)
// }
isEditPattern:boolean = true //是否为编辑模式
//进入编辑模式
@ -863,7 +864,6 @@ export class CollectionToolsComponent implements OnInit {
//处理 tree 数据结构
handleTreeData (storeyData) {
this.canvas.setNameVisible(this.basicInfo,0)
this.storeyData = storeyData
let data = this.allFireElements //所有消防要素模板
@ -903,6 +903,7 @@ export class CollectionToolsComponent implements OnInit {
if (!element.parentId) { treeData.push(element) }
});
this.dataSource.data = treeData
this.treeControl.expandAll()
}
@ -999,40 +1000,15 @@ export class CollectionToolsComponent implements OnInit {
this.canvas.setIconVisible(iconVisibleArr,!node.isLook)
}
//计算 可视区域内宽度, 是否缩放背景图
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 img = new Image()
// img.src = this.selectingSitePlan.imageUrl;
// img.onload = function(){
// if (img.height > dadHeight && img.width > imgWidth) {
// let width = imgWidth/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)
// return
// }
// };
}
//封装 刷新 tree 数据
renovateTreeData (isRefresh:boolean = true) {
async renovateTreeData (isRefresh:boolean = true) {
this.allFireElements[this.allFireElements.length-1].children = []
isRefresh? this.canvas.refresh() : null
isRefresh? await this.canvas.refresh() : null
isRefresh? this.canvasData.isChange = false : null //服务中 数据是否改动 改为false
isRefresh? this.isShowProperty = true : null
isRefresh? this.isShowAttribute = true : null
this.canvas.setNameVisible(this.basicInfo,0)
let beforeOneId = this.selectingSitePlan.id || '' //当前 选中 平面图 楼层/区域 id
let companyBuildingData = JSON.parse(JSON.stringify( this.canvasData.originalcompanyBuildingData || {} )) // 当前 单位/建筑 数据
let storeyData = JSON.parse(JSON.stringify( this.canvasData.originaleveryStoreyData || {} )) //当前 楼层 数据
@ -1049,6 +1025,7 @@ export class CollectionToolsComponent implements OnInit {
}
}
this.handleTreeData(storeyData) //处理tree数据结构
}
@ -1478,7 +1455,6 @@ export class CollectionToolsComponent implements OnInit {
let isSuccess = this.renovateSitePlan()
isSuccess.then(res=>{
this.canvas.refreshBackgroundImage()
this.backGroundScale()
})
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -1490,7 +1466,6 @@ export class CollectionToolsComponent implements OnInit {
let isSuccess = this.renovateBuilding()
isSuccess.then(res=>{
this.canvas.refreshBackgroundImage()
this.backGroundScale()
})
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';

Loading…
Cancel
Save