From 15a9f68db7ed82b10185d248a1b8eda1c2725153 Mon Sep 17 00:00:00 2001 From: yangsy Date: Mon, 8 Dec 2025 11:15:45 +0800 Subject: [PATCH] fix(device-alarm-history-diag-card): throw error if deviceId is undefined/null --- .../history-diag-card/device-alarm-history-diag-card.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/device-page/device-card/history-diag-card/device-alarm-history-diag-card.vue b/src/components/device-page/device-card/history-diag-card/device-alarm-history-diag-card.vue index 9a4b508..4201335 100644 --- a/src/components/device-page/device-card/history-diag-card/device-alarm-history-diag-card.vue +++ b/src/components/device-page/device-card/history-diag-card/device-alarm-history-diag-card.vue @@ -78,6 +78,7 @@ const { mutate: getDeviceAlarmLogList, isPending } = useMutation({ if (!dateTimeRange.value) throw new Error('请选择时间范围'); const range = dateTimeRange.value as [number, number]; const deviceId = ndmDevice.value.deviceId; + if (!deviceId) throw new Error('该设备未配置设备ID'); const alarmDate_ge = range[0]; const alarmDate_le = range[1]; const restParams: Omit, 'model' | 'extra'> = {