diff --git a/apps/web-antd/src/views/aiot/alarm/list/index.vue b/apps/web-antd/src/views/aiot/alarm/list/index.vue index 7347eae3b..8636f71cc 100644 --- a/apps/web-antd/src/views/aiot/alarm/list/index.vue +++ b/apps/web-antd/src/views/aiot/alarm/list/index.vue @@ -22,8 +22,10 @@ import { defineOptions({ name: 'AiotAlarmList' }); /** 格式化持续时长(毫秒 → 可读文本) */ -function formatDuration(ms: number): string { - if (!ms || ms <= 0) return '--'; +function formatDuration(ms: number | null | undefined): string { + // 当 duration_ms 为 null 时,说明告警仍在进行中 + if (ms === null || ms === undefined) return '进行中'; + if (ms <= 0) return '--'; if (ms < 60000) { return `${Math.round(ms / 1000)} 秒`; } @@ -218,10 +220,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ @@ -333,11 +332,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
持续时长: - {{ - currentAlert.durationMs != null && currentAlert.durationMs > 0 - ? formatDuration(currentAlert.durationMs) - : '-' - }} + {{ formatDuration(currentAlert.durationMs) }}
触发时间: