config.ts 588 Bytes
import { BasicColumn } from '/@/components/Table';
import { formatToDateTime } from '/@/utils/dateUtil';
import { isNullOrUnDef } from '/@/utils/is';

// 实时数据表格
export const realTimeDataColumns: BasicColumn[] = [
  {
    title: '键',
    dataIndex: 'name',
    width: 100,
  },
  {
    title: '值',
    dataIndex: 'rawValue',
    width: 160,
    format(text) {
      return isNullOrUnDef(text) ? '--' : text;
    },
  },
  {
    title: '最后更新时间',
    dataIndex: 'time',
    width: 120,
    format: (text) => formatToDateTime(text, 'YYYY-MM-DD HH:mm:ss'),
  },
];