Browse Source

对接superadmin和内部制作模式

dev
刘向辉 3 years ago
parent
commit
cf07fa3015
  1. 2
      src/app/babylon/controller/mode-manager.ts
  2. 9
      src/app/pages/init3D.guard.ts
  3. 2
      src/app/pages/plan/plan.component.ts

2
src/app/babylon/controller/mode-manager.ts

@ -28,7 +28,7 @@ export class ModeManager {
/** /**
* *
*/ */
public static isDebug = true; public static isDebug = false;

9
src/app/pages/init3D.guard.ts

@ -16,6 +16,15 @@ export class init3DGuard implements CanActivate {
canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot,): Promise<boolean> { canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot,): Promise<boolean> {
return this.getGasStationBaseInfo().then((res: any) => { return this.getGasStationBaseInfo().then((res: any) => {
sessionStorage.setItem("3dSceneData", JSON.stringify(res)) sessionStorage.setItem("3dSceneData", JSON.stringify(res))
if (true) //是superadmin,是内部制作账号
{
ModeManager.s_isMakeMode = true;
}
else {
ModeManager.s_isMakeMode = true;
}
let isMakeMode = ModeManager.s_isMakeMode let isMakeMode = ModeManager.s_isMakeMode
if (isMakeMode || res.hasBuildingInfo) { if (isMakeMode || res.hasBuildingInfo) {
return true return true

2
src/app/pages/plan/plan.component.ts

@ -63,6 +63,7 @@ export class PlanComponent implements OnInit {
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;
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')
if (editMode == 'false') { if (editMode == 'false') {
@ -72,6 +73,7 @@ export class PlanComponent implements OnInit {
this.editMode = false this.editMode = false
ModeManager.currentMode = ModeType.Look ModeManager.currentMode = ModeType.Look
} }
//监听 delete键盘事件 //监听 delete键盘事件
this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => {
if (event.keyCode == 46) { //delete if (event.keyCode == 46) { //delete

Loading…
Cancel
Save