功能:告警列表摄像头搜索改为下拉选择+输入搜索

- 新增 getCameraOptions API(从 WVP 获取摄像头列表)
- 搜索框改为 ApiSelect 组件,支持下拉选择和输入前缀匹配
- 选中后用 cameraCode 查询后端
This commit is contained in:
2026-03-19 11:36:56 +08:00
parent 4c287ca690
commit 617cdc8c15
2 changed files with 20 additions and 2 deletions

View File

@@ -147,6 +147,13 @@ export function getMediaServerList() {
);
}
/** 摄像头选项列表(用于下拉搜索选择) */
export function getCameraOptions() {
return wvpRequestClient.get<
{ cameraCode: string; cameraName: string }[]
>('/aiot/device/camera/options');
}
// ==================== ROI 区域管理 ====================
/** ROI 列表(分页) */

View File

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