刘向辉 3 years ago
parent
commit
a81e7dcb5f
  1. 48
      src/app/pages/left-domain/left-domain.component.html
  2. 12
      src/app/pages/left-domain/left-domain.component.ts
  3. 22
      src/app/pages/plan/plan.component.html
  4. 5
      src/app/pages/plan/plan.component.scss
  5. 12
      src/app/pages/plan/plan.component.ts

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

@ -23,22 +23,20 @@
<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>
<!-- 选中样式 -->
<p class="title"><input type="text" class="tableInput" [(ngModel)]="item.getPropertyData().name"></p>
<p class="title"><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().name"></p>
<div class="table">
<div class="tableHeader">
<p>品牌</p>
<p>超大牌</p>
<p>油枪数量</p>
<p>油品品号</p>
<p>油泵类型</p>
</div>
<div class="tableContent">
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().brand"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().superBrand"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().oilGunNum"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().oilProductNo"></p>
<p><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().brand"></p>
<p><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().oilGunNum"></p>
<p><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().oilProductNo"></p>
<p style="padding-left: 8px;">
<nz-select class="tableSelect" [nzBorderless]="true" [nzDisabled]="!editModel" [(ngModel)]="item.getPropertyData().oilPumpType">
<nz-select class="tableSelect" [nzBorderless]="true" [nzDisabled]="!editMode" [(ngModel)]="item.getPropertyData().oilPumpType">
<nz-option nzValue="zxb" nzLabel="自吸泵"></nz-option>
<nz-option nzValue="qyb" nzLabel="潜油泵"></nz-option>
</nz-select>
@ -55,7 +53,7 @@
<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>
<!-- 选中样式 -->
<p class="title"><input type="text" class="tableInput" [(ngModel)]="item.getPropertyData().name"></p>
<p class="title"><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().name"></p>
<div class="table">
<div class="tableHeader">
<p>油品品号</p>
@ -66,13 +64,13 @@
<p>油罐类型</p>
</div>
<div class="tableContent">
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().oilProductNo"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().oilTankVolume"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().safeVolume"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().quantity"></p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().tankFarm"></p>
<p><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().oilProductNo"></p>
<p><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().oilTankVolume"></p>
<p><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().safeVolume"></p>
<p><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().quantity"></p>
<p><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().tankFarm"></p>
<p style="padding-left: 8px;">
<nz-select class="tableSelect" [nzBorderless]="true" [nzDisabled]="!editModel" [(ngModel)]="item.getPropertyData().oilTankType">
<nz-select class="tableSelect" [nzBorderless]="true" [nzDisabled]="!editMode" [(ngModel)]="item.getPropertyData().oilTankType">
<nz-option nzValue="scg" nzLabel="双层罐"></nz-option>
<nz-option nzValue="dcg" nzLabel="单层罐"></nz-option>
<nz-option nzValue="fsgc" nzLabel="防渗罐池"></nz-option>
@ -98,7 +96,7 @@
<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>
<!-- 选中样式 -->
<p class="title"><input type="text" class="tableInput" [(ngModel)]="item.getPropertyData().name"></p>
<p class="title"><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().name"></p>
<div class="table">
<div class="tableHeader">
<p class="tableImg">图片</p>
@ -106,7 +104,7 @@
<div class="tableContent">
<p class="tableImg">
<img *ngIf="item.getPropertyData().img" [src]="item.getPropertyData().img">
<a href="javascript:;" class="bottomPlanUpload uploadImgBox" [ngStyle]="{'float': item.getPropertyData().img? 'right' : 'left'}"><input type="file"><i nz-icon nzType="plus" nzTheme="outline"></i></a>
<a href="javascript:;" class="bottomPlanUpload uploadImgBox" [ngStyle]="{'float': item.getPropertyData().img? 'right' : 'left'}" *ngIf="editMode"><input type="file"><i nz-icon nzType="plus" nzTheme="outline"></i></a>
</p>
</div>
</div>
@ -120,24 +118,24 @@
<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>
<!-- 选中样式 -->
<p class="title"><input type="text" class="tableInput" [(ngModel)]="item.getPropertyData().name"></p>
<p class="title"><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().name"></p>
<div class="table">
<div class="tableHeader">
<div class="tableHeader" style="flex: 55%;">
<p>油气回收系统类型</p>
<p>油气回收泵类型</p>
<p class="tableImg">图片</p>
</div>
<div class="tableContent">
<div class="tableContent" style="flex: 45%;">
<p style="padding-left: 8px;">
<nz-select class="tableSelect" [nzBorderless]="true" [nzDisabled]="!editModel" [(ngModel)]="item.getPropertyData().VRUType">
<nz-select class="tableSelect" [nzBorderless]="true" [nzDisabled]="!editMode" [(ngModel)]="item.getPropertyData().VRUType">
<nz-option nzValue="fss" nzLabel="分散式"></nz-option>
<nz-option nzValue="jzs" nzLabel="集中式"></nz-option>
</nz-select>
</p>
<p><input type="text" class="tableInput" [disabled]="!editModel" [(ngModel)]="item.getPropertyData().VRUPumpType"></p>
<p><input type="text" class="tableInput" [disabled]="!editMode" [(ngModel)]="item.getPropertyData().VRUPumpType"></p>
<p class="tableImg">
<img *ngIf="item.getPropertyData().img" [src]="item.getPropertyData().img">
<a href="javascript:;" class="bottomPlanUpload uploadImgBox" [ngStyle]="{'float': item.getPropertyData().img? 'right' : 'left'}"><input type="file"><i nz-icon nzType="plus" nzTheme="outline"></i></a>
<a href="javascript:;" class="bottomPlanUpload uploadImgBox" [ngStyle]="{'float': item.getPropertyData().img? 'right' : 'left'}" *ngIf="editMode"><input type="file"><i nz-icon nzType="plus" nzTheme="outline"></i></a>
</p>
</div>
</div>
@ -148,12 +146,12 @@
<div class="publicBox disposalPlan" *ngIf="beforeFence === 7 && allMarkPlanData">
<div class="interval" *ngFor="let item of allMarkPlanData.datas;let key = index;">
<div class="publicDisposal disposalHeader">
{{item.name}}<label><i nz-icon nzType="plus-circle" nzTheme="outline" (click)="addNodePop = item.id;"></i><i nz-icon nzType="delete" nzTheme="outline" (click)="deleteDisposal(item)"></i></label>
{{item.name}}<label *ngIf="editMode"><i nz-icon nzType="plus-circle" nzTheme="outline" (click)="addNodePop = item.id;"></i><i nz-icon nzType="delete" nzTheme="outline" (click)="deleteDisposal(item)"></i></label>
</div>
<ul>
<li class="publicDisposal disposalContent" *ngFor="let items of item.nodes;let keys = index;">
<span (click)='selectNode(item,items)' [ngClass]="{'selectNode': selectNodeId == items.id && selectPlanId == item.id}">{{items.name}}</span>
<label><i nz-icon nzType="save" nzTheme="outline" (click)="saveDisposal(item.id,items.id)"></i><i nz-icon nzType="delete" nzTheme="outline" (click)="deleteDisposal(item,items)"></i></label>
<label *ngIf="editMode"><i nz-icon nzType="save" nzTheme="outline" (click)="saveDisposal(item.id,items.id)"></i><i nz-icon nzType="delete" nzTheme="outline" (click)="deleteDisposal(item,items)"></i></label>
</li>
</ul>
</div>
@ -204,7 +202,7 @@
<!-- 弹窗 -->
</div>
<div class="childBottom" *ngIf="beforeFence === 0">
<div class="childBottom" *ngIf="beforeFence === 0 && editMode">
<button (click)="editInfo()"><i nz-icon nzType="edit" nzTheme="outline"></i>编辑信息</button>
<button (click)="deriveExcel()"><i nz-icon nzType="file-excel" nzTheme="outline"></i>导出Excel</button>
</div>

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

