import { BasicColumn } from '/@/components/Table/src/types/table';
import { useI18n } from '/@/hooks/web/useI18n';
import { Time } from '/@/components/Time';
import { h } from 'vue';
const { t } = useI18n();
export const columns: BasicColumn[] = [
  {
    title: t('routes.count.uuid'),
    width: 300,
    dataIndex: 'sessionId',
  },
  {
    title: t('routes.count.sourceChannel'),
    width: 150,
    dataIndex: 'utmSource',
  },
  {
    title: t('routes.count.deviceType'),
    width: 150,
    dataIndex: 'deviceType',
  },
  {
    title: t('routes.count.pageDwellTime') + '(min)',
    width: 220,
    dataIndex: 'stopTime',
  },
  {
    title: t('routes.count.scrollDepth'),
    width: 150,
    dataIndex: 'scrollDepth',
  },
  {
    title: t('routes.count.visitTime'),
    width: 150,
    dataIndex: 'visitTime',
    customRender: ({ record }) => {
      return (
        record.createTime &&
        h(Time, {
          value: record.createTime,
          mode: 'datetime',
        })
      );
    },
  },
  {
    title: t('routes.count.visitAddress'),
    width: 150,
    dataIndex: 'country',
  },
  {
    title: t('routes.count.loadTime') + '(s)',
    width: 150,
    dataIndex: 'loadTime',
  },
  {
    title: t('routes.count.networkType'),
    width: 150,
    dataIndex: 'networkType',
  },
  {
    title: t('routes.count.browserLanguage'),
    width: 150,
    dataIndex: 'lang',
  },
];
export const columns1: BasicColumn[] = [
  {
    title: t('routes.count.name'),
    width: 150,
    dataIndex: 'name',
  },
  {
    title: t('routes.count.email'),
    width: 180,
    dataIndex: 'email',
  },
  {
    title: t('routes.count.tel'),
    width: 150,
    dataIndex: 'tel',
  },
  {
    title: t('routes.count.company'),
    width: 150,
    dataIndex: 'company',
  },
  {
    title: t('routes.count.submitTime'),
    width: 150,
    dataIndex: 'submitTime',
    customRender: ({ record }) => {
      return (
        record.createTime &&
        h(Time, {
          value: record.createTime,
          mode: 'datetime',
        })
      );
    },
  },
  {
    title: t('routes.count.submitLocation'),
    width: 200,
    dataIndex: 'country',
  },
  {
    title: t('routes.count.remarks'),
    width: 250,
    dataIndex: 'note',
  },
];
