|
|
@ -29,6 +29,7 @@ import { EventManager as babylonEventManager } from 'src/app/babylon/controller/ |
|
|
|
import { Event_GetAllMarkPlanData } from 'src/app/babylon/controller/event-manager/events/event-get-markplandata-success'; |
|
|
|
import { Event_GetAllMarkPlanData } from 'src/app/babylon/controller/event-manager/events/event-get-markplandata-success'; |
|
|
|
import { FacilityInfoInSceneWindow } from 'src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window'; |
|
|
|
import { FacilityInfoInSceneWindow } from 'src/app/babylon/view/facilityinfoinscene-window/facilityinfoinscene-window'; |
|
|
|
import { FacilityType } from 'src/app/babylon/model/data/model-data/model-data-facility'; |
|
|
|
import { FacilityType } from 'src/app/babylon/model/data/model-data/model-data-facility'; |
|
|
|
|
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -39,7 +40,7 @@ import { FacilityType } from 'src/app/babylon/model/data/model-data/model-data-f |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class PlanComponent implements OnInit { |
|
|
|
export class PlanComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
constructor(private element: ElementRef, private buildingBISrv: BuildingBasicInfosService, private objectsSrv: ObjectsService, private eventManager: EventManager, private message: NzMessageService) { } |
|
|
|
constructor(private element: ElementRef, private buildingBISrv: BuildingBasicInfosService, private objectsSrv: ObjectsService, private eventManager: EventManager, private message: NzMessageService, private http: HttpClient) { } |
|
|
|
|
|
|
|
|
|
|
|
static instance: PlanComponent; |
|
|
|
static instance: PlanComponent; |
|
|
|
public game: Game = new Game(); |
|
|
|
public game: Game = new Game(); |
|
|
@ -49,7 +50,7 @@ export class PlanComponent implements OnInit { |
|
|
|
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 = true; //显隐 loading加载条
|
|
|
|
public companyData: any; //当前加油站 信息
|
|
|
|
public companyData: any; //当前加油站所属组织机构 data
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
PlanComponent.instance = this; |
|
|
|
PlanComponent.instance = this; |
|
|
@ -78,43 +79,46 @@ export class PlanComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ngAfterViewInit(): void { |
|
|
|
ngAfterViewInit(): void { |
|
|
|
let simpleData: InsitutionDataSimple = new InsitutionDataSimple(); |
|
|
|
this.getGasStationBaseInfo().then((res: any)=>{ //获取单位 基本信息
|
|
|
|
simpleData.id = 1; //来自选中的单位的信息 ,测试:1
|
|
|
|
console.log(res,"当前加油站信息") |
|
|
|
simpleData.key = "ceshi"; //正式: id.tostring(),测试:"ceshi"
|
|
|
|
let simpleData: InsitutionDataSimple = new InsitutionDataSimple(); |
|
|
|
simpleData.name = this.companyData.displayName || "测试"; //来自选中的单位的信息 ,测试:"测试"
|
|
|
|
simpleData.id = res.id || 1; //来自选中的单位的信息 ,测试:1
|
|
|
|
|
|
|
|
simpleData.key = `${res.id}` || "ceshi"; //测试:"ceshi"
|
|
|
|
let has3dData = true;//是否有三维数据,来自选中单位的信息
|
|
|
|
simpleData.name = res.stationName || "测试"; //来自选中的单位的信息 ,测试:"测试"
|
|
|
|
let loginStatus = StatusManager.getStatus<LoginSatus>(LoginSatus); |
|
|
|
|
|
|
|
if (ModeManager.institutionDemoKey == ModeManager.c_demoKey_null) { //无指定测试单位,则为正式启动,根据当前单位key寻找
|
|
|
|
let has3dData = res.hasBuildingInfo; //是否有三维数据,来自选中单位的信息
|
|
|
|
if (has3dData) { //如果已经有三维数据,直接进入
|
|
|
|
let loginStatus = StatusManager.getStatus<LoginSatus>(LoginSatus); |
|
|
|
this.beforeOneSatus = StatusManager.getStatus<LoginSatus>(LoginSatus); |
|
|
|
if (ModeManager.institutionDemoKey == ModeManager.c_demoKey_null) { //无指定测试单位,则为正式启动,根据当前单位key寻找
|
|
|
|
this.beforeOneSatus.onSelectInsSuccess(simpleData) |
|
|
|
if (has3dData) { //如果已经有三维数据,直接进入
|
|
|
|
} else { //如果没有三维数据
|
|
|
|
this.beforeOneSatus = StatusManager.getStatus<LoginSatus>(LoginSatus); |
|
|
|
if (ModeManager.s_isMakeMode) //内部制作模式下,询问新建
|
|
|
|
this.beforeOneSatus.onSelectInsSuccess(simpleData) |
|
|
|
{ |
|
|
|
} else { //如果没有三维数据
|
|
|
|
let isAdd = confirm('没有单位' + simpleData.key + ',是否进行初始化?') |
|
|
|
if (ModeManager.s_isMakeMode) //内部制作模式下,询问新建
|
|
|
|
if (isAdd) { |
|
|
|
{ |
|
|
|
let name = simpleData.name; |
|
|
|
let isAdd = confirm('没有单位' + simpleData.key + ',是否进行初始化?') |
|
|
|
let id = simpleData.id;// 单位id
|
|
|
|
if (isAdd) { |
|
|
|
loginStatus.createInsitution(simpleData.key, name, id); |
|
|
|
let name = simpleData.name; |
|
|
|
|
|
|
|
let id = simpleData.id;// 单位id
|
|
|
|
|
|
|
|
loginStatus.createInsitution(simpleData.key, name, id); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else //非内部制作模式,不开启
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
console.log("没有单位" + simpleData.key); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else //非内部制作模式,不开启
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
console.log("没有单位" + simpleData.key); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
//let find = data.find(item => { return item.key === ModeManager.institutionDemoKey })
|
|
|
|
|
|
|
|
let find = simpleData; //测试单位
|
|
|
|
|
|
|
|
if (find) { |
|
|
|
|
|
|
|
sessionStorage.setItem('unitId', find.key) |
|
|
|
|
|
|
|
this.beforeOneSatus = StatusManager.getStatus<LoginSatus>(LoginSatus); |
|
|
|
|
|
|
|
this.beforeOneSatus.onSelectInsSuccess(find) |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//this.modelInit(data) //开发模式 选择单位 弹窗
|
|
|
|
//let find = data.find(item => { return item.key === ModeManager.institutionDemoKey })
|
|
|
|
|
|
|
|
let find = simpleData; //测试单位
|
|
|
|
|
|
|
|
if (find) { |
|
|
|
|
|
|
|
sessionStorage.setItem('unitId', find.key) |
|
|
|
|
|
|
|
this.beforeOneSatus = StatusManager.getStatus<LoginSatus>(LoginSatus); |
|
|
|
|
|
|
|
this.beforeOneSatus.onSelectInsSuccess(find) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
//this.modelInit(data) //开发模式 选择单位 弹窗
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ngOnDestroy(): void { //组件销毁前 销毁canvas
|
|
|
|
ngOnDestroy(): void { //组件销毁前 销毁canvas
|
|
|
@ -122,6 +126,16 @@ export class PlanComponent implements OnInit { |
|
|
|
this.game = null; |
|
|
|
this.game = null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取 当前加油站基本信息
|
|
|
|
|
|
|
|
getGasStationBaseInfo() { |
|
|
|
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
|
|
|
let params = { organizationUnitId: this.companyData.id } |
|
|
|
|
|
|
|
this.http.get('/api/services/app/GasStation/Get', { params: params }).subscribe((data: any)=>{ |
|
|
|
|
|
|
|
resolve(data.result) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//开发模式 选择单位 弹窗
|
|
|
|
//开发模式 选择单位 弹窗
|
|
|
|
modelInit(InsList) { } |
|
|
|
modelInit(InsList) { } |
|
|
|
|
|
|
|
|
|
|
|