From e2bde76f20a8dfc1c93567d5d90a9df5ed044ace Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Sun, 8 Feb 2026 23:24:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(aiot-device):=20=E9=87=8D=E5=86=99=20ROI?= =?UTF-8?q?=20=E9=85=8D=E7=BD=AE=E9=A1=B5=E9=9D=A2=EF=BC=8C=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=20WVP=20=E7=94=BB=E5=B8=83=E5=BC=8F=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 从 WVP 的 roiConfig 整套组件迁移至 Vue3 + Ant Design: ROI 配置主页面 (roi/index.vue): - 无参数时显示摄像头选择器,有参数时直接进入配置 - 左侧画布面板 + 右侧 ROI 列表/属性/算法侧边栏 - 画矩形(拖拽)、画多边形(点击+双击完成) - ROI 属性编辑:名称、颜色、优先级、描述 - 推送配置到边缘端 RoiCanvas 组件 (roi/components/RoiCanvas.vue): - Canvas 叠加在摄像头截图上,归一化坐标 (0-1) - 矩形拖拽绘制、多边形逐点绘制 - ROI 选中高亮、点击选择、右键删除 - 窗口 resize 自适应 RoiAlgorithmBind 组件 (roi/components/RoiAlgorithmBind.vue): - 算法列表加载、绑定/解绑操作 - 启用/禁用开关、参数配置入口 AlgorithmParamEditor 组件 (roi/components/AlgorithmParamEditor.vue): - 根据 JSON Schema 动态生成表单 - 支持 int(数字输入)、list(标签列表)、string(文本输入) - 参数保存到后端 删除旧的 data.ts(VxeGrid 列定义,已不再使用) Co-Authored-By: Claude Opus 4.6 --- .../roi/components/AlgorithmParamEditor.vue | 165 +++++ .../roi/components/RoiAlgorithmBind.vue | 229 +++++++ .../aiot/device/roi/components/RoiCanvas.vue | 354 +++++++++++ .../src/views/aiot/device/roi/data.ts | 40 -- .../src/views/aiot/device/roi/index.vue | 567 +++++++++++++++--- 5 files changed, 1243 insertions(+), 112 deletions(-) create mode 100644 apps/web-antd/src/views/aiot/device/roi/components/AlgorithmParamEditor.vue create mode 100644 apps/web-antd/src/views/aiot/device/roi/components/RoiAlgorithmBind.vue create mode 100644 apps/web-antd/src/views/aiot/device/roi/components/RoiCanvas.vue delete mode 100644 apps/web-antd/src/views/aiot/device/roi/data.ts diff --git a/apps/web-antd/src/views/aiot/device/roi/components/AlgorithmParamEditor.vue b/apps/web-antd/src/views/aiot/device/roi/components/AlgorithmParamEditor.vue new file mode 100644 index 000000000..42deca53f --- /dev/null +++ b/apps/web-antd/src/views/aiot/device/roi/components/AlgorithmParamEditor.vue @@ -0,0 +1,165 @@ + + + diff --git a/apps/web-antd/src/views/aiot/device/roi/components/RoiAlgorithmBind.vue b/apps/web-antd/src/views/aiot/device/roi/components/RoiAlgorithmBind.vue new file mode 100644 index 000000000..7f984bedd --- /dev/null +++ b/apps/web-antd/src/views/aiot/device/roi/components/RoiAlgorithmBind.vue @@ -0,0 +1,229 @@ + + + diff --git a/apps/web-antd/src/views/aiot/device/roi/components/RoiCanvas.vue b/apps/web-antd/src/views/aiot/device/roi/components/RoiCanvas.vue new file mode 100644 index 000000000..d4080fee1 --- /dev/null +++ b/apps/web-antd/src/views/aiot/device/roi/components/RoiCanvas.vue @@ -0,0 +1,354 @@ + + + + + diff --git a/apps/web-antd/src/views/aiot/device/roi/data.ts b/apps/web-antd/src/views/aiot/device/roi/data.ts deleted file mode 100644 index 67dcee6d5..000000000 --- a/apps/web-antd/src/views/aiot/device/roi/data.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { VxeTableGridOptions } from '#/adapter/vxe-table'; - -/** ROI 列表字段 */ -export function useRoiGridColumns(): VxeTableGridOptions['columns'] { - return [ - { - field: 'name', - title: 'ROI 名称', - minWidth: 150, - }, - { - field: 'channelName', - title: '摄像头', - minWidth: 150, - }, - { - field: 'type', - title: '类型', - minWidth: 100, - }, - { - field: 'enabled', - title: '启用状态', - minWidth: 90, - slots: { default: 'enabled' }, - }, - { - field: 'createdAt', - title: '创建时间', - minWidth: 170, - formatter: 'formatDateTime', - }, - { - title: '操作', - width: 120, - fixed: 'right', - slots: { default: 'actions' }, - }, - ]; -} 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 b31993e8f..f9dfa30b9 100644 --- a/apps/web-antd/src/views/aiot/device/roi/index.vue +++ b/apps/web-antd/src/views/aiot/device/roi/index.vue @@ -1,99 +1,522 @@ + +