diff --git a/src/drawApp/graphics/PlatformInteraction.ts b/src/drawApp/graphics/PlatformInteraction.ts index 19e0cdc..f11af66 100644 --- a/src/drawApp/graphics/PlatformInteraction.ts +++ b/src/drawApp/graphics/PlatformInteraction.ts @@ -207,6 +207,12 @@ export class PlatformState extends GraphicStateBase implements IPlatformState { set rtuId(value: number) { this.states.rtuId = value; } + get bizWaitTimeSec(): number { + return this.states.bizWaitStartTimeSec; + } + set bizWaitTimeSec(value: number) { + this.states.bizWaitStartTimeSec = value; + } get states(): state.Platform { return this.getState(); } diff --git a/src/graphics/platform/Platform.ts b/src/graphics/platform/Platform.ts index 2311a5d..768fb5e 100644 --- a/src/graphics/platform/Platform.ts +++ b/src/graphics/platform/Platform.ts @@ -11,6 +11,7 @@ import { } from 'jl-graphic'; import { Station } from '../station/Station'; import { Section } from '../section/Section'; +import { useLineStore } from 'src/stores/line-store'; export interface IPlatformData extends GraphicData { get code(): string; // 编号 @@ -66,6 +67,8 @@ export interface IPlatformState extends GraphicState { set stopTime(v: number); get rtuId(): number; // 集中站站号 set rtuId(v: number); + get bizWaitTimeSec(): number; //乘客等待秒数 + set bizWaitTimeSec(v: number); } //站台颜色 @@ -189,6 +192,8 @@ class codeGraph extends Container { runLevel: VectorText = new VectorText(''); //运行等级 runTime: VectorText = new VectorText(''); //运行时间 stopTime: VectorText = new VectorText(''); //停站时间 + waitSec: VectorText = new VectorText(); //VectorText + circle: Graphics = new Graphics(); constructor() { super(); @@ -197,12 +202,14 @@ class codeGraph extends Container { this.addChild(this.circle); this.addChild(this.stopTime); this.addChild(this.runTime); + this.addChild(this.waitSec); this.character.setVectorFontSize(platformConsts.besideFontSize); this.runLevel.setVectorFontSize(platformConsts.besideFontSize); this.stopTime.setVectorFontSize(platformConsts.besideFontSize); this.runTime.setVectorFontSize(platformConsts.besideFontSize); + this.waitSec.setVectorFontSize(platformConsts.besideFontSize); } - draw(): void { + draw(datas: IPlatformData): void { //扣车 const character = this.character; character.text = 'H'; @@ -254,11 +261,25 @@ class codeGraph extends Container { platformConsts.besideSpacing ); stopTime.style.fill = PlatformColorEnum.whiteNumbers; + //乘客等待时间 + const waitSec = this.waitSec; + + waitSec.anchor.set(0.5); + let yPos = platformConsts.height / 2 + platformConsts.doorPlatformSpacing; + + if (datas.direction == 'down') { + yPos = -platformConsts.height / 2 - platformConsts.doorPlatformSpacing; + } + waitSec.position.set(0, yPos); + + waitSec.style.fill = PlatformColorEnum.whiteNumbers; + character.visible = false; circle.visible = false; runLevel.visible = false; stopTime.visible = false; runTime.visible = false; + waitSec.visible = false; } clear(): void { this.character.destroy(); @@ -309,6 +330,21 @@ class codeGraph extends Container { this.stopTime.visible = true; this.stopTime.text = stateData.stopTime; } + if (stateData.bizWaitTimeSec && useLineStore().faultStatistics) { + const minutes = Math.floor(stateData.bizWaitTimeSec / 60); + const seconds = stateData.bizWaitTimeSec % 60; + let minutesString = '' + minutes; + let secondsString = '' + seconds; + if (minutes < 10) { + minutesString = `0${minutes}`; + } + if (seconds < 10) { + secondsString = `0${seconds}`; + } + + this.waitSec.visible = true; + this.waitSec.text = `乘客已经等待了${minutesString}:${secondsString}`; + } } } //子元素--站台旁菱形图标 @@ -388,7 +424,7 @@ export class Platform extends JlGraphic { } this.platformGraphic.draw(this.states); this.besideGraphic.draw(); - this.codeGraph.draw(); + this.codeGraph.draw(this.datas); this.doorGraphic.position.set( 0, diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index c76c2d0..074b102 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -52,7 +52,7 @@ @click="backConfirm" /> route.path, diff --git a/src/pages/LineMonitorPage.vue b/src/pages/LineMonitorPage.vue index 117cc43..35f7174 100644 --- a/src/pages/LineMonitorPage.vue +++ b/src/pages/LineMonitorPage.vue @@ -3,14 +3,40 @@
+
+
+ +
+
+ +
+
diff --git a/src/stores/line-store.ts b/src/stores/line-store.ts index e757f2a..0b99d29 100644 --- a/src/stores/line-store.ts +++ b/src/stores/line-store.ts @@ -13,6 +13,7 @@ export const useLineStore = defineStore('line', { selectedGraphics: null as JlGraphic[] | null, lineId: null as number | null, lineName: null as string | null, + faultStatistics: false, }), getters: { selectedGraphicType: (state) => { diff --git a/xian-ncc-da-message b/xian-ncc-da-message index c1bd5be..0f95f00 160000 --- a/xian-ncc-da-message +++ b/xian-ncc-da-message @@ -1 +1 @@ -Subproject commit c1bd5beb501ab675459a5ef58d823c0f86be9000 +Subproject commit 0f95f00449d14672b382f03727b34e339131786b