优化数据列表展示,子设备新增地址列
This commit is contained in:
parent
caf28b0ad7
commit
3ac2ed83e9
@ -244,7 +244,8 @@
|
||||
"Timestamps": "Timestamps",
|
||||
"FormattedTimestamps": "Formatted Timestamps",
|
||||
"DevicePath": "DevicePath",
|
||||
"DeviceAddress": "Device Address",
|
||||
"DeviceAddress": "MasterDeviceAddress",
|
||||
"SubDevice": "SubDevice",
|
||||
"CacheRefresh": "Cache Refresh",
|
||||
"TelemetryLog": "Telemetry Log",
|
||||
"PlatformLog": "Platform Log",
|
||||
|
||||
@ -237,7 +237,8 @@
|
||||
"Timestamps": "UTC时标(纳秒)",
|
||||
"FormattedTimestamps": "本地时间",
|
||||
"DevicePath": "设备路径",
|
||||
"DeviceAddress": "设备地址",
|
||||
"DeviceAddress": "主设备地址",
|
||||
"SubDevice": "从设备地址",
|
||||
"CacheRefresh": "缓存刷新",
|
||||
"TelemetryLog": "遥测日志",
|
||||
"PlatformLog": "平台日志",
|
||||
|
||||
@ -1,3 +1,9 @@
|
||||
/*
|
||||
* @Description: 文件内容描述
|
||||
* @Author: 陈益
|
||||
* @Date: 2025-09-18 10:20:19
|
||||
* @LastEditors: 陈益
|
||||
*/
|
||||
import type {
|
||||
ColumnConfig,
|
||||
DynamicDeviceData,
|
||||
@ -37,7 +43,7 @@ const FIXED_FIELDS = [
|
||||
// 'DataBaseName',
|
||||
'DeviceType',
|
||||
'IoTDataType',
|
||||
'DeviceAddress',
|
||||
'SubDevice',
|
||||
'TimestampStr',
|
||||
'FormattedTimestamps',
|
||||
'Timestamps', // 添加Timestamps到固定字段列表,确保它被隐藏
|
||||
|
||||
@ -119,6 +119,13 @@ const fixedColumns = [
|
||||
showOverflow: true,
|
||||
slots: {},
|
||||
},
|
||||
{
|
||||
field: 'SubDevice',
|
||||
title: $t('abp.IoTDBBase.SubDevice'),
|
||||
minWidth: 150,
|
||||
showOverflow: true,
|
||||
slots: {},
|
||||
},
|
||||
];
|
||||
|
||||
// 合并固定列和动态列 - 使用计算属性确保响应式
|
||||
@ -179,10 +186,10 @@ const formOptions: VbenFormProps = {
|
||||
// 当任何相关字段发生变化时,刷新表格数据
|
||||
const relevantFields = new Set([
|
||||
'DeviceAddress',
|
||||
'DeviceType',
|
||||
'EndCreationTime',
|
||||
'IoTDataType',
|
||||
'StartCreationTime',
|
||||
'DeviceType',
|
||||
]);
|
||||
const hasRelevantChange = changedFields.some((field) =>
|
||||
relevantFields.has(field),
|
||||
|
||||
@ -6,10 +6,11 @@ export interface BaseDeviceData {
|
||||
IoTDataType?: string;
|
||||
DeviceType?: string;
|
||||
DeviceId?: string;
|
||||
SubDevice?: string;
|
||||
Timestamps?: string;
|
||||
[key: string]: any; // 允许任意额外字段
|
||||
}
|
||||
|
||||
|
||||
// 动态设备数据类型
|
||||
export interface DynamicDeviceData extends BaseDeviceData {
|
||||
[key: string]: any; // 允许任意字段
|
||||
@ -17,7 +18,7 @@ export interface DynamicDeviceData extends BaseDeviceData {
|
||||
|
||||
// 分页响应类型
|
||||
export interface DynamicPageResponse<T = DynamicDeviceData> {
|
||||
items?: T[] | null;
|
||||
items?: null | T[];
|
||||
totalCount?: number;
|
||||
[key: string]: any; // 允许任意额外字段
|
||||
}
|
||||
@ -26,8 +27,8 @@ export interface DynamicPageResponse<T = DynamicDeviceData> {
|
||||
export interface ColumnConfig {
|
||||
field: string;
|
||||
title: string;
|
||||
minWidth?: string | number;
|
||||
width?: string | number;
|
||||
minWidth?: number | string;
|
||||
width?: number | string;
|
||||
showOverflow?: boolean;
|
||||
formatter?: (value: any) => string;
|
||||
slots?: Record<string, any>; // 添加slots属性
|
||||
@ -42,10 +43,10 @@ export interface FieldMapping {
|
||||
// 字段类型配置类型
|
||||
export interface FieldTypeConfig {
|
||||
[key: string]: {
|
||||
formatter?: (value: any) => string;
|
||||
width?: string | number;
|
||||
minWidth?: string | number;
|
||||
slots?: Record<string, any>;
|
||||
[key: string]: any;
|
||||
formatter?: (value: any) => string;
|
||||
minWidth?: number | string;
|
||||
slots?: Record<string, any>;
|
||||
width?: number | string;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user