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

export const columns = [
  {
    type: 'selection',
  },
  {
    label: 'ID',
    prop: 'id',
    fixed: 'left',
    width: 50,
  },
  {
    label: '消息标题',
    prop: 'title',
    minWidth: 250,
  },
  {
    label: '消息类型',
    prop: 'type',
    minWidth: 100,
    render(record) {
      let typeText = '';
      switch (record.row.type) {
        case 1:
          typeText = '系统通知';
          break;
        case 2:
          typeText = '用户私信 ';
          break;
        case 3:
          typeText = '代办事项';
          break;
        default:
          break;
      }
      return h('span', typeText || '-');
    },
  },
  {
    label: '业务类型',
    prop: 'status',
    minWidth: 100,
    render(record) {
      return h('span', record.row.bizType === 1 ? '订单' : '其他');
    },
  },
  {
    label: '消息状态',
    prop: 'status',
    minWidth: 100,
    render(record) {
      return h('span', record.row.status === 1 ? '已读' : '未读');
    },
  },

  {
    label: '创建人',
    prop: 'createUser',
    minWidth: 100,
  },
  {
    label: '创建时间',
    prop: 'createTime',
    width: 180,
  },
];
