From 617cdc8c15a9316074ccc5c197445fe163a1dc0a Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Thu, 19 Mar 2026 11:36:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=9A=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=91=84=E5=83=8F=E5=A4=B4=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=B8=8B=E6=8B=89=E9=80=89=E6=8B=A9+?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 getCameraOptions API(从 WVP 获取摄像头列表) - 搜索框改为 ApiSelect 组件,支持下拉选择和输入前缀匹配 - 选中后用 cameraCode 查询后端 --- apps/web-antd/src/api/aiot/device/index.ts | 7 +++++++ apps/web-antd/src/views/aiot/alarm/list/data.ts | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/apps/web-antd/src/api/aiot/device/index.ts b/apps/web-antd/src/api/aiot/device/index.ts index 9b52aa2de..15ed3319b 100644 --- a/apps/web-antd/src/api/aiot/device/index.ts +++ b/apps/web-antd/src/api/aiot/device/index.ts @@ -147,6 +147,13 @@ export function getMediaServerList() { ); } +/** 摄像头选项列表(用于下拉搜索选择) */ +export function getCameraOptions() { + return wvpRequestClient.get< + { cameraCode: string; cameraName: string }[] + >('/aiot/device/camera/options'); +} + // ==================== ROI 区域管理 ==================== /** ROI 列表(分页) */ 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 839cabbe0..aed864917 100644 --- a/apps/web-antd/src/views/aiot/alarm/list/data.ts +++ b/apps/web-antd/src/views/aiot/alarm/list/data.ts @@ -33,10 +33,21 @@ export function useGridFormSchema(): VbenFormSchema[] { { fieldName: 'cameraId', label: '摄像头', - component: 'Input', + component: 'ApiSelect', componentProps: { - placeholder: '请输入摄像头ID', + api: async () => { + const { getCameraOptions } = await import('#/api/aiot/device'); + const list = await getCameraOptions(); + return list.map((item: { cameraCode: string; cameraName: string }) => ({ + label: item.cameraName, + value: item.cameraCode, + })); + }, + placeholder: '请选择摄像头', allowClear: true, + showSearch: true, + filterOption: (input: string, option: { label: string }) => + option.label.toLowerCase().includes(input.toLowerCase()), }, }, {