112 lines
2.6 KiB
TypeScript
Raw Normal View History

2025-06-25 17:29:57 +08:00
import type { VxeGridProps } from '#/adapter/vxe-table';
import { computed } from 'vue';
import dayjs from 'dayjs';
import { $t } from '#/locales';
export const querySchema = computed(() => [
{
component: 'Input',
fieldName: 'FocusAddress',
2025-07-11 00:15:57 +08:00
label: $t('abp.OneNETLog.FocusAddress'),
},
{
component: 'Input',
fieldName: 'DeviceId',
label: $t('abp.IoTDBBase.DeviceId'),
},
{
component: 'Input',
fieldName: 'DeviceType',
label: $t('abp.IoTDBBase.DeviceType'),
},
{
component: 'Input',
fieldName: 'ProductId',
label: $t('abp.OneNETLog.ProductId'),
},
{
component: 'Input',
fieldName: 'PlatformDeviceId',
label: $t('abp.OneNETLog.PlatformDeviceId'),
2025-06-25 17:29:57 +08:00
},
]);
2025-07-11 11:48:12 +08:00
2025-06-25 17:29:57 +08:00
export const tableSchema: any = computed((): VxeGridProps['columns'] => [
{ title: $t('common.seq'), type: 'seq', width: 50 },
2025-07-11 11:48:12 +08:00
{
field: 'timestamps',
title: $t('abp.IoTDBBase.Timestamps'),
minWidth: '150',
},
2025-06-25 17:29:57 +08:00
{
2025-07-11 00:15:57 +08:00
field: 'systemName',
title: $t('abp.IoTDBBase.SystemName'),
minWidth: '120',
2025-06-25 17:29:57 +08:00
},
2025-07-11 00:15:57 +08:00
{ field: 'projectId', title: $t('abp.IoTDBBase.ProjectId'), minWidth: '120' },
2025-06-25 17:29:57 +08:00
{
2025-07-11 11:48:12 +08:00
field: 'deviceType',
title: $t('abp.IoTDBBase.DeviceType'),
2025-07-11 00:15:57 +08:00
minWidth: '120',
2025-06-25 17:29:57 +08:00
},
{
2025-07-11 11:48:12 +08:00
field: 'ioTDataType',
title: $t('abp.IoTDBBase.IoTDataType'),
2025-07-11 00:15:57 +08:00
minWidth: '120',
},
{ field: 'deviceId', title: $t('abp.IoTDBBase.DeviceId'), minWidth: '120' },
{ field: 'productId', title: $t('abp.OneNETLog.ProductId'), minWidth: '120' },
{
field: 'platformDeviceId',
title: $t('abp.OneNETLog.PlatformDeviceId'),
2025-06-25 17:29:57 +08:00
minWidth: '150',
},
{
2025-07-11 00:15:57 +08:00
field: 'messageType',
title: $t('abp.OneNETLog.MessageType'),
minWidth: '120',
},
{ field: 'protocol', title: $t('abp.OneNETLog.Protocol'), minWidth: '100' },
{
field: 'focusAddress',
title: $t('abp.OneNETLog.FocusAddress'),
minWidth: '120',
},
{
field: 'meterAddress',
title: $t('abp.OneNETLog.MeterAddress'),
minWidth: '120',
},
{
field: 'receivedTime',
title: $t('abp.OneNETLog.ReceivedTime'),
minWidth: '150',
formatter: ({ cellValue }) => {
return cellValue ? dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss') : '';
},
},
2025-07-11 11:48:12 +08:00
{
field: 'isEncrypted',
title: $t('abp.OneNETLog.IsEncrypted'),
minWidth: '200',
},
{
field: 'plaintextMessage',
title: $t('abp.OneNETLog.PlaintextMessage'),
minWidth: '200',
},
2025-07-11 00:15:57 +08:00
{
field: 'rawMessage',
title: $t('abp.OneNETLog.RawMessage'),
minWidth: '200',
},
{
field: 'receivedPayload',
title: $t('abp.OneNETLog.ReceivedPayload'),
minWidth: '200',
},
2025-06-25 17:29:57 +08:00
]);