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', 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'), }, ]); export const tableSchema: any = computed((): VxeGridProps['columns'] => [ { title: $t('common.seq'), type: 'seq', width: 50 }, { field: 'timestamps', title: $t('abp.IoTDBBase.Timestamps'), minWidth: '150', }, { field: 'systemName', title: $t('abp.IoTDBBase.SystemName'), minWidth: '120', }, { field: 'projectId', title: $t('abp.IoTDBBase.ProjectId'), minWidth: '120' }, { field: 'deviceType', title: $t('abp.IoTDBBase.DeviceType'), minWidth: '120', }, { field: 'ioTDataType', title: $t('abp.IoTDBBase.IoTDataType'), 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'), minWidth: '150', }, { 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') : ''; }, }, { field: 'isEncrypted', title: $t('abp.OneNETLog.IsEncrypted'), minWidth: '200', }, { field: 'plaintextMessage', title: $t('abp.OneNETLog.PlaintextMessage'), minWidth: '200', }, { field: 'rawMessage', title: $t('abp.OneNETLog.RawMessage'), minWidth: '200', }, { field: 'receivedPayload', title: $t('abp.OneNETLog.ReceivedPayload'), minWidth: '200', }, ]);