From d8e1ae5dab84530d6b8e252e9bd698961592c738 Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Tue, 10 Mar 2026 11:20:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=91=84=E5=83=8F=E5=A4=B4?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E7=A7=BB=E9=99=A4=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=A0=8F=E3=80=81=E6=8B=89=E6=B5=81=E5=92=8C=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除"状态"列(拉流中/未拉流) - 删除操作栏中"拉流"和"导出"按钮,保留ROI配置、编辑、删除 - 删除搜索栏中"拉流状态"筛选 - 清理无用import和方法(toggleStream/handleExport/startCamera/stopCamera/exportConfig) Co-Authored-By: Claude Opus 4.6 --- .../src/views/aiot/device/camera/index.vue | 78 +------------------ 1 file changed, 2 insertions(+), 76 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 ba24c59dd..d80484e95 100644 --- a/apps/web-antd/src/views/aiot/device/camera/index.vue +++ b/apps/web-antd/src/views/aiot/device/camera/index.vue @@ -29,14 +29,11 @@ import { import { deleteCamera, - exportConfig, getCameraList, getMediaServerList, getRoiByCameraId, pushAllConfig, saveCamera, - startCamera, - stopCamera, } from '#/api/aiot/device'; defineOptions({ name: 'AiotDeviceCamera' }); @@ -52,15 +49,13 @@ const page = ref(1); const pageSize = ref(15); const total = ref(0); const searchQuery = ref(''); -const searchPulling = ref(undefined); const columns = [ { title: '应用名', dataIndex: 'app', width: 120 }, { title: '流ID', dataIndex: 'stream', width: 150 }, { title: '拉流地址', dataIndex: 'srcUrl', ellipsis: true }, - { title: '状态', key: 'pulling', width: 100 }, { title: 'ROI', key: 'roiCount', width: 80, align: 'center' as const }, - { title: '操作', key: 'actions', width: 340, fixed: 'right' as const }, + { title: '操作', key: 'actions', width: 240, fixed: 'right' as const }, ]; // ==================== 编辑弹窗状态 ==================== @@ -114,10 +109,6 @@ async function loadData() { page: page.value, count: pageSize.value, query: searchQuery.value || undefined, - pulling: - searchPulling.value === undefined - ? undefined - : searchPulling.value === 'true', }); cameraList.value = res.list || []; total.value = res.total || 0; @@ -288,23 +279,6 @@ function handleDelete(row: AiotDeviceApi.Camera) { }); } -// ==================== 拉流控制 ==================== - -async function toggleStream(row: AiotDeviceApi.Camera) { - try { - if (row.pulling) { - await stopCamera(row.id!); - message.success('已停止拉流'); - } else { - await startCamera(row.id!); - message.success('开始拉流'); - } - loadData(); - } catch { - message.error('操作失败'); - } -} - // ==================== ROI 配置跳转 ==================== function handleRoiConfig(row: AiotDeviceApi.Camera) { @@ -317,29 +291,6 @@ function handleRoiConfig(row: AiotDeviceApi.Camera) { }); } -// ==================== 配置导出 ==================== - -async function handleExport(row: AiotDeviceApi.Camera) { - const cameraCode = row.cameraCode; - if (!cameraCode) { - message.warning('摄像头编码为空,无法导出'); - return; - } - try { - const data = await exportConfig(cameraCode); - const json = JSON.stringify(data, null, 2); - const blob = new Blob([json], { type: 'application/json' }); - const url = URL.createObjectURL(blob); - const a = document.createElement('a'); - a.href = url; - a.download = `config_${cameraCode}.json`; - a.click(); - URL.revokeObjectURL(url); - } catch { - message.error('导出失败'); - } -} - // ==================== 同步全局配置 ==================== const syncing = ref(false); @@ -401,17 +352,6 @@ onMounted(() => { allow-clear @press-enter="loadData" /> -