import type { TableColumn } from '@/components/core/dynamic-table';
export type TableListItem = API.KnowledgeBaseType;
export type TableColumnItem = TableColumn<TableListItem>;

// 数据项类型
// export type ListItemType = typeof tableData[number];
// 使用TableColumn<ListItemType> 将会限制dataIndex的类型，但换来的是dataIndex有类型提示
export const baseColumns: TableColumnItem[] = [
  {
    title: '标题',
    align: 'center',
    dataIndex: 'title',
    // sorter: true,
    width: 150,
    resizable: true,
    formItemProps: {
      defaultValue: '',
      required: false,
    },
  },
  {
    title: '描述',
    align: 'center',
    dataIndex: 'description',
    ellipsis: true,
    width: 150,
    resizable: true,
    formItemProps: {
      defaultValue: '',
      required: false,
    },
  },
  {
    title: '标签',
    align: 'center',
    dataIndex: 'tags',
    width: 200,
    hideInSearch: true,
  },
  {
    title: '创建时间',
    align: 'center',
    width: 200,
    dataIndex: 'createTime',
    formItemProps: {
      defaultValue: '',
      required: false,
      component: 'RangePicker',
      componentProps: {
        valueFormat: 'YYYY-MM-DD',
      },
    },
  },
];
