|
|
|
@ -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'; |
|
|
|
|