import { h } from 'vue';

export const columns = [
  {
    type: 'selection',
    width: 50,
    fixed: 'left',
  },
  {
    title: 'ID',
    key: 'id',
    fixed: 'left',
    width: 50,
  },
  {
    title: '广告位名称',
    key: 'name',
    width: 200,
  },
  {
    title: '广告位编号',
    key: 'location',
    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: 'sort',
    width: 100,
  },
  {
    title: '创建人',
    key: 'createUser',
    width: 100,
  },
  {
    title: '创建时间',
    key: 'createTime',
    width: 180,
  },
];
