From 792424717a466c99c66acbe21de79f208d0b2703 Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Fri, 13 Feb 2026 15:52:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(aiot):=20ROI=E9=85=8D=E7=BD=AE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=E5=BA=94=E7=94=A8=E5=90=8D=E8=80=8C?= =?UTF-8?q?=E4=B8=8D=E6=98=AFcamera=5Fcode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 问题:ROI配置页面显示camera_code(技术标识符),用户体验差 修复: - 摄像头选择器显示应用名 - 页面标题显示应用名(如:测试区域A - ROI配置) - camera_code仅作为后台标识符使用,不暴露给用户 影响页面:/aiot/device/roi --- .../src/views/aiot/device/roi/index.vue | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/apps/web-antd/src/views/aiot/device/roi/index.vue b/apps/web-antd/src/views/aiot/device/roi/index.vue index cf3e99760..ea2c0bf8c 100644 --- a/apps/web-antd/src/views/aiot/device/roi/index.vue +++ b/apps/web-antd/src/views/aiot/device/roi/index.vue @@ -47,6 +47,7 @@ const router = useRouter(); // ==================== 摄像头选择 ==================== const cameraCode = ref(''); +const currentCamera = ref(null); const showCameraSelector = ref(false); const cameraOptions = ref< @@ -74,6 +75,8 @@ onMounted(async () => { const q = route.query; if (q.cameraCode) { cameraCode.value = String(q.cameraCode); + // 加载摄像头信息以获取应用名 + await loadCurrentCamera(); await buildSnapUrl(); loadRois(); } else { @@ -84,6 +87,19 @@ onMounted(async () => { // ==================== 摄像头加载与选择 ==================== +async function loadCurrentCamera() { + try { + const res = await getCameraList({ page: 1, count: 200 }); + const list = res.list || []; + const camera = list.find((c: AiotDeviceApi.Camera) => c.cameraCode === cameraCode.value); + if (camera) { + currentCamera.value = camera; + } + } catch { + console.error('加载摄像头信息失败'); + } +} + async function loadCameraOptions() { cameraLoading.value = true; try { @@ -91,7 +107,7 @@ async function loadCameraOptions() { const list = res.list || []; cameraOptions.value = list.map((cam: AiotDeviceApi.Camera) => ({ value: cam.cameraCode || '', - label: `${cam.cameraCode || cam.stream}${cam.srcUrl ? ` (${cam.srcUrl})` : ''}`, + label: `${cam.app || cam.stream}${cam.srcUrl ? ` (${cam.srcUrl})` : ''}`, camera: cam, })); } catch { @@ -105,6 +121,7 @@ async function onCameraSelected(val: string) { const opt = cameraOptions.value.find((o) => o.value === val); if (opt) { cameraCode.value = val; + currentCamera.value = opt.camera; showCameraSelector.value = false; await buildSnapUrl(); loadRois(); @@ -280,7 +297,7 @@ function handlePush() {