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;
        default:
          break;
      }
      return h('span', typeText || '-');
    },
  },
  {
    title: '业务类型',
    key: 'bizType',
    width: 100,
    render(record) {
      return h('span', record.bizType == 1 ? '订单' : '其他');
    },
  },
  {
    title: '消息状态',
    key: 'status',
    width: 100,
    render(record) {
      return h('span', record.status === 1 ? '已读' : '未读');
    },
  },
  {
    title: '创建人',
    width: 100,
    key: 'createUser',
  },
  {
    title: '创建时间',
    key: 'createTime',
    width: 180,
  },
];
