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()), }, }, {