|
|
|
@ -47,13 +47,13 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static instance: PlanComponent; |
|
|
|
|
public game: Game = new Game(); |
|
|
|
|
public game: Game; |
|
|
|
|
public beforeOneSatus; //当前 satus
|
|
|
|
|
public canvas: HTMLCanvasElement; //canvas 实例
|
|
|
|
|
public editMode: boolean = true; //编辑/查看 模式
|
|
|
|
|
public userMode: boolean = ModeManager.s_isMakeMode; //是否为 内部权限
|
|
|
|
|
public bucketName: string = ObjectsService.getFullPath("文件路径"); //当前桶名
|
|
|
|
|
public isShowLoading: boolean = true; //显隐 loading加载条
|
|
|
|
|
public isShowLoading: boolean = false; //显隐 loading加载条
|
|
|
|
|
public companyData: any; //当前加油站所属组织机构 data
|
|
|
|
|
|
|
|
|
|
private readonly c_frameSpace = 16;//更新的帧间隔, 16大概是60帧每秒
|
|
|
|
@ -63,6 +63,12 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
PlanComponent.instance = this; |
|
|
|
|
ServeManager.Init(this.buildingBISrv, this.objectsSrv); |
|
|
|
|
this.canvas = this.element.nativeElement.querySelector('#center') as HTMLCanvasElement; |
|
|
|
|
if (Game.instance == null) { |
|
|
|
|
this.game = new Game(); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
this.game = Game.instance; |
|
|
|
|
} |
|
|
|
|
this.game.init(this.canvas); |
|
|
|
|
this.companyData = (JSON.parse(sessionStorage.getItem('userdataOfgasstation'))).organization || {} |
|
|
|
|
let editMode = sessionStorage.getItem('isGasStation') |
|
|
|
@ -148,7 +154,7 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngOnDestroy(): void { //组件销毁前 销毁canvas
|
|
|
|
|
this.game.dispose(); |
|
|
|
|
this.game.pauseRender(); |
|
|
|
|
this.game = null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -403,7 +409,7 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//选中 设备
|
|
|
|
|
selectProperty(e: FacilityInfoUIItem) { |
|
|
|
|
this.propertyImg? this.propertyImg.destroy() : null |
|
|
|
|
this.propertyImg ? this.propertyImg.destroy() : null |
|
|
|
|
this.isShowNature = true |
|
|
|
|
this.beforeOnePropertyData = e |
|
|
|
|
if (this.selectFence === 1 || this.selectFence === 2) { //刷新弹窗 位置
|
|
|
|
@ -433,7 +439,7 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if (this.beforeOnePropertyData.getPropertyData().is360) { //全景模式 销毁 Viewer
|
|
|
|
|
this.propertyImg? this.propertyImg.destroy() : null |
|
|
|
|
this.propertyImg ? this.propertyImg.destroy() : null |
|
|
|
|
} else { //非全景模式 初始化 Viewer
|
|
|
|
|
window.setTimeout(() => { |
|
|
|
|
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original', navbar: false }); |
|
|
|
@ -446,15 +452,15 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
if (this.beforeOnePropertyData.getPropertyData().img && this.beforeOnePropertyData.getPropertyData().is360) { //全景模式 打开canvas弹窗
|
|
|
|
|
this.videoDialogType.isVideo = false |
|
|
|
|
this.videoDialogType.url = this.beforeOnePropertyData.getPropertyData().img |
|
|
|
|
window.setTimeout(()=>{ |
|
|
|
|
window.setTimeout(() => { |
|
|
|
|
Photo360Tool.open(document.getElementById('panorama') as HTMLCanvasElement, this.videoDialogType.url) |
|
|
|
|
},0) |
|
|
|
|
}, 0) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//销毁全景图片 canvas/ 关闭弹窗
|
|
|
|
|
closePanorama() { |
|
|
|
|
!this.videoDialogType.isVideo? Photo360Tool.close() : null |
|
|
|
|
!this.videoDialogType.isVideo ? Photo360Tool.close() : null |
|
|
|
|
this.videoDialogType.url = null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|