fix(device-alarm-history-diag-card): throw error if deviceId is undefined/null

This commit is contained in:
yangsy
2025-12-08 11:15:45 +08:00
parent 70f52eb3bb
commit 15a9f68db7

View File

@@ -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<PageParams<{ id: string }>, 'model' | 'extra'> = {