diff --git a/apps/web-antd/src/api/aiot/device/index.ts b/apps/web-antd/src/api/aiot/device/index.ts index e81295230..2a4cab599 100644 --- a/apps/web-antd/src/api/aiot/device/index.ts +++ b/apps/web-antd/src/api/aiot/device/index.ts @@ -45,7 +45,6 @@ export namespace AiotDeviceApi { mediaServerId?: string; streamKey?: string; createTime?: string; - areaId?: number; // 所属区域ID } /** ROI 区域 */ @@ -300,15 +299,3 @@ export async function getAlertImageUrl(imagePath: string): Promise { `&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 []; -} diff --git a/apps/web-antd/src/views/aiot/device/camera/index.vue b/apps/web-antd/src/views/aiot/device/camera/index.vue index d3449b746..433129a5f 100644 --- a/apps/web-antd/src/views/aiot/device/camera/index.vue +++ b/apps/web-antd/src/views/aiot/device/camera/index.vue @@ -30,7 +30,6 @@ import { import { deleteCamera, - getAreaList, getCameraList, getMediaServerList, getRoiByCameraId, @@ -60,7 +59,6 @@ const columns = [ { title: '摄像头名称', dataIndex: 'cameraName', width: 150 }, { title: '拉流地址', dataIndex: 'srcUrl', ellipsis: true }, { title: '边缘设备', dataIndex: 'edgeDeviceId', width: 100 }, - { title: '区域', key: 'areaName', width: 100 }, { title: '状态', key: 'status', width: 60, align: 'center' as const }, { title: 'ROI', key: 'roiCount', width: 80, align: 'center' as const }, { title: '操作', key: 'actions', width: 240, fixed: 'right' as const }, @@ -72,7 +70,6 @@ const editModalOpen = ref(false); const editModalTitle = ref('添加摄像头'); const saving = ref(false); const mediaServerOptions = ref<{ label: string; value: string }[]>([]); -const areaOptions = ref<{ label: string; value: number }[]>([]); const editForm = reactive>({ id: undefined, type: 'default', @@ -89,7 +86,6 @@ const editForm = reactive>({ enableDisableNoneReader: true, relatesMediaServerId: '', ffmpegCmdKey: '', - areaId: undefined as number | undefined, }); // 从已有摄像头中提取应用名选项 @@ -112,15 +108,6 @@ const appOptions = computed(() => { .sort((a, b) => b.count - a.count); }); -// 区域名称映射(area_id → area_name) -const areaNameMap = computed(() => { - const map: Record = {}; - areaOptions.value.forEach((a) => { - map[a.value] = a.label; - }); - return map; -}); - // ==================== 数据加载 ==================== async function loadData() { @@ -186,18 +173,6 @@ async function loadMediaServers() { } } -async function loadAreaOptions() { - try { - const list = await getAreaList(); - areaOptions.value = list.map((a: any) => ({ - label: a.areaName || a.name || `区域${a.id}`, - value: a.id, - })); - } catch { - areaOptions.value = []; - } -} - // ==================== 新增 / 编辑 ==================== function resetForm() { @@ -217,7 +192,6 @@ function resetForm() { enableDisableNoneReader: true, relatesMediaServerId: '', ffmpegCmdKey: '', - areaId: undefined, }); } @@ -260,7 +234,6 @@ function handleAdd() { editModalTitle.value = '添加摄像头'; editModalOpen.value = true; loadMediaServers(); - loadAreaOptions(); // 自动填充流ID autoFillStreamId(); } @@ -283,12 +256,10 @@ function handleEdit(row: AiotDeviceApi.Camera) { enableDisableNoneReader: row.enableDisableNoneReader ?? true, relatesMediaServerId: row.relatesMediaServerId || '', ffmpegCmdKey: row.ffmpegCmdKey || '', - areaId: row.areaId || undefined, }); editModalTitle.value = '编辑摄像头'; editModalOpen.value = true; loadMediaServers(); - loadAreaOptions(); } async function handleSave() { @@ -397,7 +368,6 @@ watch( onMounted(() => { loadData(); - loadAreaOptions(); }); @@ -451,13 +421,7 @@ onMounted(() => { size="middle" >