From ec6d1a9e7d4f24cd3b635bc64d6b60e7ff66738e Mon Sep 17 00:00:00 2001 From: wangyu <823267011@qq.com> Date: Sat, 9 May 2026 17:22:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=9C=E6=9C=BA=E6=97=B6=E9=95=BF=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- klp-ui/src/views/timing/stoppage/index.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/klp-ui/src/views/timing/stoppage/index.vue b/klp-ui/src/views/timing/stoppage/index.vue index cecbcd81..00ca1824 100644 --- a/klp-ui/src/views/timing/stoppage/index.vue +++ b/klp-ui/src/views/timing/stoppage/index.vue @@ -100,11 +100,12 @@ function fmtDateStr(val) { return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}` } -// duration 单位为分钟,格式化为 Xh Ym 或 Ym +// duration 单位为秒,格式化为 Xh Ym 或 Ym function fmtDurationStr(val) { if (val == null || val === '') return '—' - const mins = Math.round(parseFloat(val)) - if (isNaN(mins)) return String(val) + const secs = parseFloat(val) + if (isNaN(secs)) return String(val) + const mins = Math.round(secs / 60) if (mins < 60) return `${mins}m` const h = Math.floor(mins / 60) const m = mins % 60 @@ -185,10 +186,10 @@ export default { fmtDate(val) { return fmtDateStr(val) }, fmtDuration(val) { return fmtDurationStr(val) }, durationCls(val) { - const mins = parseFloat(val) - if (isNaN(mins)) return '' - if (mins >= 60) return 'dur-high' - if (mins >= 15) return 'dur-mid' + const secs = parseFloat(val) + if (isNaN(secs)) return '' + if (secs >= 3600) return 'dur-high' // >= 1 小时 + if (secs >= 900) return 'dur-mid' // >= 15 分钟 return '' }, stopTypeTag(type) {