|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; |
|
|
|
|
import { AfterViewChecked, Component, ElementRef, OnInit, ViewChild } from '@angular/core'; |
|
|
|
|
import Viewer from 'viewerjs'; |
|
|
|
|
import { Game } from 'src/app/babylon/game'; |
|
|
|
|
import { LoginSatus } from 'src/app/babylon/controller/status/login-status'; |
|
|
|
@ -40,8 +40,10 @@ import { HttpClient } from '@angular/common/http';
|
|
|
|
|
}) |
|
|
|
|
export class PlanComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor(private element: ElementRef, private buildingBISrv: BuildingBasicInfosService, private objectsSrv: ObjectsService, private eventManager: EventManager, private message: NzMessageService, private http: HttpClient) { } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static instance: PlanComponent; |
|
|
|
|
public game: Game = new Game(); |
|
|
|
|
public beforeOneSatus; //当前 satus
|
|
|
|
@ -52,6 +54,7 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
public isShowLoading: boolean = true; //显隐 loading加载条
|
|
|
|
|
public companyData: any; //当前加油站所属组织机构 data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
PlanComponent.instance = this; |
|
|
|
|
ServeManager.Init(this.buildingBISrv, this.objectsSrv); |
|
|
|
@ -104,7 +107,6 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
else //非内部制作模式,不开启
|
|
|
|
|
{ |
|
|
|
|
console.log("没有单位" + simpleData.key); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
@ -121,6 +123,12 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngAfterViewChecked () { |
|
|
|
|
if (this.isShowNature && this.beforeOnePropertyData && (this.selectFence === 1 || this.selectFence === 2)) { //刷新弹窗 位置
|
|
|
|
|
this.renovateDialogPosition() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ngOnDestroy(): void { //组件销毁前 销毁canvas
|
|
|
|
|
this.game.dispose(); |
|
|
|
|
this.game = null; |
|
|
|
@ -379,6 +387,9 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
selectProperty(e: FacilityInfoUIItem) { |
|
|
|
|
this.isShowNature = true |
|
|
|
|
this.beforeOnePropertyData = e |
|
|
|
|
if (this.selectFence === 1 || this.selectFence === 2) { //刷新弹窗 位置
|
|
|
|
|
this.renovateDialogPosition() |
|
|
|
|
} |
|
|
|
|
console.log(e.getPropertyData(), '选中设备') |
|
|
|
|
if (this.isShowChildComponent && this.leftDomain) { |
|
|
|
|
this.leftDomain.selectFacilityId = e.getID() |
|
|
|
@ -387,7 +398,15 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
window.setTimeout(() => { |
|
|
|
|
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original', navbar: false }); |
|
|
|
|
}, 0) |
|
|
|
|
} |
|
|
|
|
}
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//刷新设备属性 弹窗位置
|
|
|
|
|
renovateDialogPosition() { |
|
|
|
|
window.setTimeout(()=>{ |
|
|
|
|
this.naturePosition.left = `${this.beforeOnePropertyData.getHeadUIPos().x - 150}px` |
|
|
|
|
this.naturePosition.top = `${this.beforeOnePropertyData.getHeadUIPos().y + 100}px` |
|
|
|
|
},0) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//上传设备 图片
|
|
|
|
@ -488,6 +507,7 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
this.progressList[this.nzCurrent] = this.progressList[this.nzCurrent] + Number((100 / time).toFixed(2)) / 10 |
|
|
|
|
this.updateProgress() |
|
|
|
|
}, 100) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//自动播放-切换接点
|
|
|
|
@ -674,17 +694,17 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
let isDelete = confirm("您确定要删除吗?") |
|
|
|
|
if (isDelete) { |
|
|
|
|
if (type === 1) { |
|
|
|
|
this.http.delete(`${this.beforeOnePropertyData.getPropertyData().img}`).subscribe(data=>{ |
|
|
|
|
this.http.delete(`${this.beforeOnePropertyData.getPropertyData().img}`).subscribe(data => { |
|
|
|
|
this.beforeOnePropertyData.getPropertyData().img = "" |
|
|
|
|
this.message.info("删除成功!"); |
|
|
|
|
}) |
|
|
|
|
} else if (type === 2) { |
|
|
|
|
this.http.delete(`${this.beforePlanNode.texture}`).subscribe(data=>{ |
|
|
|
|
this.http.delete(`${this.beforePlanNode.texture}`).subscribe(data => { |
|
|
|
|
this.beforePlanNode.texture = "" |
|
|
|
|
this.message.info("删除成功!"); |
|
|
|
|
}) |
|
|
|
|
} else if (type === 3) { |
|
|
|
|
this.http.delete(`${this.beforePlanNode.video}`).subscribe(data=>{ |
|
|
|
|
this.http.delete(`${this.beforePlanNode.video}`).subscribe(data => { |
|
|
|
|
this.beforePlanNode.video = "" |
|
|
|
|
this.message.info("删除成功!"); |
|
|
|
|
}) |
|
|
|
@ -833,9 +853,8 @@ export class taskList {
|
|
|
|
|
} |
|
|
|
|
//属性栏 定位
|
|
|
|
|
export class naturePosition { |
|
|
|
|
top: string = "1%" |
|
|
|
|
left: string = "50%" |
|
|
|
|
right: string = "5%" |
|
|
|
|
top: string = "0px" |
|
|
|
|
left: string = "0px" |
|
|
|
|
} |
|
|
|
|
// 处置预案 所有图标
|
|
|
|
|
export class planIcons { |
|
|
|
|