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

export const columns = [
  {
    type: 'selection',
  },
  {
    label: 'ID',
    prop: 'id',
    fixed: 'left',
    width: 50,
  },
  {
    label: '模板编号',
    prop: 'number',
    minWidth: 100,
  },
  {
    label: '模板名称',
    prop: 'title',
    minWidth: 150,
  },
  {
    label: '模板编码',
    prop: 'code',
    minWidth: 150,
  },
  {
    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: 'content',
    minWidth: 350,
  },
  {
    label: '创建人',
    prop: 'createUser',
    minWidth: 100,
  },
  {
    label: '创建时间',
    prop: 'createTime',
    width: 180,
  },
];
