From e54fcf1f8cbb598838a72de8098ca278e859aba7 Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Wed, 11 Feb 2026 09:57:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(aiot):=20=E5=91=8A=E8=AD=A6=E6=88=AA?= =?UTF-8?q?=E5=9B=BE=E5=B1=95=E7=A4=BA=20+=20=E5=85=A8=E5=B1=80=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=90=8C=E6=AD=A5=20+=20API=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 告警列表新增截图缩略图列,支持预览大图 - 告警详情显示截图 URL 链接 - 摄像头管理页新增「同步全局配置」按钮 - 告警 API 路径修正: camera-summary → device-summary - 告警 ID 兼容 alarmId 字符串格式 - Vite 代理新增 /uploads、/captures、/aiot/storage 路由 Co-Authored-By: Claude Opus 4.6 --- apps/web-antd/src/api/aiot/alarm/index.ts | 15 ++++++--- apps/web-antd/src/api/aiot/device/index.ts | 7 ++++ .../src/views/aiot/alarm/list/data.ts | 7 ++++ .../src/views/aiot/alarm/list/index.vue | 32 +++++++++++++++++-- .../src/views/aiot/device/camera/index.vue | 26 ++++++++++++++- apps/web-antd/vite.config.mts | 15 +++++++++ 6 files changed, 94 insertions(+), 8 deletions(-) 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({ + + +