|
|
|
@ -14,6 +14,8 @@ import { BuildingType } from 'src/app/babylon/model/data/institution/building/bu
|
|
|
|
|
import { BuildingWindow } from 'src/app/babylon/view/building-window/building-window'; |
|
|
|
|
import { FacilityUIItem } from 'src/app/babylon/view/facility-window/facility-ui-item'; |
|
|
|
|
import { FacilityWindow } from 'src/app/babylon/view/facility-window/facility-window'; |
|
|
|
|
import { FacilityInfoUIItem } from 'src/app/babylon/view/facilityinfoinscene-window/facilityinfo-ui-item'; |
|
|
|
|
import { EventManager } from '@angular/platform-browser'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -24,7 +26,7 @@ import { FacilityWindow } from 'src/app/babylon/view/facility-window/facility-wi
|
|
|
|
|
}) |
|
|
|
|
export class PlanComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
constructor(private element: ElementRef, private buildingBISrv: BuildingBasicInfosService, private objectsSrv: ObjectsService) { } |
|
|
|
|
constructor(private element: ElementRef, private buildingBISrv: BuildingBasicInfosService, private objectsSrv: ObjectsService, private eventManager: EventManager) { } |
|
|
|
|
|
|
|
|
|
static instance: PlanComponent; |
|
|
|
|
public game: Game = new Game(); |
|
|
|
@ -36,6 +38,16 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
ServeManager.Init(this.buildingBISrv, this.objectsSrv); |
|
|
|
|
this.canvas = this.element.nativeElement.querySelector('#center') as HTMLCanvasElement; |
|
|
|
|
this.game.init(this.canvas); |
|
|
|
|
//监听 delete键盘事件
|
|
|
|
|
this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { |
|
|
|
|
if (event.keyCode == 46) { //delete
|
|
|
|
|
if (this.beforeOnePropertyData) { |
|
|
|
|
let isDelete = confirm("是否删除已选择模型?"); |
|
|
|
|
if (isDelete) { this.beforeOnePropertyData.askDelete(false) }; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
//监听 delete键盘事件
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngAfterViewInit(): void { |
|
|
|
@ -179,6 +191,14 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
e == 0 ? bootomDiv.scrollLeft = bootomDiv.scrollLeft + 50 : bootomDiv.scrollLeft = bootomDiv.scrollLeft - 50 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
beforeOnePropertyData: FacilityInfoUIItem = null; //当前选择 设备
|
|
|
|
|
beforeOnefacilityInfo: string = null; //当前选择 设备ID
|
|
|
|
|
|
|
|
|
|
//获取选择设备 属性
|
|
|
|
|
getPropertyData(e: FacilityInfoUIItem) { |
|
|
|
|
this.beforeOnePropertyData = e |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
selectRightTopFast: number = 0; //当前选择功能 快捷栏
|
|
|
|
|
selectAdsorb: boolean = false; //吸附状态
|
|
|
|
|
topLevelView: boolean = false; //顶视图状态
|
|
|
|
@ -190,7 +210,10 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//清空设备
|
|
|
|
|
clearDevice() { |
|
|
|
|
ToolbarWindow.instance.clearHomeLessFacilityData() |
|
|
|
|
let isClear = confirm('您确定要清空吗?') |
|
|
|
|
if (isClear) { |
|
|
|
|
ToolbarWindow.instance.clearHomeLessFacilityData() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//平移
|
|
|
|
|