邵佳豪 3 years ago
parent
commit
45996d04bb
  1. 1
      src/app/babylon/view/facilityinfoinscene-window/facilityinfo-ui-item.ts
  2. 8
      src/app/pages/left-domain/left-domain.component.html
  3. 4
      src/app/pages/left-domain/left-domain.component.ts
  4. 2
      src/app/pages/plan/plan.component.html
  5. 3
      src/app/pages/plan/plan.component.scss
  6. 37
      src/app/pages/plan/plan.component.ts

1
src/app/babylon/view/facilityinfoinscene-window/facilityinfo-ui-item.ts

@ -150,4 +150,5 @@ export class FacilityInfoUIItem {
}
}

8
src/app/pages/left-domain/left-domain.component.html

@ -47,7 +47,7 @@
<!-- 基本信息 -->
<!-- 加油机 -->
<div class="publicBox refueller" *ngIf="beforeFence === 1">
<div class="interval" *ngFor="let item of FacilityList" (click)="selectFacility(item)">
<div class="interval" *ngFor="let item of FacilityList" (click)="selectFacility($event, item)">
<!-- 选中样式 -->
<div class="positionLeftTop" *ngIf="selectFacilityId === item.getID()"></div><div class="positionLeftBottom" *ngIf="selectFacilityId === item.getID()"></div>
<div class="positionRightTop" *ngIf="selectFacilityId === item.getID()"></div><div class="positionRightBottom" *ngIf="selectFacilityId === item.getID()"></div>
@ -77,7 +77,7 @@
<!-- 加油机 -->
<!-- 油罐设备 -->
<div class="publicBox refueller" *ngIf="beforeFence === 2">
<div class="interval" *ngFor="let item of FacilityList" (click)="selectFacility(item)">
<div class="interval" *ngFor="let item of FacilityList" (click)="selectFacility($event, item)">
<!-- 选中样式 -->
<div class="positionLeftTop" *ngIf="selectFacilityId === item.getID()"></div><div class="positionLeftBottom" *ngIf="selectFacilityId === item.getID()"></div>
<div class="positionRightTop" *ngIf="selectFacilityId === item.getID()"></div><div class="positionRightBottom" *ngIf="selectFacilityId === item.getID()"></div>
@ -119,7 +119,7 @@
<!-- 消防设施 -->
<!-- 输油管线 -->
<div class="publicBox refueller" *ngIf="beforeFence === 5">
<div class="interval" *ngFor="let item of FacilityList" (click)="selectFacility(item)">
<div class="interval" *ngFor="let item of FacilityList" (click)="selectFacility($event, item)">
<!-- 选中样式 -->
<div class="positionLeftTop" *ngIf="selectFacilityId === item.getID()"></div><div class="positionLeftBottom" *ngIf="selectFacilityId === item.getID()"></div>
<div class="positionRightTop" *ngIf="selectFacilityId === item.getID()"></div><div class="positionRightBottom" *ngIf="selectFacilityId === item.getID()"></div>
@ -149,7 +149,7 @@
<!-- 输油管线 -->
<!-- 油气回收 -->
<div class="publicBox refueller" *ngIf="beforeFence === 6">
<div class="interval" *ngFor="let item of FacilityList" (click)="selectFacility(item)">
<div class="interval" *ngFor="let item of FacilityList" (click)="selectFacility($event, item)">
<!-- 选中样式 -->
<div class="positionLeftTop" *ngIf="selectFacilityId === item.getID()"></div><div class="positionLeftBottom" *ngIf="selectFacilityId === item.getID()"></div>
<div class="positionRightTop" *ngIf="selectFacilityId === item.getID()"></div><div class="positionRightBottom" *ngIf="selectFacilityId === item.getID()"></div>

4
src/app/pages/left-domain/left-domain.component.ts

@ -100,7 +100,9 @@ export class LeftDomainComponent implements OnInit {
}
//选中 设备
selectFacility(item: FacilityInfoUIItem) {
selectFacility(event, item: FacilityInfoUIItem) {
event.stopPropagation();
event.preventDefault();
if (this.selectFacilityId != item.getID()) {
this.selectFacilityId = item.getID()
FacilityInfoInSceneWindow.instance.selectFacilityItem(item);

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

@ -77,7 +77,7 @@
<div *ngIf="editMode && !beforeOnePropertyData.getPropertyData().img"><a href="javascript:;" class="bottomPlanUpload natureUpload"><input type="file" accept="image/*" (change)='uploadPropertyImg($event)'><i nz-icon nzType="plus" nzTheme="outline"></i></a></div>
</div>
</div>
<div class="nature natureLook" *ngIf="isShowNature && (selectFence === 1 || selectFence === 2) && beforeOnePropertyData" [ngStyle]="{'top': naturePosition.top,'right': naturePosition.right}">
<div class="nature natureLook" *ngIf="isShowNature && (selectFence === 1 || selectFence === 2) && beforeOnePropertyData" [ngStyle]="{'top': naturePosition.top,'left': naturePosition.left}">
<div *ngIf="selectFence === 1">
<div class="natureTitle">{{beforeOnePropertyData.getPropertyData().name}}</div>
<div class="flowPower">

3
src/app/pages/plan/plan.component.scss

@ -201,9 +201,6 @@
}
}
.natureLook{
width: auto;
min-width: 170px;
box-sizing: border-box;
padding: 20px;
color: #fff;
.flowPower{

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

@ -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 {

Loading…
Cancel
Save