import { h } from 'vue';
export const columns = [
  {
    type: 'selection',
    width: 50,
    fixed: 'left',
  },
  {
    title: 'ID',
    key: 'id',
    fixed: 'left',
    width: 50,
  },
  {
    title: '日志标题',
    key: 'title',
    width: 100,
  },
  {
    title: '日志类型',
    key: 'type',
    width: 100,
    render(record) {
      let typeText = '';
      switch (record.type) {
        case 1:
          typeText = '登录';
          break;
        case 2:
          typeText = '注册';
          break;
        case 3:
          typeText = '找回密码';
          break;
        case 4:
          typeText = '业务';
          break;
        case 5:
          typeText = '其他';
          break;
        default:
          break;
      }
      return h('span', typeText || '-');
    },
  },
  {
    title: '模板编号',
    key: 'code',
    width: 100,
  },
  {
    title: '接收人邮箱',
    key: 'receiveEmail',
    width: 100,
  },
  {
    title: '接收人类型',
    key: 'status',
    width: 100,
    render(record) {
      let typeText = '';
      switch (record.receiveType) {
        case 1:
          typeText = '系统用户';
          break;
        case 2:
          typeText = '会员用户';
          break;
        case 3:
          typeText = '其他';
          break;
        default:
          break;
      }
      return h('span', typeText || '-');
    },
  },
  {
    title: '请求耗时',
    key: 'consumeTime',
    width: 100,
  },
  {
    title: '日志状态',
    key: 'status',
    width: 100,
    render(record) {
      return h('span', record.status === 1 ? '已读' : '未读');
    },
  },
  {
    title: '创建人',
    key: 'createUser',
    width: 100,
  },
  {
    title: '创建时间',
    key: 'createTime',
    width: 180,
  },
];
