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

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