From 286f4a1a032496da227c596de7750a33f55df90f Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Wed, 25 Feb 2026 13:55:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(aiot):=20=E6=B7=BB=E5=8A=A0=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=90=8D=E4=B8=8B=E6=8B=89=E9=80=89=E6=8B=A9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E5=B7=B2?= =?UTF-8?q?=E6=9C=89=E6=88=96=E8=BE=93=E5=85=A5=E6=96=B0=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/aiot/device/camera/index.vue | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) 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 e988e7a5f..89fd1808d 100644 --- a/apps/web-antd/src/views/aiot/device/camera/index.vue +++ b/apps/web-antd/src/views/aiot/device/camera/index.vue @@ -7,7 +7,7 @@ */ import type { AiotDeviceApi } from '#/api/aiot/device'; -import { onMounted, reactive, ref, watch } from 'vue'; +import { computed, onMounted, reactive, ref, watch } from 'vue'; import { useRouter } from 'vue-router'; import { Page } from '@vben/common-ui'; @@ -84,6 +84,26 @@ const editForm = reactive>({ ffmpegCmdKey: '', }); +// 从已有摄像头中提取应用名选项 +const appOptions = computed(() => { + // 统计每个应用名下的摄像头数量 + const appCounts = new Map(); + cameraList.value.forEach((cam) => { + if (cam.app) { + appCounts.set(cam.app, (appCounts.get(cam.app) || 0) + 1); + } + }); + + // 转换为选项数组,按摄像头数量降序排序 + return Array.from(appCounts.entries()) + .map(([app, count]) => ({ + label: `${app} (${count}个)`, + value: app, + count, + })) + .sort((a, b) => b.count - a.count); +}); + // ==================== 数据加载 ==================== async function loadData() { @@ -486,12 +506,16 @@ onMounted(() => { -
- 场景名称,同一场景下可有多个摄像头(可修改) + 场景名称,同一场景下可有多个摄像头(可选择已有或输入新名称)