diff --git a/apps/web-antd/src/api/aiot/alarm/index.ts b/apps/web-antd/src/api/aiot/alarm/index.ts index 40126c09d..f1b352e01 100644 --- a/apps/web-antd/src/api/aiot/alarm/index.ts +++ b/apps/web-antd/src/api/aiot/alarm/index.ts @@ -5,7 +5,8 @@ import { requestClient } from '#/api/request'; export namespace AiotAlarmApi { /** AI 告警 VO */ export interface Alert { - id?: number; + id?: number | string; + alarmId?: string; alertNo?: string; cameraId?: string; cameraName?: string; @@ -81,21 +82,25 @@ export function getAlertPage(params: PageParam) { } /** 获取告警详情 */ -export function getAlert(id: number) { +export function getAlert(id: number | string) { return requestClient.get( `/aiot/alarm/alert/get?id=${id}`, ); } /** 处理告警 */ -export function handleAlert(id: number, status: string, remark?: string) { +export function handleAlert( + id: number | string, + status: string, + remark?: string, +) { return requestClient.put('/aiot/alarm/alert/handle', null, { params: { id, status, remark }, }); } /** 删除告警 */ -export function deleteAlert(id: number) { +export function deleteAlert(id: number | string) { return requestClient.delete(`/aiot/alarm/alert/delete?id=${id}`); } @@ -112,7 +117,7 @@ export function getAlertStatistics(startTime?: string, endTime?: string) { /** 以摄像头维度获取告警汇总 */ export function getCameraAlertSummary(params: PageParam) { return requestClient.get>( - '/aiot/alarm/camera-summary/page', + '/aiot/alarm/device-summary/page', { params }, ); } diff --git a/apps/web-antd/src/api/aiot/device/index.ts b/apps/web-antd/src/api/aiot/device/index.ts index 0d352279e..ccf6fbedb 100644 --- a/apps/web-antd/src/api/aiot/device/index.ts +++ b/apps/web-antd/src/api/aiot/device/index.ts @@ -244,6 +244,13 @@ export function pushConfig(cameraId: string) { }); } +/** 一次性推送全部配置到本地Edge */ +export function pushAllConfig() { + return wvpRequestClient.post>( + '/aiot/device/config/push-all', + ); +} + /** 导出摄像头配置 JSON */ export function exportConfig(cameraId: string) { return wvpRequestClient.get>( diff --git a/apps/web-antd/src/views/aiot/alarm/list/data.ts b/apps/web-antd/src/views/aiot/alarm/list/data.ts index f37708579..857edea97 100644 --- a/apps/web-antd/src/views/aiot/alarm/list/data.ts +++ b/apps/web-antd/src/views/aiot/alarm/list/data.ts @@ -119,6 +119,13 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { minWidth: 170, formatter: 'formatDateTime', }, + { + field: 'snapshotUrl', + title: '截图', + width: 80, + align: 'center' as const, + slots: { default: 'snapshot' }, + }, { field: 'createdAt', title: '创建时间', 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 5e7076ca8..c4bf64c73 100644 --- a/apps/web-antd/src/views/aiot/alarm/list/index.vue +++ b/apps/web-antd/src/views/aiot/alarm/list/index.vue @@ -84,7 +84,12 @@ function getLevelColor(level?: string) { /** 查看告警详情 */ async function handleView(row: AiotAlarmApi.Alert) { try { - const alert = await getAlert(row.id as number); + const alertId = row.alarmId || row.id; + if (!alertId) { + message.error('告警ID为空'); + return; + } + const alert = await getAlert(alertId); currentAlert.value = alert; detailVisible.value = true; } catch (error) { @@ -119,7 +124,7 @@ async function handleProcess(row: AiotAlarmApi.Alert, status: string) { duration: 0, }); try { - await handleAlert(row.id as number, status, remark); + await handleAlert(row.alarmId || row.id!, status, remark); message.success(`${statusText}成功`); handleRefresh(); } catch (error) { @@ -217,6 +222,19 @@ const [Grid, gridApi] = useVbenVxeGrid({ + + +