import { h } from 'vue';
export const columns = [
  {
    type: 'selection',
    width: 50,
    fixed:"left"
  },
  {
    title: 'ID',
    key: 'id',
    fixed: 'left',
    width: 50,
  },
  {
    title: '文件名称',
    key: 'originalName',
    width: 200,
    render(record) {
      return h(
        'a',
        {
          href: record.filePath,
          target: '_blank',
        },
        record.originalName,
      );
    },
  },
  {
    title: '日志类型',
    key: 'type',
    width: 100,
    render(record) {
      let typeText = '';
      switch (record.type) {
        case 0:
          typeText = '单个文件';
          break;
        case 1:
          typeText = '多个文件';
          break;
        case 2:
          typeText = '其他';
          break;
        default:
          break;
      }
      return h('span', typeText || '-');
    },
  },
  {
    title: '文件类型',
    key: 'fileType',
    align:'center',
    width: 100,
  },
  {
    title: '文件大小',
    key: 'fileSize',
    width: 100,
    customRender({ record }) {
      return h('span', record.fileSize + 'B');
    },
  },
  {
    title: '文件后缀',
    key: 'fileExtension',

    width: 100,
  },
  {
    title: '创建人',
    key: 'createUser',
    width: 100,
  },
  {
    title: '创建时间',
    key: 'createTime',
    width: 180,
  }
];
