/**
 * 表格列配置 - 知识库文档
 */
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface'
import { getDocumentStatusText, getDocumentStatusColor, getDocumentTypeText } from './options'

export const getColumns = (): TableColumnData[] => [
  {
    title: '序号',
    dataIndex: 'index',
    slotName: 'index',
    width: 60,
    align: 'center',
  },
  {
    title: '文档编号',
    dataIndex: 'doc_no',
    width: 150,
    ellipsis: true,
    tooltip: true,
  },
  {
    title: '文档标题',
    dataIndex: 'title',
    width: 200,
    ellipsis: true,
    tooltip: true,
  },
  {
    title: '文档类型',
    dataIndex: 'type',
    slotName: 'type',
    width: 120,
    align: 'center',
  },
  {
    title: '分类',
    dataIndex: 'category_name',
    width: 120,
    ellipsis: true,
    tooltip: true,
  },
  {
    title: '作者',
    dataIndex: 'author_name',
    width: 100,
    ellipsis: true,
    tooltip: true,
  },
  {
    title: '审核人',
    dataIndex: 'reviewer_name',
    width: 100,
    ellipsis: true,
    tooltip: true,
  },
  {
    title: '发布时间',
    dataIndex: 'published_at',
    slotName: 'published_at',
    width: 160,
    align: 'center',
  },
  {
    title: '版本号',
    dataIndex: 'version',
    width: 80,
    align: 'center',
  },
  {
    title: '浏览次数',
    dataIndex: 'view_count',
    width: 90,
    align: 'center',
  },
  {
    title: '文档状态',
    dataIndex: 'status',
    slotName: 'status',
    width: 110,
    align: 'center',
    fixed: 'right',
  },
  {
    title: '操作',
    dataIndex: 'operation',
    slotName: 'operation',
    width: 200,
    align: 'center',
    fixed: 'right',
  },
]