Compare commits

..

No commits in common. "59ab5facd538323182cbda2e1f6410431f35a1c6" and "caf28b0ad79f0e9e96d275f04eaf5a41446931f9" have entirely different histories.

6 changed files with 17 additions and 64 deletions

View File

@ -244,8 +244,7 @@
"Timestamps": "Timestamps", "Timestamps": "Timestamps",
"FormattedTimestamps": "Formatted Timestamps", "FormattedTimestamps": "Formatted Timestamps",
"DevicePath": "DevicePath", "DevicePath": "DevicePath",
"DeviceAddress": "MasterDeviceAddress", "DeviceAddress": "Device Address",
"SubDevice": "SubDevice",
"CacheRefresh": "Cache Refresh", "CacheRefresh": "Cache Refresh",
"TelemetryLog": "Telemetry Log", "TelemetryLog": "Telemetry Log",
"PlatformLog": "Platform Log", "PlatformLog": "Platform Log",

View File

@ -237,8 +237,7 @@
"Timestamps": "UTC时标(纳秒)", "Timestamps": "UTC时标(纳秒)",
"FormattedTimestamps": "本地时间", "FormattedTimestamps": "本地时间",
"DevicePath": "设备路径", "DevicePath": "设备路径",
"DeviceAddress": "主设备地址", "DeviceAddress": "设备地址",
"SubDevice": "从设备地址",
"CacheRefresh": "缓存刷新", "CacheRefresh": "缓存刷新",
"TelemetryLog": "遥测日志", "TelemetryLog": "遥测日志",
"PlatformLog": "平台日志", "PlatformLog": "平台日志",

View File

