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

export const columns = [
  {
    title: 'ID',
    dataIndex: 'id',
    width: 50,
  },
  {
    title: '广告位名称',
    dataIndex: 'name',
    width: 200,
  },
  {
    title: '广告位编号',
    dataIndex: 'location',
    width: 100,
  },
  {
    title: '广告位类型',
    dataIndex: 'type',
    width: 100,
    customRender({ 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: '排序',
    dataIndex: 'sort',
    width: 100,
  },
  {
    title: '创建人',
    dataIndex: 'createUser',
    width: 100,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    width: 180,
  },
  {
    title: '操作',
    fixed: 'right',
    dataIndex: 'action',
    key: 'action',
    width: 200,
  },
];
