From b65e1f320e65cedd08adf4e73b58d21a599ded6d Mon Sep 17 00:00:00 2001 From: liuxianghui <519646741@qq.com> Date: Fri, 26 Nov 2021 11:46:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/babylon/controller/mode-manager.ts | 2 +- .../babylon/model/data/mark/mark-plan-data.ts | 12 ++- .../babylon/view/mark-window/mark-window.ts | 2 + src/app/pages/plan/plan.component.ts | 95 +++++++++---------- 4 files changed, 56 insertions(+), 55 deletions(-) diff --git a/src/app/babylon/controller/mode-manager.ts b/src/app/babylon/controller/mode-manager.ts index 92eb799..5038bc5 100644 --- a/src/app/babylon/controller/mode-manager.ts +++ b/src/app/babylon/controller/mode-manager.ts @@ -23,7 +23,7 @@ export class ModeManager { /** * 制作模式代表内部编辑人员,可新增单位、上传模型,查看模式代表交付的模式 */ - public static s_isMakeMode = true; + public static s_isMakeMode = false; /** * 调试模式 diff --git a/src/app/babylon/model/data/mark/mark-plan-data.ts b/src/app/babylon/model/data/mark/mark-plan-data.ts index 358dc28..916cf31 100644 --- a/src/app/babylon/model/data/mark/mark-plan-data.ts +++ b/src/app/babylon/model/data/mark/mark-plan-data.ts @@ -354,6 +354,7 @@ export class MarkNodeData { /** * 获取展示此节点所需要完整时间 + * 最短3秒 */ getShowTime() { let textNum = 0; @@ -361,9 +362,16 @@ export class MarkNodeData { textNum = this.describe.length; } - let timeScale = 1; + let timeScale = 0.3; - return textNum * timeScale; + let minTime = 3; //最短停留时间 + + let result = textNum * timeScale; + if (result < minTime) { + result = minTime; + } + + return result; } } diff --git a/src/app/babylon/view/mark-window/mark-window.ts b/src/app/babylon/view/mark-window/mark-window.ts index 9e295f4..e7b6907 100644 --- a/src/app/babylon/view/mark-window/mark-window.ts +++ b/src/app/babylon/view/mark-window/mark-window.ts @@ -9,6 +9,7 @@ import { Event_GetAllMarkPlanData } from "../../controller/event-manager/events/ import { Event_KeyboardInput } from "../../controller/event-manager/events/event-keyboard-input"; import { Event_MarkInfoChange, MarkInfoChangeType } from "../../controller/event-manager/events/event-mark-info-change"; import { InputController } from "../../controller/inputController"; +import { ModeManager } from "../../controller/mode-manager"; import { SceneManager } from "../../controller/scene-manager"; import { BuildingStatus } from "../../controller/status/building-status"; import { IndoorStatus } from "../../controller/status/indoor-status"; @@ -149,6 +150,7 @@ export class MarkWindow extends UIBase { instance.onUpdateShow(); }) + } diff --git a/src/app/pages/plan/plan.component.ts b/src/app/pages/plan/plan.component.ts index 2ffbaa6..7b3f763 100644 --- a/src/app/pages/plan/plan.component.ts +++ b/src/app/pages/plan/plan.component.ts @@ -367,10 +367,10 @@ export class PlanComponent implements OnInit { selectChildNode(item: MarkPlanData) { if (this.isShowChildComponent && this.leftDomain) { if (item.nodes.length) { - this.updateTimer? window.clearTimeout(this.updateTimer) : null //清除定时器 + this.updateTimer ? window.clearTimeout(this.updateTimer) : null //清除定时器 this.nzCurrent = 0 this.beforeEmergencyPlan = item - this.updateProgressList().then(res=>{ + this.updateProgressList().then(res => { this.publicToggleNode() }) } else { @@ -383,7 +383,7 @@ export class PlanComponent implements OnInit { updateProgressList() { return new Promise((resolve, reject) => { this.progressList = [] - this.beforeEmergencyPlan.nodes.forEach(item=>{ this.progressList.push(0) }) + this.beforeEmergencyPlan.nodes.forEach(item => { this.progressList.push(0) }) resolve(true) }) } @@ -393,14 +393,14 @@ export class PlanComponent implements OnInit { if (this.progressList[this.nzCurrent] >= 100) { this.progressList[this.nzCurrent] = 100 window.clearTimeout(this.updateTimer) //清除定时器 - !this.isSuspend? this.autoPlay() : null + !this.isSuspend ? this.autoPlay() : null return } let time: number = this.beforePlanNode.getShowTime() || 1 - this.updateTimer = window.setTimeout(()=>{ + this.updateTimer = window.setTimeout(() => { this.progressList[this.nzCurrent] = this.progressList[this.nzCurrent] + Number((100 / time).toFixed(2)) / 10 this.updateProgress() - },100) + }, 100) } //自动播放-切换接点 @@ -414,14 +414,14 @@ export class PlanComponent implements OnInit { } //切换预案节点 - changePlanNode(event){ + changePlanNode(event) { if (this.progressList.length != this.beforeEmergencyPlan.nodes.length) { this.updateProgressList() } - this.updateTimer? window.clearTimeout(this.updateTimer) : null //清除定时器 + this.updateTimer ? window.clearTimeout(this.updateTimer) : null //清除定时器 this.isSuspend = true //暂停 this.nzCurrent = event - this.progressList.forEach((item,index)=>{ index >= this.nzCurrent? this.progressList[index] = 0 : null }) + this.progressList.forEach((item, index) => { index >= this.nzCurrent ? this.progressList[index] = 0 : null }) this.publicToggleNode() } @@ -438,9 +438,9 @@ export class PlanComponent implements OnInit { if (this.progressList.length != this.beforeEmergencyPlan.nodes.length) { this.updateProgressList() } - this.updateTimer? window.clearTimeout(this.updateTimer) : null //清除定时器 + this.updateTimer ? window.clearTimeout(this.updateTimer) : null //清除定时器 this.nzCurrent = this.nzCurrent - 1 - this.progressList.forEach((item,index)=>{ index >= this.nzCurrent? this.progressList[index] = 0 : null }) + this.progressList.forEach((item, index) => { index >= this.nzCurrent ? this.progressList[index] = 0 : null }) this.publicToggleNode() } @@ -454,13 +454,13 @@ export class PlanComponent implements OnInit { this.updateProgressList() } this.isSuspend = isSuspend - let msg: string = this.isSuspend? "目前已暂停" : "目前已开始播放" + let msg: string = this.isSuspend ? "目前已暂停" : "目前已开始播放" this.message.info(msg); if (this.isSuspend) { //暂停 window.clearTimeout(this.updateTimer) //清除定时器 } else { //开启 - this.updateTimer? window.clearTimeout(this.updateTimer) : null //清除定时器 - this.progressList.forEach((item,index)=>{ index > this.nzCurrent? this.progressList[index] = 0 : null }) + this.updateTimer ? window.clearTimeout(this.updateTimer) : null //清除定时器 + this.progressList.forEach((item, index) => { index > this.nzCurrent ? this.progressList[index] = 0 : null }) this.updateProgress() } } @@ -471,8 +471,8 @@ export class PlanComponent implements OnInit { this.message.info('请选择节点'); return } - this.updateTimer? window.clearTimeout(this.updateTimer) : null //清除定时器 - this.updateProgressList().then(res=>{ + this.updateTimer ? window.clearTimeout(this.updateTimer) : null //清除定时器 + this.updateProgressList().then(res => { this.nzCurrent = 0 this.publicToggleNode() }) @@ -491,16 +491,16 @@ export class PlanComponent implements OnInit { if (this.progressList.length != this.beforeEmergencyPlan.nodes.length) { this.updateProgressList() } - this.updateTimer? window.clearTimeout(this.updateTimer) : null //清除定时器 + this.updateTimer ? window.clearTimeout(this.updateTimer) : null //清除定时器 this.nzCurrent = this.nzCurrent + 1 - this.progressList.forEach((item,index)=>{ index >= this.nzCurrent? this.progressList[index] = 0 : null }) + this.progressList.forEach((item, index) => { index >= this.nzCurrent ? this.progressList[index] = 0 : null }) this.publicToggleNode() } //获取进度条 flex分布 - getProgressFlex(e: MarkNodeData):string { + getProgressFlex(e: MarkNodeData): string { let length: number = 0 - this.beforeEmergencyPlan.nodes.forEach(item=>{ + this.beforeEmergencyPlan.nodes.forEach(item => { length = length + (item.getShowTime() || 1) }) let percentage: number = (e.getShowTime() || 1) / length @@ -642,42 +642,33 @@ export class taskDialog { //设备任务list export class taskList { character: any[] = [ - { taskName: "外部控火" }, - { taskName: "内部控火" }, - { taskName: "外部侦察" }, - { taskName: "内部侦察" }, - { taskName: "外部观察" }, - { taskName: "外部疏散救生" }, - { taskName: "询问知情人" }, - { taskName: "占领消控室" }, - { taskName: "水源引导" }, - { taskName: "断电气" }, + { taskName: "加油" }, + { taskName: "卸油" }, + { taskName: "按下紧急切断按钮" }, + { taskName: "呼喊示警" }, + { taskName: "停止加油" }, + { taskName: "关闭泄油阀" }, + { taskName: "指挥疏通撤离" }, + { taskName: "向运营、QHSE报告" }, + { taskName: "撤离" }, + { taskName: "119报警" }, + { taskName: "110报警" }, + { taskName: "120报警" }, + { taskName: "使用灭火毯" }, + { taskName: "使用灭火器" }, { taskName: "灭火" }, - { taskName: "掩护" }, - { taskName: "警戒" }, - { taskName: "破拆" }, - { taskName: "排烟" }, - { taskName: "照明" }, - { taskName: "通信" }, + { taskName: "协助灭火" }, + { taskName: "确认安全" }, + { taskName: "保持冷静" }, { taskName: "待命" }, ]; car: any[] = [ - { taskName: "内攻" }, - { taskName: "出枪掩护" }, - { taskName: "出枪冷却" }, - { taskName: "出枪灭火" }, - { taskName: "供水" }, - { taskName: "供泡沫" }, - { taskName: "连接消火栓" }, - { taskName: "遥控水炮冷却" }, - { taskName: "遥控水炮灭火" }, - { taskName: "抢险救援" }, - { taskName: "救人" }, - { taskName: "指挥" }, - { taskName: "排烟" }, - { taskName: "提供器材" }, - { taskName: "照明" }, - { taskName: "供电" }, + { taskName: "加油" }, + { taskName: "停止加油" }, + { taskName: "灭火" }, + { taskName: "逃逸" }, + { taskName: "撤离" }, + { taskName: "损毁" }, { taskName: "待命" }, ] firemonitor: any[] = [