From 799db9e567fe6c4c5ade804b1dd3cf25e654ac37 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Mon, 22 Nov 2021 16:38:23 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=BA=94=E6=80=A5=E9=A2=84=E6=A1=88?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../left-domain/left-domain.component.ts | 4 +-- src/app/pages/plan/plan.component.html | 24 ++++++------- src/app/pages/plan/plan.component.ts | 35 +++++++++++++++++-- 3 files changed, 47 insertions(+), 16 deletions(-) diff --git a/src/app/pages/left-domain/left-domain.component.ts b/src/app/pages/left-domain/left-domain.component.ts index 58efc2c..03a881a 100644 --- a/src/app/pages/left-domain/left-domain.component.ts +++ b/src/app/pages/left-domain/left-domain.component.ts @@ -235,8 +235,8 @@ export class LeftDomainComponent implements OnInit { isTrue = confirm('切换节点后,没保存的信息将会丢失!') } if (isTrue) { - PlanComponent.instance.beforeEmergencyPlan = null - PlanComponent.instance.beforePlanNode = null + PlanComponent.instance.beforeEmergencyPlan = new MarkPlanData(-99, "请选择节点") + PlanComponent.instance.beforePlanNode = new MarkNodeData(-99, "请选择节点") this.selectPlanId = null this.selectNodeId = null MarkWindow.instance.selectMarkNode(null, null) diff --git a/src/app/pages/plan/plan.component.html b/src/app/pages/plan/plan.component.html index e19ccfb..0845604 100644 --- a/src/app/pages/plan/plan.component.html +++ b/src/app/pages/plan/plan.component.html @@ -143,33 +143,33 @@
-

灾情描述

- +

+
- +
diff --git a/src/app/pages/plan/plan.component.ts b/src/app/pages/plan/plan.component.ts index 09f7775..f3ffb32 100644 --- a/src/app/pages/plan/plan.component.ts +++ b/src/app/pages/plan/plan.component.ts @@ -317,8 +317,39 @@ export class PlanComponent implements OnInit { } allMarkPlanData: AllMarkPlanData; //处置预案节点 数据 - beforeEmergencyPlan: MarkPlanData = null; //当前选择 应急预案 - beforePlanNode: MarkNodeData = null; //当前选择 预案节点 + beforeEmergencyPlan: MarkPlanData = new MarkPlanData(-99, "请选择节点"); //当前选择 应急预案 + beforePlanNode: MarkNodeData = new MarkNodeData(-99, "请选择节点"); //当前选择 预案节点 + + //选中 子组件预案节点 + selectChildNode(item: MarkPlanData) { + if (this.isShowChildComponent && this.leftDomain) { + if (item.nodes.length) { + this.leftDomain.selectNode(item, item.nodes[0]) + } else { + this.message.info('暂无数据节点'); + } + } + } + + //切换预案节点 上一个 + toLast() { + + } + + //切换预案节点 暂停 + suspend() { + + } + + //切换预案节点 初始化 + initialize() { + + } + + //切换预案节点 下一个 + toNext() { + + } //选中应急预案 设备 selectSandTableMark(markData: MarkData, select: boolean) { From ee836e78a64c3d8b62c4cffcb9b2a690309d1556 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Tue, 23 Nov 2021 15:19:12 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=BA=94=E6=80=A5=E9=A2=84=E6=A1=88?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../left-domain/left-domain.component.html | 4 +- src/app/pages/plan/plan.component.html | 14 +++--- src/app/pages/plan/plan.component.scss | 8 +++- src/app/pages/plan/plan.component.ts | 48 +++++++++++++++++-- src/styles.scss | 2 + 5 files changed, 64 insertions(+), 12 deletions(-) diff --git a/src/app/pages/left-domain/left-domain.component.html b/src/app/pages/left-domain/left-domain.component.html index 37a8d9f..9c4dca5 100644 --- a/src/app/pages/left-domain/left-domain.component.html +++ b/src/app/pages/left-domain/left-domain.component.html @@ -157,12 +157,12 @@ - +
预案/节点名称 - +
diff --git a/src/app/pages/plan/plan.component.html b/src/app/pages/plan/plan.component.html index 0845604..1a47969 100644 --- a/src/app/pages/plan/plan.component.html +++ b/src/app/pages/plan/plan.component.html @@ -144,7 +144,7 @@

- +
@@ -158,12 +158,14 @@ diff --git a/src/app/pages/plan/plan.component.scss b/src/app/pages/plan/plan.component.scss index 7898fd7..de97d92 100644 --- a/src/app/pages/plan/plan.component.scss +++ b/src/app/pages/plan/plan.component.scss @@ -363,7 +363,7 @@ label:nth-child(2){ flex: 1; overflow: hidden; - .anticon{ font-size: 16px; color: #23D9FF; } + //.anticon{ font-size: 16px; color: #23D9FF; } img{ height: 35px; width: auto; vertical-align: top; } } label:last-child{ diff --git a/src/app/pages/plan/plan.component.ts b/src/app/pages/plan/plan.component.ts index f4b91e4..e579706 100644 --- a/src/app/pages/plan/plan.component.ts +++ b/src/app/pages/plan/plan.component.ts @@ -346,17 +346,25 @@ export class PlanComponent implements OnInit { window.clearTimeout(this.timer) //清除定时器 } + //公用 切换选中节点 + publicToggleNode() { + this.beforePlanNode = this.beforeEmergencyPlan.nodes[this.nzCurrent] + this.leftDomain.selectPlanId = this.beforeEmergencyPlan.id + this.leftDomain.selectNodeId = this.beforePlanNode.id + MarkWindow.instance.selectMarkNode(this.beforeEmergencyPlan.id, this.beforePlanNode.id) + } + //选中 底部一级节点 开启自动播放 selectChildNode(item: MarkPlanData) { - if (this.isShowChildComponent && this.leftDomain && this.beforeEmergencyPlan != item) { + if (this.isShowChildComponent && this.leftDomain) { if (item.nodes.length) { - this.nzCurrent = 0 - this.beforeEmergencyPlan = item - this.beforePlanNode = item.nodes[0] - this.leftDomain.selectPlanId = item.id - this.leftDomain.selectNodeId = item.nodes[0].id - MarkWindow.instance.selectMarkNode(item.id, item.nodes[0].id) - this.autoPlay() + let isTrue = confirm("即将开始播放节点") + if (isTrue) { + this.nzCurrent = 0 + this.beforeEmergencyPlan = item + this.publicToggleNode() + !this.isSuspend? this.autoPlay() : null + } } else { this.message.info('暂无数据节点'); } @@ -365,8 +373,19 @@ export class PlanComponent implements OnInit { //自动播放-切换接点 autoPlay() { - let time: number - console.log(time,777) + if (this.nzCurrent === this.beforeEmergencyPlan.nodes.length - 1) { + this.nzCurrent = this.nzCurrent + 1 + this.isSuspend = false //初始化暂停状态 + window.clearTimeout(this.timer) //清除定时器 + this.message.info('已播放至最后一节点'); + return + } + let time: number = this.beforePlanNode.getShowTime() + this.timer = window.setTimeout(()=>{ + this.nzCurrent = this.nzCurrent + 1 + this.publicToggleNode() + !this.isSuspend? this.autoPlay() : null + },time) } //切换预案节点 @@ -375,31 +394,49 @@ export class PlanComponent implements OnInit { return } this.nzCurrent = event - this.beforePlanNode = this.beforeEmergencyPlan.nodes[event] - this.leftDomain.selectPlanId = this.beforeEmergencyPlan.id - this.leftDomain.selectNodeId = this.beforePlanNode.id - MarkWindow.instance.selectMarkNode(this.beforeEmergencyPlan.id, this.beforePlanNode.id) - console.log(event) + this.publicToggleNode() } //切换预案节点 上一个 toLast() { - + if (this.nzCurrent === 0) { + this.message.info('目前已经是第一节点'); + return + } + this.nzCurrent = this.nzCurrent - 1 + this.publicToggleNode() + !this.isSuspend? this.autoPlay() : null } //切换预案节点 暂停 - suspend() { - + suspend(isSuspend: boolean) { + this.isSuspend = isSuspend + let msg: string = this.isSuspend? "目前已暂停" : "目前已开始播放" + this.message.info(msg); + if (this.isSuspend) { //暂停 + window.clearTimeout(this.timer) //清除定时器 + } else { //开启 + MarkWindow.instance.selectMarkNode(this.beforeEmergencyPlan.id, this.beforePlanNode.id) + this.autoPlay() + } } //切换预案节点 初始化 initialize() { - + this.nzCurrent = 0 + this.publicToggleNode() + !this.isSuspend? this.autoPlay() : null } //切换预案节点 下一个 toNext() { - + if (this.nzCurrent === this.beforeEmergencyPlan.nodes.length - 1) { + this.message.info('目前已经是最后一个节点'); + return + } + this.nzCurrent = this.nzCurrent + 1 + this.publicToggleNode() + !this.isSuspend? this.autoPlay() : null } //选中应急预案 设备