|
|
|
@ -14,6 +14,9 @@ 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'; |
|
|
|
|
import { NzMessageService } from 'ng-zorro-antd/message'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -24,18 +27,29 @@ 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, private message: NzMessageService) { } |
|
|
|
|
|
|
|
|
|
static instance: PlanComponent; |
|
|
|
|
public game: Game = new Game(); |
|
|
|
|
public beforeOneSatus; //当前 satus
|
|
|
|
|
public canvas: HTMLCanvasElement; //canvas 实例
|
|
|
|
|
public isShowLoading: boolean = false; //显隐 loading加载条
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
PlanComponent.instance = this; |
|
|
|
|
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,10 +193,31 @@ 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; //顶视图状态
|
|
|
|
|
|
|
|
|
|
//获取设备
|
|
|
|
|
getDevice() { |
|
|
|
|
ToolbarWindow.instance.getModelAndCreateFacilityData() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//清空设备
|
|
|
|
|
clearDevice() { |
|
|
|
|
let isClear = confirm('您确定要清空吗?') |
|
|
|
|
if (isClear) { |
|
|
|
|
ToolbarWindow.instance.clearHomeLessFacilityData() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//平移
|
|
|
|
|
translation() { |
|
|
|
|
this.selectRightTopFast = 0 |
|
|
|
@ -222,6 +257,11 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
ToolbarWindow.instance.onBtnSave(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//通用 消息通知栏
|
|
|
|
|
openSnackBar(title: string) { |
|
|
|
|
this.message.info(title); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|