From cf07fa301531d9525f4198758f6d9f69418d4b71 Mon Sep 17 00:00:00 2001 From: liuxianghui <519646741@qq.com> Date: Wed, 1 Dec 2021 16:07:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5superadmin=E5=92=8C=E5=86=85?= =?UTF-8?q?=E9=83=A8=E5=88=B6=E4=BD=9C=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/babylon/controller/mode-manager.ts | 2 +- src/app/pages/init3D.guard.ts | 13 +++++++++++-- src/app/pages/plan/plan.component.ts | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/app/babylon/controller/mode-manager.ts b/src/app/babylon/controller/mode-manager.ts index 146f793..8b28322 100644 --- a/src/app/babylon/controller/mode-manager.ts +++ b/src/app/babylon/controller/mode-manager.ts @@ -28,7 +28,7 @@ export class ModeManager { /** * 调试模式 */ - public static isDebug = true; + public static isDebug = false; diff --git a/src/app/pages/init3D.guard.ts b/src/app/pages/init3D.guard.ts index 651a426..4f4758c 100644 --- a/src/app/pages/init3D.guard.ts +++ b/src/app/pages/init3D.guard.ts @@ -10,12 +10,21 @@ import { NzMessageService } from 'ng-zorro-antd/message'; }) export class init3DGuard implements CanActivate { - constructor(private router: Router, private http: HttpClient, private message: NzMessageService,) { } + constructor(private router: Router, private http: HttpClient, private message: NzMessageService,) { } // 路由守卫 canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot,): Promise { return this.getGasStationBaseInfo().then((res: any) => { sessionStorage.setItem("3dSceneData", JSON.stringify(res)) + + if (true) //是superadmin,是内部制作账号 + { + ModeManager.s_isMakeMode = true; + } + else { + ModeManager.s_isMakeMode = true; + } + let isMakeMode = ModeManager.s_isMakeMode if (isMakeMode || res.hasBuildingInfo) { return true @@ -30,7 +39,7 @@ export class init3DGuard implements CanActivate { getGasStationBaseInfo() { return new Promise((resolve, reject) => { let params = { organizationUnitId: (JSON.parse(sessionStorage.getItem('userdataOfgasstation'))).organization.id } - this.http.get('/api/services/app/GasStation/Get', { params: params }).subscribe((data: any)=>{ + this.http.get('/api/services/app/GasStation/Get', { params: params }).subscribe((data: any) => { resolve(data.result) }) }) diff --git a/src/app/pages/plan/plan.component.ts b/src/app/pages/plan/plan.component.ts index 3f662bd..b8258ed 100644 --- a/src/app/pages/plan/plan.component.ts +++ b/src/app/pages/plan/plan.component.ts @@ -63,6 +63,7 @@ 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); + this.companyData = (JSON.parse(sessionStorage.getItem('userdataOfgasstation'))).organization || {} let editMode = sessionStorage.getItem('isGasStation') if (editMode == 'false') { @@ -72,6 +73,7 @@ export class PlanComponent implements OnInit { this.editMode = false ModeManager.currentMode = ModeType.Look } + //监听 delete键盘事件 this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { if (event.keyCode == 46) { //delete