141 lines
2.9 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.CTWingLog.FocusAddress'),
},
{
component: 'Input',
fieldName: 'DeviceId',
label: $t('abp.IoTDBBase.DeviceId'),
},
{
component: 'Input',
fieldName: 'DeviceType',
label: $t('abp.IoTDBBase.DeviceType'),
},
{
component: 'Input',
fieldName: 'SystemName',
label: $t('abp.IoTDBBase.SystemName'),
},
{
component: 'Input',
fieldName: 'ProjectId',
label: $t('abp.IoTDBBase.ProjectId'),
2025-06-25 17:29:57 +08:00
},
]);
2025-07-11 00:15:57 +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'),
2025-07-11 00:15:57 +08:00
minWidth: 150,
2025-06-25 17:29:57 +08:00
},
2025-07-11 11:48:12 +08:00
{ field: 'systemName', title: $t('abp.IoTDBBase.SystemName'), minWidth: 150 },
2025-06-25 17:29:57 +08:00
{
2025-07-11 11:48:12 +08:00
field: 'projectId',
title: $t('abp.IoTDBBase.ProjectId'),
2025-07-11 00:15:57 +08:00
minWidth: 150,
2025-06-25 17:29:57 +08:00
},
{
field: 'deviceType',
2025-07-11 00:15:57 +08:00
title: $t('abp.IoTDBBase.DeviceType'),
minWidth: 150,
},
{
2025-07-11 11:48:12 +08:00
field: 'ioTDataType',
title: $t('abp.IoTDBBase.IoTDataType'),
2025-07-11 00:15:57 +08:00
minWidth: 150,
2025-06-25 17:29:57 +08:00
},
{
2025-07-11 11:48:12 +08:00
field: 'deviceId',
title: $t('abp.IoTDBBase.DeviceId'),
2025-07-11 00:15:57 +08:00
minWidth: 150,
2025-06-25 17:29:57 +08:00
},
2025-07-11 00:15:57 +08:00
{
field: 'devicePath',
title: $t('abp.IoTDBBase.DevicePath'),
minWidth: 200,
},
{
field: 'platformTenantId',
title: $t('abp.CTWingLog.PlatformTenantId'),
minWidth: 150,
},
{
field: 'productId',
title: $t('abp.CTWingLog.ProductId'),
minWidth: 150,
},
{
field: 'serviceId',
title: $t('abp.CTWingLog.ServiceId'),
minWidth: 150,
},
{
field: 'platformDeviceId',
title: $t('abp.CTWingLog.PlatformDeviceId'),
minWidth: 150,
},
{
field: 'messageType',
title: $t('abp.CTWingLog.MessageType'),
minWidth: 120,
},
{
field: 'protocol',
title: $t('abp.CTWingLog.Protocol'),
minWidth: 100,
},
{
field: 'focusAddress',
title: $t('abp.CTWingLog.FocusAddress'),
minWidth: 150,
},
{
field: 'meterAddress',
title: $t('abp.CTWingLog.MeterAddress'),
minWidth: 150,
},
{
field: 'rawMessage',
title: $t('abp.CTWingLog.RawMessage'),
minWidth: 200,
showOverflow: false,
},
{
field: 'receivedPayload',
title: $t('abp.CTWingLog.ReceivedPayload'),
minWidth: 200,
showOverflow: false,
},
{
field: 'receivedTime',
title: $t('abp.CTWingLog.ReceivedTime'),
minWidth: 150,
formatter: ({ cellValue }) => {
return cellValue ? dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss') : '';
},
},
{
field: 'imsi',
title: $t('abp.CTWingLog.IMSI'),
minWidth: 150,
},
{
field: 'imei',
title: $t('abp.CTWingLog.IMEI'),
minWidth: 150,
},
2025-06-25 17:29:57 +08:00
]);