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