fix(aiot): 修复摄像头保存失败 + 标题改为摄像头管理系统

- saveCamera 拆分为 addCamera/updateCamera 匹配WVP实际接口
- .env 标题改为"摄像头管理系统"
- 告警列表字段适配新三表结构
- preferences 配置调整

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-10 15:22:31 +08:00
parent 4b54a50d8c
commit 777e52986e
5 changed files with 17 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
# 应用标题
VITE_APP_TITLE=芋道管理系统
VITE_APP_TITLE=摄像头管理系统
# 应用命名空间用于缓存、store等功能的前缀确保隔离
VITE_APP_NAMESPACE=yudao-vben-antd

View File

@@ -107,9 +107,19 @@ export function getCameraList(params: {
);
}
/** 新增摄像头 */
export function addCamera(data: Partial<AiotDeviceApi.Camera>) {
return wvpRequestClient.post('/aiot/device/proxy/add', data);
}
/** 编辑摄像头 */
export function updateCamera(data: Partial<AiotDeviceApi.Camera>) {
return wvpRequestClient.post('/aiot/device/proxy/update', data);
}
/** 保存摄像头(新增/编辑,有 id 为编辑) */
export function saveCamera(data: Partial<AiotDeviceApi.Camera>) {
return wvpRequestClient.post('/aiot/device/proxy/save', data);
return data.id ? updateCamera(data) : addCamera(data);
}
/** 删除摄像头 */

View File

@@ -75,7 +75,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'alertNo',
title: '告警编号',
minWidth: 160,
width: 210,
},
{
field: 'cameraId',
@@ -98,7 +98,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
{
field: 'durationMinutes',
title: '持续时长',
minWidth: 100,
width: 125,
slots: { default: 'duration' },
},
{
@@ -127,7 +127,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
},
{
title: '操作',
width: 150,
width: 180,
fixed: 'right',
slots: { default: 'actions' },
},

View File

@@ -176,7 +176,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
<template>
<Page auto-content-height>
<Grid table-title="AI告警列表">
<Grid table-title="告警列表">
<!-- 摄像头列 -->
<template #camera="{ row }">
<span class="font-medium">{{ row.cameraId || '-' }}</span>

View File

@@ -114,7 +114,7 @@ const defaultPreferences: Preferences = {
colorPrimary: 'hsl(212 100% 45%)',
colorSuccess: 'hsl(144 57% 58%)',
colorWarning: 'hsl(42 84% 61%)',
mode: 'dark',
mode: 'light',
radius: '0.5',
fontSize: 16,
semiDarkHeader: false,