|
|
|
@ -50,7 +50,7 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
public beforeOneSatus; //当前 satus
|
|
|
|
|
public canvas: HTMLCanvasElement; //canvas 实例
|
|
|
|
|
public editMode: boolean = true; //编辑/查看 模式
|
|
|
|
|
public userMode: boolean = ModeManager.s_isMakeMode; //是否为 内部权限
|
|
|
|
|
public userMode: boolean = false; //是否为 内部权限
|
|
|
|
|
public bucketName: string = ObjectsService.getFullPath("文件路径"); //当前桶名
|
|
|
|
|
public isShowLoading: boolean = true; //显隐 loading加载条
|
|
|
|
|
public companyData: any; //当前加油站所属组织机构 data
|
|
|
|
@ -63,7 +63,6 @@ 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') { |
|
|
|
@ -73,7 +72,14 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
this.editMode = false |
|
|
|
|
ModeManager.currentMode = ModeType.Look |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let userdata = JSON.parse(sessionStorage.getItem('userdata')) |
|
|
|
|
if (userdata.userName == 'superadmin') { //是superadmin,是内部制作账号
|
|
|
|
|
this.userMode = true |
|
|
|
|
ModeManager.s_isMakeMode = true; |
|
|
|
|
} else { |
|
|
|
|
this.userMode = false |
|
|
|
|
ModeManager.s_isMakeMode = false; |
|
|
|
|
} |
|
|
|
|
//监听 delete键盘事件
|
|
|
|
|
this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { |
|
|
|
|
if (event.keyCode == 46) { //delete
|
|
|
|
@ -110,6 +116,8 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
let name = simpleData.name; |
|
|
|
|
let id = simpleData.id;// 单位id
|
|
|
|
|
loginStatus.createInsitution(simpleData.key, name, id); |
|
|
|
|
} else { |
|
|
|
|
history.back(); //回退上一步路由
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else //非内部制作模式,不开启
|
|
|
|
@ -434,7 +442,7 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.isShowLoading = true //打开遮罩
|
|
|
|
|
let institutionKey = sessionStorage.getItem('unitId') || "ceshi"; //单位id
|
|
|
|
|
let institutionKey = this.companyData.id || "ceshi"; //单位id
|
|
|
|
|
let buildingKey = this.buildingUIItems.find(item => { return item.getBuildingID() == this.beforeOneBuildingID }) |
|
|
|
|
let facility = this.beforeOnePropertyData |
|
|
|
|
let url = DataManager.getResPath_facilityProperty(institutionKey, buildingKey.getBuildingID(), facility.getType(), facility.getID(), null) |
|
|
|
@ -695,16 +703,13 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
this.isShowLoading = true //打开遮罩
|
|
|
|
|
let institutionKey = sessionStorage.getItem('unitId') || "ceshi"; //单位id
|
|
|
|
|
let institutionKey = this.companyData.id || "ceshi"; //单位id
|
|
|
|
|
let resType = isVideo ? ResType.Video : ResType.Texture |
|
|
|
|
let key = `${(new Date()).getMonth() + 1}-${(new Date()).getDate()}-${(new Date()).getHours()}` |
|
|
|
|
let url = DataManager.getResPath_mark(institutionKey, resType, key) //url
|
|
|
|
|
ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
|
|
|
|
|
if (!isVideo) { //img
|
|
|
|
|
this.beforePlanNode.texture = ObjectsService.getFullPath(path + name) |
|
|
|
|
|
|
|
|
|
console.log("上传图片保存数据", this.beforePlanNode); |
|
|
|
|
|
|
|
|
|
this.initViewer() |
|
|
|
|
} else { //video
|
|
|
|
|
this.beforePlanNode.video = ObjectsService.getFullPath(path + name) |
|
|
|
|