|
|
|
@ -12,12 +12,10 @@ import Swiper from 'swiper';
|
|
|
|
|
import { saveOneDialog } from './save'; |
|
|
|
|
import { NzFormatBeforeDropEvent, NzFormatEmitEvent,NzTreeComponent } from 'ng-zorro-antd/tree'; |
|
|
|
|
import { Observable, of } from 'rxjs'; |
|
|
|
|
import { delay } from 'rxjs/operators'; |
|
|
|
|
import { windows } from 'src/app/interface'; |
|
|
|
|
import { GameMode } from 'src/app/working-area/model/gameMode'; |
|
|
|
|
import { ActivatedRoute, Router } from '@angular/router'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { MaskLayerService } from 'src/app/mask-layer.service'; |
|
|
|
|
import * as ObjectID from 'bson-objectid'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-collection-tools', |
|
|
|
@ -28,7 +26,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
@ViewChild('canvas',{static: true}) canvas:WorkingAreaComponent; //父组件中获得子组件的引用
|
|
|
|
|
|
|
|
|
|
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService,private router:Router,private route:ActivatedRoute) { } |
|
|
|
|
constructor(private maskLayerService:MaskLayerService,private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private element: ElementRef,public canvasData: CanvasShareDataService,private router:Router,private route:ActivatedRoute) { } |
|
|
|
|
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; |
|
|
|
|
// tree配置
|
|
|
|
|
private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数
|
|
|
|
@ -150,9 +148,6 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
pattern:boolean = true//默认为基本信息编辑
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yyy(){ |
|
|
|
|
console.log(this.canvasData.selectPanelPoint) |
|
|
|
|
} |
|
|
|
|
//基本信息编辑模式
|
|
|
|
|
baseInfo(){ |
|
|
|
|
if (!this.pattern) { |
|
|
|
@ -230,14 +225,13 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
targetNodeData.forEach(i => { |
|
|
|
|
idArr.push(i.id) |
|
|
|
|
}) |
|
|
|
|
console.log(6666666666666,event); |
|
|
|
|
if(this.pos == 0 && event.node.origin.children.length == 1){ |
|
|
|
|
console.log("移入,没有兄弟") |
|
|
|
|
// console.log("移入,没有兄弟")
|
|
|
|
|
let key = event.dragNode.key |
|
|
|
|
orders[key] = 0 |
|
|
|
|
parentId = event.node.key |
|
|
|
|
}else{ |
|
|
|
|
console.log("移入,多个兄弟") |
|
|
|
|
// console.log("移入,多个兄弟")
|
|
|
|
|
let array = [] |
|
|
|
|
targetNodeData.forEach(item => { |
|
|
|
|
if(item.id != event.dragNode.key){ //将拖动项先移除掉
|
|
|
|
@ -245,13 +239,13 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
if(event.dragNode.isEnd[event.dragNode.isEnd.length - 1]){ //如果移入到最后一个
|
|
|
|
|
console.log("最后") |
|
|
|
|
// console.log("最后")
|
|
|
|
|
array.push(event.dragNode.origin) |
|
|
|
|
}else if(event.dragNode.isStart[event.dragNode.isStart.length - 1]){//如果移入到第一个
|
|
|
|
|
console.log("第一") |
|
|
|
|
// console.log("第一")
|
|
|
|
|
array.unshift(event.dragNode.origin) |
|
|
|
|
}else{//如果移入中间位置
|
|
|
|
|
console.log("中间") |
|
|
|
|
// console.log("中间")
|
|
|
|
|
array.splice(event.node.origin.order, 0, event.dragNode.origin) |
|
|
|
|
} |
|
|
|
|
array.forEach((item,key) => { |
|
|
|
@ -274,7 +268,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isDrag //是否可以拖动
|
|
|
|
|
pos//放置位置
|
|
|
|
|
beforeDrop = (arg: NzFormatBeforeDropEvent) => { |
|
|
|
@ -683,15 +677,11 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.canvas.on("deselect",obj=>{ |
|
|
|
|
this.isShowProperty = false |
|
|
|
|
}) |
|
|
|
|
// 监听canvas组件新增素材事件
|
|
|
|
|
this.canvas.on("createIcon",obj=>{ |
|
|
|
|
//监听数据变化后
|
|
|
|
|
this.canvas.on('canvasDataChanged',()=>{ |
|
|
|
|
// 收到数据表示共享数据发生变化
|
|
|
|
|
this.renovateTreeData(false) |
|
|
|
|
}) |
|
|
|
|
// 监听canvas组件删除素材事件
|
|
|
|
|
this.canvas.on("deleteIcon",obj=>{ |
|
|
|
|
this.renovateTreeData(false) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
copyAssetData:any //存储用于复制的素材
|
|
|
|
@ -705,6 +695,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
let buildingId = this.beforeOneCheckedBuilding.id |
|
|
|
|
let floorId = this.selectingSitePlan.id |
|
|
|
|
this.canvas.paste(companyId,buildingId,floorId) |
|
|
|
|
this.renovateTreeData(false) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
basicInfo:boolean = true //基本信息名称显隐
|
|
|
|
@ -743,6 +734,9 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
//保存平面图
|
|
|
|
|
saveNum :any = [] |
|
|
|
|
saveSite(){ |
|
|
|
|
//更新用于统计的数据
|
|
|
|
|
this.canvasData.updateBuildingData() |
|
|
|
|
|
|
|
|
|
if (this.selectingSitePlan && this.selectingSitePlan.id) { |
|
|
|
|
this.saveNum = [] |
|
|
|
|
let SitePlanData = JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData)); |
|
|
|
@ -754,8 +748,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
let adjoinArr = [] //毗邻数组
|
|
|
|
|
|
|
|
|
|
if(this.pattern){//如果是基本信息编辑模式
|
|
|
|
|
//更新用于统计的数据
|
|
|
|
|
this.canvasData.updateBuildingData() |
|
|
|
|
this.maskLayerService.sendMessage(true) |
|
|
|
|
for (const key in object) { |
|
|
|
|
if (object[key].Name == "毗邻") {//如果是相同楼层,则筛选出毗邻
|
|
|
|
|
|
|
|
|
@ -772,6 +765,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存失败,毗邻存在相同方向','确定',config); |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
return false |
|
|
|
|
}else{ |
|
|
|
|
//如果是单位 总平面图
|
|
|
|
@ -784,6 +778,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -791,6 +786,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
@ -806,6 +802,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -813,6 +810,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
@ -829,6 +827,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -836,11 +835,16 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('单位毗邻保存失败','确定',config); |
|
|
|
|
if(err == 'infos 有重复方向!'){ |
|
|
|
|
this.snackBar.open('单位毗邻同步失败,存在相同方向','确定',config); |
|
|
|
|
}else{ |
|
|
|
|
this.snackBar.open('单位毗邻同步失败','确定',config); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//批量保存单位重点部位
|
|
|
|
@ -852,6 +856,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -859,11 +864,12 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('单位重点部位保存失败','确定',config); |
|
|
|
|
this.snackBar.open('单位重点部位同步失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//批量保存单位消防设施素材
|
|
|
|
@ -875,6 +881,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -882,11 +889,12 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('单位消防设施素材保存失败','确定',config); |
|
|
|
|
this.snackBar.open('单位消防设施素材同步失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}else{ //如果是建筑
|
|
|
|
@ -899,6 +907,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -906,6 +915,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
@ -921,6 +931,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -928,6 +939,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
@ -940,6 +952,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.post(`/api/BuildingAdjoins/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingAdjoins).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -947,11 +960,16 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('建筑毗邻保存失败','确定',config); |
|
|
|
|
if(err == 'infos 有重复方向!'){ |
|
|
|
|
this.snackBar.open('建筑毗邻同步失败,存在相同方向','确定',config); |
|
|
|
|
}else{ |
|
|
|
|
this.snackBar.open('建筑毗邻同步失败','确定',config); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//批量保存建筑重点部位
|
|
|
|
@ -959,6 +977,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.post(`/api/BuildingImportantLocations/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingImportantLocations).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -966,11 +985,12 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('建筑重点部位保存失败','确定',config); |
|
|
|
|
this.snackBar.open('建筑重点部位同步失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
//批量保存建筑消防设施素材
|
|
|
|
@ -978,6 +998,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.post(`/api/BuildingFacilityAssets/Batch?companyId=${this.params.companyId}&buildingId=${this.canvasData.selectStorey.buildingId}`,buildingFacilityAssets).subscribe(data => { |
|
|
|
|
this.saveNum.push("1") |
|
|
|
|
if(this.saveNum.length == 5){ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
this.canvasData.isChange = false |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
@ -985,11 +1006,12 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
} |
|
|
|
|
},err=>{ |
|
|
|
|
this.maskLayerService.sendMessage(false) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.canvasData.isChange = true |
|
|
|
|
this.snackBar.open('建筑消防设施素材保存失败','确定',config); |
|
|
|
|
this.snackBar.open('建筑消防设施素材同步失败','确定',config); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -1005,7 +1027,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
dialogRef.afterClosed().subscribe(result => { |
|
|
|
|
console.log('The dialog was closed'); |
|
|
|
|
// console.log('The dialog was closed');
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1030,10 +1052,10 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//拖拽tree
|
|
|
|
|
drop(e){ |
|
|
|
|
console.log(1111,e) |
|
|
|
|
// console.log(1111,e)
|
|
|
|
|
} |
|
|
|
|
drop2(e){ |
|
|
|
|
console.log(222,e) |
|
|
|
|
// console.log(222,e)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//创建建筑
|
|
|
|
@ -1156,11 +1178,11 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
storeyData //将建筑素材和当前楼层素材合二为一
|
|
|
|
|
|
|
|
|
|
selectPanelPoint //传过来的处置素材
|
|
|
|
|
//处理 tree 数据结构
|
|
|
|
|
handleTreeData (storeyData) { |
|
|
|
|
|
|
|
|
|
handleTreeData (storeyData,selectPanelPoint) { |
|
|
|
|
this.storeyData = storeyData |
|
|
|
|
this.selectPanelPoint = selectPanelPoint |
|
|
|
|
let data = this.allFireElements //所有消防要素模板
|
|
|
|
|
let treeData = [] //tree型 处理完成后的数据
|
|
|
|
|
data.forEach(element => { |
|
|
|
@ -1192,6 +1214,30 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(selectPanelPoint.Data){ |
|
|
|
|
for(let key in selectPanelPoint.Data.Stock){ |
|
|
|
|
selectPanelPoint.Data.Stock[key].isLookPattern = true |
|
|
|
|
if(element.id == selectPanelPoint.Data.Stock[key].FireElementId){ |
|
|
|
|
selectPanelPoint.Data.Stock[key].isTemplate = false |
|
|
|
|
selectPanelPoint.Data.Stock[key].isLook = true |
|
|
|
|
|
|
|
|
|
element.isNewElement = true //该节点children是否存在新添加的真实素材 标识
|
|
|
|
|
|
|
|
|
|
//定义查看模式下能看到的元素
|
|
|
|
|
element.isLookPattern = true |
|
|
|
|
if(element.parentId){ |
|
|
|
|
data.forEach(i => { |
|
|
|
|
if(i.id == element.parentId){ |
|
|
|
|
i.isLookPattern = true |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
element.children.push(selectPanelPoint.Data.Stock[key]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
data.forEach(item => { if (item.parentId == element.id) {element.children.push(item)} }); |
|
|
|
|
}); |
|
|
|
|
data.forEach(element => { |
|
|
|
@ -1349,7 +1395,16 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.allFireElements[this.allFireElements.length-1].children.push(storeyData.data[key]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.handleTreeData(storeyData) //处理tree数据结构
|
|
|
|
|
let selectPanelPoint = JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint || {} )) //当前 节点 数据
|
|
|
|
|
if(selectPanelPoint.Data){ |
|
|
|
|
for(let key in selectPanelPoint.Data.Stock){ //筛选数据 没有匹配全部放入到 其他 数组
|
|
|
|
|
let noMatch = this.allFireElements.find( every=> every.id===selectPanelPoint.Data.Stock[key].FireElementId ) |
|
|
|
|
if (!noMatch) { |
|
|
|
|
this.allFireElements[this.allFireElements.length-1].children.push(selectPanelPoint.Data.Stock[key]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.handleTreeData(storeyData,selectPanelPoint) //处理tree数据结构
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1456,7 +1511,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.get('/api/CompanyData',{params:this.params}).subscribe((data:any)=>{ |
|
|
|
|
this.canvasData.originalcompanyBuildingData = data || {} // 单位原数据
|
|
|
|
|
this.canvasData.originalcompanyBuildingData.data? this.canvasData.originalcompanyBuildingData.data = JSON.parse(this.canvasData.originalcompanyBuildingData.data) : this.canvasData.originalcompanyBuildingData.data = {} |
|
|
|
|
this.canvasData.originalcompanyBuildingData.version? null : this.canvasData.originalcompanyBuildingData.version = "2.0" |
|
|
|
|
this.canvasData.originalcompanyBuildingData.version = "2.0" |
|
|
|
|
this.canvasData.originalcompanyBuildingData.companyId? null : this.canvasData.originalcompanyBuildingData.companyId = sessionStorage.getItem('companyId') |
|
|
|
|
resolve('success') |
|
|
|
|
}) |
|
|
|
@ -1469,7 +1524,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.get(`/api/SitePlanData`,{params}).subscribe((data:any)=>{ |
|
|
|
|
this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据
|
|
|
|
|
this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} |
|
|
|
|
this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0" |
|
|
|
|
this.canvasData.originaleveryStoreyData.version = "2.0" |
|
|
|
|
this.canvasData.originaleveryStoreyData.sitePlanId? null : this.canvasData.originaleveryStoreyData.sitePlanId = e.id || null |
|
|
|
|
this.renovateTreeData() |
|
|
|
|
}) |
|
|
|
@ -1481,7 +1536,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.get(`/api/BuildingData`,{params:e}).subscribe((data:any)=>{ |
|
|
|
|
this.canvasData.originalcompanyBuildingData = data || {} // 建筑原数据
|
|
|
|
|
this.canvasData.originalcompanyBuildingData.data? this.canvasData.originalcompanyBuildingData.data = JSON.parse(this.canvasData.originalcompanyBuildingData.data) : this.canvasData.originalcompanyBuildingData.data = {} |
|
|
|
|
this.canvasData.originalcompanyBuildingData.version? null : this.canvasData.originalcompanyBuildingData.version = "2.0" |
|
|
|
|
this.canvasData.originalcompanyBuildingData.version = "2.0" |
|
|
|
|
this.canvasData.originalcompanyBuildingData.buildingId? null : this.canvasData.originalcompanyBuildingData.buildingId = e.buildingId |
|
|
|
|
resolve('success') |
|
|
|
|
}) |
|
|
|
@ -1494,7 +1549,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
this.http.get(`/api/BuildingAreaData`,{params}).subscribe((data:any)=>{ |
|
|
|
|
this.canvasData.originaleveryStoreyData = data || {} // 楼层原数据
|
|
|
|
|
this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {} |
|
|
|
|
this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0" |
|
|
|
|
this.canvasData.originaleveryStoreyData.version = "2.0" |
|
|
|
|
this.canvasData.originaleveryStoreyData.buildingAreaId? null : this.canvasData.originaleveryStoreyData.buildingAreaId = e.id || null |
|
|
|
|
this.renovateTreeData() |
|
|
|
|
}) |
|
|
|
@ -1502,7 +1557,6 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//点击选中 平面图 楼层/区域 时
|
|
|
|
|
selectSitePlan (item,index) { |
|
|
|
|
|
|
|
|
|
if (this.selectSitePlanIndex != index) { |
|
|
|
|
this.canvasData.selectPanelPoint = new DisposalNodeData(); |
|
|
|
|
if (this.canvasData.isChange) { //true 数据被改动
|
|
|
|
@ -1716,6 +1770,15 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//复制图层 平面图 楼层/区域
|
|
|
|
|
duplicateLayer (item) { |
|
|
|
|
let paramsData = JSON.parse(JSON.stringify( this.canvasData.originaleveryStoreyData.data || {} )) |
|
|
|
|
Object.keys(paramsData).forEach((key)=>{ |
|
|
|
|
if (key != '图例') { |
|
|
|
|
let ID = ObjectID.default.generate() |
|
|
|
|
paramsData[key].Id = ID |
|
|
|
|
paramsData[ID] = paramsData[key] |
|
|
|
|
delete paramsData[key] |
|
|
|
|
} |
|
|
|
|
}) //图标Id重新赋值
|
|
|
|
|
if (this.checkedBuildingIndex==-1) { //总平面图
|
|
|
|
|
item.id = "" |
|
|
|
|
item.modifiedTime = new Date() |
|
|
|
@ -1723,9 +1786,9 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
item.order = this.sitePlanData[this.sitePlanData.length-1].order+1 |
|
|
|
|
this.http.post('/api/SitePlans',item).subscribe((data:any)=>{ |
|
|
|
|
let newData = { |
|
|
|
|
version: this.canvasData.originaleveryStoreyData.version || "2.0", |
|
|
|
|
version: "2.0", |
|
|
|
|
id: "", |
|
|
|
|
data: JSON.stringify( JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData.data)) ) || null, |
|
|
|
|
data: JSON.stringify( paramsData ) || null, |
|
|
|
|
sitePlanId: data.id |
|
|
|
|
} |
|
|
|
|
this.http.post('/api/SitePlanData',newData,{params:this.params}).subscribe(data=>{ |
|
|
|
@ -1740,9 +1803,9 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
item.order = this.sitePlanData[this.sitePlanData.length-1].order+1 |
|
|
|
|
this.http.post('/api/BuildingAreas',item,{params:this.params}).subscribe((data:any)=>{ |
|
|
|
|
let newData = { |
|
|
|
|
version: this.canvasData.originaleveryStoreyData.version || "2.0", |
|
|
|
|
version: "2.0", |
|
|
|
|
id: "", |
|
|
|
|
data: JSON.stringify( JSON.parse(JSON.stringify(this.canvasData.originaleveryStoreyData.data)) ) || null, |
|
|
|
|
data: JSON.stringify( paramsData ) || null, |
|
|
|
|
buildingAreaId: data.id |
|
|
|
|
} |
|
|
|
|
this.http.post('/api/BuildingAreaData',newData,{params:this.params}).subscribe(data=>{ |
|
|
|
@ -1852,7 +1915,6 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
}); |
|
|
|
|
this.allLibrary = data |
|
|
|
|
this.selectImageIndex = -1 |
|
|
|
|
// this.canvas.cancelPaint()
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2037,6 +2099,7 @@ export class CollectionToolsComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
// 切换 基本信息时 刷新 删除 建筑楼层 自定义属性
|
|
|
|
|
mateDeleteCustomize () { |
|
|
|
|
this.canvasData.selectPanelPointBaseData = {description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: ''} |
|
|
|
|
this.defaultExpandedKeys = [] |
|
|
|
|
this.sitePlanIcon = {fire:0,force:0} |
|
|
|
|
this.sitePlanData.forEach(element => { //楼层
|
|
|
|
|