import { h } from 'vue';
import { NTag } from 'naive-ui';

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