From f85d4a9782b0a49ed6e6098dcf6bc2da8dd68001 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Thu, 27 Jul 2023 14:43:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=BD=A6=E4=BF=A1=E6=81=AF=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/TrainPage.vue | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/pages/TrainPage.vue b/src/pages/TrainPage.vue index e3bd14c..5edd562 100644 --- a/src/pages/TrainPage.vue +++ b/src/pages/TrainPage.vue @@ -40,11 +40,19 @@ const list: keyType[] = [ { label: '列车索引', key: 'id' }, { label: '是否上行', key: 'up', formatFn: upFormat }, { label: '车头所在link的索引', key: 'headLinkId' }, - { label: '车头所在link内的偏移量', key: 'headLinkOffset' }, + { + label: '车头所在link内的偏移量', + key: 'headLinkOffset', + formatFn: offsetFormat, + }, { label: '车尾所在link的索引', key: 'tailLinkId' }, - { label: '车尾所在link内的偏移量', key: 'tailLinkOffset' }, + { + label: '车尾所在link内的偏移量', + key: 'tailLinkOffset', + formatFn: offsetFormat, + }, { label: '生命信号', key: 'heartbeat' }, - { label: '列车所在位置坡度值', key: 'slope' }, + { label: '列车所在位置坡度值', key: 'slope', formatFn: slopeFormat }, { label: '列车所在位置坡度走势', key: 'upslope', formatFn: upslopeFormat }, { label: '列车当前运行方向', key: 'runningUp', formatFn: runningUpFormat }, { @@ -72,11 +80,17 @@ function upslopeFormat(v: boolean) { function runningUpFormat(v: boolean) { return v ? '上行' : '下行'; } +function offsetFormat(v: number) { + return `${v} mm`; +} +function slopeFormat(v: number) { + return `${v} ‰`; +} function resistanceFormat(v: number) { - return `${v}KN`; + return `${v} KN`; } function speedFormat(v: number) { - return `${v}km/h`; + return `${v} km/h`; } watch( () => lineStore.selectedGraphics,