功能:摄像头页面增加区域选择器
1. 编辑弹窗新增「所属区域」下拉框,支持搜索,数据来自 IoT 平台 2. 表格新增「区域」列显示已绑定的区域名称 3. API 新增 getAreaList 函数查询 vsp-service 区域列表接口 4. Vite 代理新增 /api/area → vsp-service:8000 5. Camera 类型新增 areaId 字段
This commit is contained in:
@@ -45,6 +45,7 @@ export namespace AiotDeviceApi {
|
||||
mediaServerId?: string;
|
||||
streamKey?: string;
|
||||
createTime?: string;
|
||||
areaId?: number; // 所属区域ID
|
||||
}
|
||||
|
||||
/** ROI 区域 */
|
||||
@@ -299,3 +300,15 @@ export async function getAlertImageUrl(imagePath: string): Promise<string> {
|
||||
`&access-token=${encodeURIComponent(token)}`
|
||||
);
|
||||
}
|
||||
|
||||
// ==================== 区域列表 ====================
|
||||
|
||||
/** 获取区域列表(从 IoT 平台代理查询) */
|
||||
export async function getAreaList(): Promise<
|
||||
{ id: number; areaName: string; parentId?: number }[]
|
||||
> {
|
||||
const resp = await fetch(`${apiURL}/api/area/list`);
|
||||
const json = await resp.json();
|
||||
if (json.code === 0) return json.data || [];
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user