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.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'), }, ]); export const tableSchema: any = computed((): VxeGridProps['columns'] => [ { title: $t('common.seq'), type: 'seq', width: 50 }, { field: 'systemName', title: $t('abp.IoTDBBase.SystemName'), minWidth: 150 }, { field: 'projectId', title: $t('abp.IoTDBBase.ProjectId'), minWidth: 150, }, { field: 'dataType', title: $t('abp.IoTDBBase.IoTDataType'), minWidth: 150, }, { field: 'deviceType', title: $t('abp.IoTDBBase.DeviceType'), minWidth: 150, }, { field: 'deviceId', title: $t('abp.IoTDBBase.DeviceId'), minWidth: 150, }, { field: 'timestamps', title: $t('abp.IoTDBBase.Timestamps'), minWidth: 150, formatter: ({ cellValue }) => { return cellValue ? dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss') : ''; }, }, { 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, }, ]);