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

export const columns = [
  {
    type: 'selection',
  },
  {
    label: 'ID',
    prop: 'id'
  },
  {
    label: '文件名称',
    prop: 'originalName',
    render(record) {
      return h('a', {
        href:record.row.filePath,
        target:"_blank"
      },record.row.originalName);
    },
  },
  {
    label: '日志类型',
    prop: 'type',
    render(record) {
      let typeText = ''
      switch (record.row.type) {
        case 0:
          typeText='单个文件'
          break;
        case 1:
          typeText='多个文件'
          break;
        case 2:
          typeText='其他'
          break;
        default:
          break;
      }
      return h('span', typeText || '-');
    },
  },
  {
    label: '文件类型',
    prop: 'fileType',
  },
  {
    label: '文件大小',
    prop: 'fileSize',
    render(record) {
      return h('span', record.row.fileSize+'B')
    },
  },
  {
    label: '文件后缀',
    prop:'fileExtension'
  },
  {
    label: '创建人',
    prop: 'createUser',
  },
  {
    label: '创建时间',
    prop: 'createTime',
  },
];
