fix(aiot): 修复摄像头保存失败 + 标题改为摄像头管理系统
- saveCamera 拆分为 addCamera/updateCamera 匹配WVP实际接口 - .env 标题改为"摄像头管理系统" - 告警列表字段适配新三表结构 - preferences 配置调整 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# 应用标题
|
# 应用标题
|
||||||
VITE_APP_TITLE=芋道管理系统
|
VITE_APP_TITLE=摄像头管理系统
|
||||||
|
|
||||||
# 应用命名空间,用于缓存、store等功能的前缀,确保隔离
|
# 应用命名空间,用于缓存、store等功能的前缀,确保隔离
|
||||||
VITE_APP_NAMESPACE=yudao-vben-antd
|
VITE_APP_NAMESPACE=yudao-vben-antd
|
||||||
|
|||||||
@@ -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 为编辑) */
|
/** 保存摄像头(新增/编辑,有 id 为编辑) */
|
||||||
export function saveCamera(data: Partial<AiotDeviceApi.Camera>) {
|
export function saveCamera(data: Partial<AiotDeviceApi.Camera>) {
|
||||||
return wvpRequestClient.post('/aiot/device/proxy/save', data);
|
return data.id ? updateCamera(data) : addCamera(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除摄像头 */
|
/** 删除摄像头 */
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
{
|
{
|
||||||
field: 'alertNo',
|
field: 'alertNo',
|
||||||
title: '告警编号',
|
title: '告警编号',
|
||||||
minWidth: 160,
|
width: 210,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'cameraId',
|
field: 'cameraId',
|
||||||
@@ -98,7 +98,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
{
|
{
|
||||||
field: 'durationMinutes',
|
field: 'durationMinutes',
|
||||||
title: '持续时长',
|
title: '持续时长',
|
||||||
minWidth: 100,
|
width: 125,
|
||||||
slots: { default: 'duration' },
|
slots: { default: 'duration' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -127,7 +127,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
width: 150,
|
width: 180,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Page auto-content-height>
|
<Page auto-content-height>
|
||||||
<Grid table-title="AI告警列表">
|
<Grid table-title="告警列表">
|
||||||
<!-- 摄像头列 -->
|
<!-- 摄像头列 -->
|
||||||
<template #camera="{ row }">
|
<template #camera="{ row }">
|
||||||
<span class="font-medium">{{ row.cameraId || '-' }}</span>
|
<span class="font-medium">{{ row.cameraId || '-' }}</span>
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ const defaultPreferences: Preferences = {
|
|||||||
colorPrimary: 'hsl(212 100% 45%)',
|
colorPrimary: 'hsl(212 100% 45%)',
|
||||||
colorSuccess: 'hsl(144 57% 58%)',
|
colorSuccess: 'hsl(144 57% 58%)',
|
||||||
colorWarning: 'hsl(42 84% 61%)',
|
colorWarning: 'hsl(42 84% 61%)',
|
||||||
mode: 'dark',
|
mode: 'light',
|
||||||
radius: '0.5',
|
radius: '0.5',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
semiDarkHeader: false,
|
semiDarkHeader: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user