@ -22,10 +22,16 @@ export class LeftDomainComponent implements OnInit {
constructor(private message: NzMessageService) { }
ngOnInit(): void {
let editMode = sessionStorage.getItem('isGasStation')
if (editMode == 'false') {
this.editMode = true
} else {
this.editMode = false
}
this.initComponent()
}
editModel: boolean = true; //编辑/查看模式
editMode: boolean = true; //编辑/查看模式
beforeFence: number; //当前选中功能栏
FacilityList: FacilityInfoUIItem[] = []; //统计设备 list
selectFacilityId: string = null; //选中设备 ID
@ -108,8 +114,8 @@ export class LeftDomainComponent implements OnInit {
}
})
//编辑模式
if (this.editModel) {
let isFind = this.treeData.find(item => { return item.key === 'XF_MHQ' })
if (this.editMode) {
let isFind = this.treeData.find(item=>{ return item.key === 'XF_MHQ' })
if (!isFind) {
let primaryNode = { title: '灭火器', key: 'XF_MHQ', selectable: false, }
this.treeData.push(primaryNode)

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

@ -16,10 +16,10 @@
<canvas id="center"></canvas>
<!-- 左侧子组件 -->
<div class="leftChildComponent" *ngIf="isShowChildComponent && selectFence != 4" [ngStyle]="{ 'left': isShowLeftBuilding? '15%' : null }" [ngClass]="{'publicMoveUp': selectFence === 7}">
<div class="leftChildComponent" *ngIf="isShowChildComponent && selectFence != 4" [ngStyle]="{ 'left': isShowLeftBuilding && !editMode && !userMode? '15%' : null }" [ngClass]="{'publicMoveUp': selectFence === 7}">
<div class="leftChildHeader">
<div><i nz-icon nzType="star" nzTheme="outline"></i></div>
<div>{{allFence[selectFence]}}<i nz-icon nzType="plus-circle" nzTheme="outline" *ngIf="selectFence === 7" (click)="noticeChildComponent(true)"></i><i nz-icon nzType="save" nzTheme="outline" *ngIf="selectFence === 7" (click)="noticeChildComponent(false)"></i></div>
<div>{{allFence[selectFence]}}<i nz-icon nzType="plus-circle" nzTheme="outline" *ngIf="selectFence === 7 && editMode" (click)="noticeChildComponent(true)"></i><i nz-icon nzType="save" nzTheme="outline" *ngIf="selectFence === 7 && editMode" (click)="noticeChildComponent(false)"></i></div>
<div (click)="toggleHeaderFence(selectFence)" title="关闭"><i nz-icon nzType="close-circle" nzTheme="outline"></i></div>
</div>
<div class="leftChildCenter"><app-left-domain #leftDomain></app-left-domain></div>
@ -27,8 +27,8 @@
<!-- 左侧子组件 -->
<!-- 左侧建筑栏 -->
<div class="showLeftBuilding" title="显示" *ngIf="!isShowLeftBuilding" (click)="toggleLeftBuilding(true)"><i nz-icon nzType="right" nzTheme="outline"></i></div>
<div class="leftBuilding" [ngClass]="{'isShowLeftBuilding': isShowLeftBuilding === false, 'publicMoveUp': selectFence === 7}">
<div class="showLeftBuilding" title="显示" *ngIf="!isShowLeftBuilding && editMode && userMode" (click)="toggleLeftBuilding(true)"><i nz-icon nzType="right" nzTheme="outline"></i></div>
<div class="leftBuilding" *ngIf="editMode && userMode" [ngClass]="{'isShowLeftBuilding': isShowLeftBuilding === false, 'publicMoveUp': selectFence === 7}">
<div class="hideLeft"><i nz-icon nzType="close" nzTheme="outline" title="隐藏" (click)="toggleLeftBuilding(false)"></i></div>
<div class="leftHeader">
<h1><label>模型列表</label></h1>
@ -48,7 +48,7 @@
<!-- 左侧建筑栏 -->
<!-- 右侧图标栏 -->
<div class="rightIcons" *ngIf="selectFence === 0 || selectFence === 7" [ngClass]="{'publicMoveUp': selectFence === 7}">
<div class="rightIcons" *ngIf="editMode && selectFence === 0 || selectFence === 7" [ngClass]="{'publicMoveUp': selectFence === 7}" [ngStyle]="{'width': selectFence === 0? '60px' : null}">
<div class="bottomCenter" id="bottomCenter">
<ng-container *ngIf="selectFence === 0">
<div class="everyIcon" (click)='selectBottomIcon(item)' *ngFor="let item of allFacilityUIItemes" [ngClass]="{'selectLeftIcon': beforeOneIcon == item.getIconID()}">
@ -72,19 +72,19 @@
<!-- 右上角快捷栏 -->
<div class="rightTopFast">
<div class="publicFast leftFunction">
<div class="publicFast leftFunction" *ngIf="editMode && userMode">
<button title="获取设备" (click)="getDevice()"></button>
<button title="清空设备" (click)="clearDevice()"></button>
</div>
<div class="publicFast leftFast">
<div class="publicFast leftFast" *ngIf="editMode && selectFence === 7">
<button title="平移" (click)="translation()" [ngClass]="{'selectRightTopFast': selectRightTopFast == 0}"></button>
<button title="旋转" (click)="revolve()" [ngClass]="{'selectRightTopFast': selectRightTopFast == 1}"></button>
<button title="缩放" (click)="scale()" [ngClass]="{'selectRightTopFast': selectRightTopFast == 2}"></button>
<button title="吸附" (click)="adsorb()" [ngClass]="{'leftFastIsTure': selectAdsorb }"></button>
<button title="切换至顶视图" (click)="toggleTopLevelView()" [ngClass]="{'leftFastIsTure': topLevelView }"></button>
<!-- <button title="吸附" (click)="adsorb()" [ngClass]="{'leftFastIsTure': selectAdsorb }"></button>
<button title="切换至顶视图" (click)="toggleTopLevelView()" [ngClass]="{'leftFastIsTure': topLevelView }"></button> -->
</div>
<div class="save">
<button (click)="preserve(false)" title="保存模块"><i nz-icon nzType="file-done" nzTheme="outline"></i></button>
<div class="save" *ngIf="editMode">
<button (click)="preserve(false)" title="保存模块" *ngIf="userMode"><i nz-icon nzType="file-done" nzTheme="outline"></i></button>
<button (click)="preserve(true)" title="保存"><i nz-icon nzType="save" nzTheme="outline"></i></button>
</div>
</div>

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

@ -201,10 +201,11 @@
.bottomCenter{
width: 100%;
height: 100%;
text-align: center;
overflow-x: hidden;
overflow-y: auto;
.everyIcon {
width: 100px;
width: 60px;
height: 58px;
line-height: normal;
text-align: center;
@ -219,7 +220,7 @@
//右上角快捷栏
.rightTopFast{
width: 400px;
max-width: 400px;
height: 38px;
position: absolute;
right: 1px;

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

@ -3,7 +3,7 @@ import { Game } from 'src/app/babylon/game';
import { LoginSatus } from 'src/app/babylon/controller/status/login-status';
import { StatusManager } from 'src/app/babylon/controller/status/status-manager';
import { InsitutionDataSimple } from 'src/app/babylon/model/data/institution/institution-data-simple';
import { ModeManager } from 'src/app/babylon/controller/mode-manager';
import { ModeManager, ModeType } from 'src/app/babylon/controller/mode-manager';
import { ServeManager } from 'src/app/babylon/controller/serve-manager';
import { BuildingBasicInfosService } from 'src/app/service/babylon/building-basic-infos.service';
import { ObjectsService } from 'src/app/service/objects.service';
@ -38,6 +38,8 @@ export class PlanComponent implements OnInit {
public game: Game = new Game();
public beforeOneSatus; //当前 satus
public canvas: HTMLCanvasElement; //canvas 实例
public editMode: boolean = true; //编辑/查看 模式
public userMode: boolean = ModeManager.s_isMakeMode; //是否为 内部权限
public isShowLoading: boolean = true; //显隐 loading加载条
ngOnInit(): void {
@ -45,6 +47,14 @@ 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);
let editMode = sessionStorage.getItem('isGasStation')
if (editMode == 'false') {
this.editMode = true
ModeManager.currentMode = ModeType.Edit
} else {
this.editMode = false
ModeManager.currentMode = ModeType.Look
}
//监听 delete键盘事件
this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => {
if (event.keyCode == 46) { //delete

Loading…
Cancel
Save