import { h } from 'vue';
import { ElTag } from 'element-plus';

export const columns = [
  {
    type: 'selection',
  },
  {
    label: 'ID',
    prop: 'id'
  },
  {
    label: '日志标题',
    prop: 'title',
  },
  {
    label: '日志类型',
    prop: 'type',
    render(record) {
      let typeText = ''
      switch (record.row.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 || '-');
    },
  },
  {
    label: '模板编号',
    prop: 'number',
  },
  {
    label: '接收人手机',
    prop: 'receiveMobile',
  },
  {
    label: '接收人类型',
    prop: 'receiveType',
    render(record) {
      let typeText = ''
      switch (record.row.receiveType) {
        case 1:
          typeText='系统用户'
          break;
        case 2:
          typeText='会员用户'
          break;
        case 3:
          typeText='其他'
          break;
        default:
          break;
      }
      return h('span', typeText || '-');
    },
  },
  {
    label: '请求耗时',
    prop: 'consumeTime',
  },
  {
    label: '日志状态',
    prop: 'status',
    render(record) {
      return h('span', record.row.status === 1 ? '已读' : '未读')
    },
  },
  {
    label: '创建人',
    prop: 'createUser',
  },
  {
    label: '创建时间',
    prop: 'createTime',
  },
];
