Browse Source

处置预案完善

dev
陈鹏飞 3 years ago
parent
commit
52201fe294
  1. 24
      src/app/pages/left-domain/left-domain.component.html
  2. 51
      src/app/pages/left-domain/left-domain.component.ts
  3. 2
      src/app/pages/plan/plan.component.html
  4. 14
      src/app/pages/plan/plan.component.ts

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

@ -92,15 +92,31 @@
</div>
<!-- 消防设施 -->
<!-- 处置预案 -->
<div class="publicBox disposalPlan" *ngIf="beforeFence === 7">
<div class="interval">
<div class="publicDisposal disposalHeader">处置预案<label><i nz-icon nzType="plus-circle" nzTheme="outline"></i><i nz-icon nzType="delete" nzTheme="outline"></i></label></div>
<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>
</div>
<ul>
<li class="publicDisposal disposalContent">处置预案<label><i nz-icon nzType="save" nzTheme="outline"></i><i nz-icon nzType="delete" nzTheme="outline"></i></label></li>
<li class="publicDisposal disposalContent" *ngFor="let items of item.nodes;let keys = index;">
{{items.name}}<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>
</li>
</ul>
</div>
</div>
<!-- 处置预案 -->
<!-- 弹窗 -->
<nz-modal [(nzVisible)]="addDisposalPop || addNodePop" nzTitle="创建预案/节点" (nzOnCancel)="addDisposalPop = false; addNodePop = null;" (nzOnOk)="addDisposal(form.value)" [nzOkDisabled]='name.invalid'>
<form nz-form #form='ngForm'>
<nz-form-item>
<nz-form-label [nzSpan]="6">预案/节点名称</nz-form-label>
<nz-form-control [nzSpan]="18" nzErrorTip="请输入必填项">
<input nz-input #name='ngModel' ngModel name="name" required/>
</nz-form-control>
</nz-form-item>
</form>
</nz-modal>
<!-- 弹窗 -->
</div>
<div class="childBottom" *ngIf="beforeFence === 0">

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

@ -7,7 +7,9 @@ import { ConfigManager } from 'src/app/babylon/controller/config-manager';
import { FacilityType } from 'src/app/babylon/model/data/model-data/model-data-facility';
import { EventManager } from 'src/app/babylon/controller/event-manager/event-manager';
import { Event_GetAllMarkPlanData } from 'src/app/babylon/controller/event-manager/events/event-get-markplandata-success';
import { AllMarkPlanData } from 'src/app/babylon/model/data/mark/mark-plan-data';
import { AllMarkPlanData, MarkNodeData, MarkPlanData } from 'src/app/babylon/model/data/mark/mark-plan-data';
import { MarkWindow } from 'src/app/babylon/view/mark-window/mark-window';
import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
selector: 'app-left-domain',
@ -16,7 +18,7 @@ import { AllMarkPlanData } from 'src/app/babylon/model/data/mark/mark-plan-data'
})
export class LeftDomainComponent implements OnInit {
constructor() { }
constructor(private message: NzMessageService) { }
ngOnInit(): void {
this.initComponent()
@ -151,6 +153,51 @@ export class LeftDomainComponent implements OnInit {
allMarkPlanData: AllMarkPlanData; //处置预案节点数据
selectPlanId: number;
selectNodeId: number;
addDisposalPop: boolean = false; //显示/隐藏 创建预案弹窗
addNodePop: number = null; //显示/隐藏 创建节点 父节点ID
//创建预案/节点
addDisposal(e) {
if (this.addDisposalPop) { //创建预案
MarkWindow.instance.createMarkPlaneData(e.name)
this.addDisposalPop = false
} else { //创建节点
MarkWindow.instance.createMarkNodeData(this.addNodePop,e.name)
this.addNodePop = null
}
}
//删除预案/节点
deleteDisposal(item: MarkPlanData, e?: MarkNodeData) {
let isTrue = confirm('您确定要删除吗')
if (isTrue) {
if (!e) {
MarkWindow.instance.deleteMarkPlaneData(item.id)
} else {
MarkWindow.instance.deleteMarkNodeData(item.id, e.id)
}
}
}
//保存预案/节点
saveDisposal(markPlanId: number = null, nodeId: number = null) {
if (!MarkWindow.instance.currentMarkNodeInfo) { //未选中节点
this.message.info('还没有进行标绘,无法保存');
return
}
if (markPlanId === null && nodeId === null) { // 整体弹窗保存
this.saveDisposalDialog = true
} else {
if (this.selectPlanId === markPlanId && this.selectNodeId === nodeId) {
MarkWindow.instance.saveToOldNode(markPlanId,nodeId)
} else {
let isTrue = confirm('是否覆盖要保存的节点?')
isTrue? MarkWindow.instance.saveToOldNode(markPlanId,nodeId) : null
}
}
}
saveDisposalDialog: boolean = false; //整体保存预案 弹窗
//编辑信息
editInfo() {

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

@ -19,7 +19,7 @@
<div class="leftChildComponent" *ngIf="isShowChildComponent" [ngStyle]="{ 'left': isShowLeftBuilding? '15%' : null }">
<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"></i><i nz-icon nzType="save" nzTheme="outline" *ngIf="selectFence === 7"></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 (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>

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

@ -59,17 +59,14 @@ export class PlanComponent implements OnInit {
loginStatus.getInstitutionListFromServe((result: InsitutionDataSimple[], data: any) => {
if (ModeManager.institutionDemoKey == ModeManager.c_demoKey_null) { //无指定测试单位,则为正式启动,根据当前单位key寻找
let key = 'ceshi';
// console.log("获取数据", data);
let find = data.find(item => { return item.key === key })
if (find) { //如果在data中找到了对应的单位key,则表示已经有三维数据,直接进入
// console.log("找到已有单位" + key);
this.beforeOneSatus = StatusManager.getStatus<LoginSatus>(LoginSatus);
this.beforeOneSatus.onSelectInsSuccess(find)
} else { //如果没有找到对应的单位key,则调用新建单位
let isAdd = confirm('没有单位name,是否进行初始化?')
if (isAdd) {
let name = 'ceshi';
console.log("没找到单位,新建" + key);
loginStatus.createInsitution(key, name);
}
}
@ -141,6 +138,17 @@ export class PlanComponent implements OnInit {
return fenceType
}
//子组件 创建预案/保存
noticeChildComponent(type: boolean) {
if (this.isShowChildComponent && this.leftDomain) {
if (type) { //创建预案
this.leftDomain.addDisposalPop = true
} else { //整体保存
this.leftDomain.saveDisposal()
}
}
}
//切换 头部罩棚
toggleHeaderAwning(isOpen: boolean) {
this.isOpenAwning = isOpen;

Loading…
Cancel
Save