@ -1,9 +1,3 @@
/*
* @Description:
* @Author:
* @Date: 2025-09-18 10:20:19
* @LastEditors:
*/
import type { import type {
ColumnConfig, ColumnConfig,
DynamicDeviceData, DynamicDeviceData,
@ -43,7 +37,7 @@ const FIXED_FIELDS = [
// 'DataBaseName', // 'DataBaseName',
'DeviceType', 'DeviceType',
'IoTDataType', 'IoTDataType',
'SubDevice', 'DeviceAddress',
'TimestampStr', 'TimestampStr',
'FormattedTimestamps', 'FormattedTimestamps',
'Timestamps', // 添加Timestamps到固定字段列表确保它被隐藏 'Timestamps', // 添加Timestamps到固定字段列表确保它被隐藏

View File

@ -81,11 +81,8 @@ const { IoTDataType, DeviceAddress } = route.query;
// //
const dynamicColumns = ref<any[]>([]); const dynamicColumns = ref<any[]>([]);
// Sub_Device // - IoTDBTreeModelDeviceDataDto
const showSubDeviceColumn = ref(false); const fixedColumns = [
// - IoTDBTreeModelDeviceDataDto
const fixedBaseColumns = [
{ title: '序号', type: 'seq', width: 50, field: 'seq', slots: {} }, { title: '序号', type: 'seq', width: 50, field: 'seq', slots: {} },
{ {
field: 'TimestampStr', field: 'TimestampStr',
@ -124,32 +121,14 @@ const fixedBaseColumns = [
}, },
]; ];
// Sub_Device
const subDeviceColumn = {
field: 'SubDevice',
title: $t('abp.IoTDBBase.SubDevice'),
minWidth: 150,
showOverflow: true,
slots: {},
};
// - 使 // - 使
const allColumns = computed(() => { const allColumns = computed(() => {
// //
if (!isGridInitialized.value) { if (!isGridInitialized.value) {
const baseColumns = [...fixedBaseColumns]; return [...fixedColumns];
if (showSubDeviceColumn.value) {
baseColumns.push(subDeviceColumn);
}
return baseColumns;
} }
const columns = [...fixedBaseColumns]; const columns = [...fixedColumns];
// DeviceType Sub_Device
if (showSubDeviceColumn.value) {
columns.push(subDeviceColumn);
}
// //
if (dynamicColumns.value && Array.isArray(dynamicColumns.value)) { if (dynamicColumns.value && Array.isArray(dynamicColumns.value)) {
@ -171,9 +150,6 @@ const initDefaultColumns = () => {
if (!Array.isArray(dynamicColumns.value)) { if (!Array.isArray(dynamicColumns.value)) {
dynamicColumns.value = []; dynamicColumns.value = [];
} }
// Sub_Device
showSubDeviceColumn.value = false;
}; };
// //
@ -200,21 +176,13 @@ const formOptions: VbenFormProps = {
return; return;
} }
// DeviceType Sub_Device
if (changedFields.includes('DeviceType')) {
// DeviceTypeEnum: =0, =1, =2, =3
const deviceType = values.DeviceType;
showSubDeviceColumn.value =
deviceType === 3 || deviceType === '3';
}
// //
const relevantFields = new Set([ const relevantFields = new Set([
'DeviceAddress', 'DeviceAddress',
'DeviceType',
'EndCreationTime', 'EndCreationTime',
'IoTDataType', 'IoTDataType',
'StartCreationTime', 'StartCreationTime',
'DeviceType',
]); ]);
const hasRelevantChange = changedFields.some((field) => const hasRelevantChange = changedFields.some((field) =>
relevantFields.has(field), relevantFields.has(field),
@ -284,7 +252,7 @@ const gridOptions: VxeGridProps<any> = {
highlight: true, highlight: true,
labelField: 'name', labelField: 'name',
}, },
columns: fixedBaseColumns, // 使 columns: fixedColumns, // 使
height: 'auto', height: 'auto',
keepSource: true, keepSource: true,
// //

View File

@ -6,7 +6,6 @@ export interface BaseDeviceData {
IoTDataType?: string; IoTDataType?: string;
DeviceType?: string; DeviceType?: string;
DeviceId?: string; DeviceId?: string;
SubDevice?: string;
Timestamps?: string; Timestamps?: string;
[key: string]: any; // 允许任意额外字段 [key: string]: any; // 允许任意额外字段
} }
@ -18,7 +17,7 @@ export interface DynamicDeviceData extends BaseDeviceData {
// 分页响应类型 // 分页响应类型
export interface DynamicPageResponse<T = DynamicDeviceData> { export interface DynamicPageResponse<T = DynamicDeviceData> {
items?: null | T[]; items?: T[] | null;
totalCount?: number; totalCount?: number;
[key: string]: any; // 允许任意额外字段 [key: string]: any; // 允许任意额外字段
} }
@ -27,8 +26,8 @@ export interface DynamicPageResponse<T = DynamicDeviceData> {
export interface ColumnConfig { export interface ColumnConfig {
field: string; field: string;
title: string; title: string;
minWidth?: number | string; minWidth?: string | number;
width?: number | string; width?: string | number;
showOverflow?: boolean; showOverflow?: boolean;
formatter?: (value: any) => string; formatter?: (value: any) => string;
slots?: Record<string, any>; // 添加slots属性 slots?: Record<string, any>; // 添加slots属性
@ -43,10 +42,10 @@ export interface FieldMapping {
// 字段类型配置类型 // 字段类型配置类型
export interface FieldTypeConfig { export interface FieldTypeConfig {
[key: string]: { [key: string]: {
[key: string]: any;
formatter?: (value: any) => string; formatter?: (value: any) => string;
minWidth?: number | string; width?: string | number;
minWidth?: string | number;
slots?: Record<string, any>; slots?: Record<string, any>;
width?: number | string; [key: string]: any;
}; };
} }

View File

@ -107,12 +107,6 @@ export const tableSchema: any = computed((): VxeGridProps['columns'] => [
minWidth: '120', minWidth: '120',
slots: {}, slots: {},
}, },
{
field: 'subDevice',
title: $t('abp.IoTDBBase.SubDevice'),
minWidth: '120',
slots: {},
},
{ {
field: 'messageType', field: 'messageType',
title: $t('abp.OneNETLog.MessageType'), title: $t('abp.OneNETLog.MessageType'),