import type { ReactElement, ReactText, RefObject } from 'react'; import type { TableProps, TableColumnType, TableColumnGroupType, TableColumnsType } from 'antd'; export type ColumnType = TableColumnType; export type ColumnGroupType = TableColumnGroupType; export type ColumnsType = TableColumnsType; export interface RowAction { /** * @description 当text不为字符串时,建议加上key属性 */ text: string | ReactElement; key?: string; onClick?: (row: T, index: number) => void; disabled?: boolean; dropDown?: (RowAction | null)[]; } export interface BaseTableProps extends Omit, 'columns' | 'scroll'> { defaultColumnProps?: Partial>; /** * @description 当width为auto时为自适应列宽,默认为160 */ columns: ColumnsType; summaryRecord?: any; summaryTitle?: string; sort?: [ReactText, string][]; onSortChange?: (sort: [ReactText, string][]) => void; /** * @description 行高 默认为37,如果表格行有边界,需要包含边界 */ rowHeight?: number; /** * @description 虚拟列表 行高必须一致 并且需要指定rowHeight */ virtual?: boolean; scroll?: { x?: number | string | true; y?: number | string | true; }; /** * @description 行操作按钮组 */ rowActions?: (RowAction | null)[] | ((record: T, index: number) => (RowAction | null)[]); ref?: RefObject; }