import { TableProps } from 'antd'; import { ColumnType, TableRef } from 'antd/es/table'; import { TyEmptyProps } from '../TyEmpty/type'; import { RefObject } from 'react'; type SizeType = 'small' | 'middle' | 'large' | undefined; export interface TyColumnsType extends ColumnType { /** 是否移除单元格上下的padding */ removePadding?: boolean; /** 拖拽模式下占位的列 */ placeholder?: boolean; /** 是否选中/显示 */ checked?: boolean; /** 是否禁用 */ disabled?: boolean; /** 最小宽度 */ minWidth?: number; } export type ITableRef = { getAntTableRef: () => TableRef | null; getTableColumns: () => TyColumnsType[]; }; export type TyTableProps = { /** 表头是否可以拖拽 */ isColumnResize?: boolean; /** 存储名称,当配置时,表头配置将被存储。推荐命名规范:微应用名称 + 表格名称(appName + tableName),中间使用横杠隔开,如:entity-BusinessSystem */ storageName?: string; /** 展示列的key,当需要自定义表头时使用 */ displayColumnKeys?: any[]; /** 默认展示 small */ size?: SizeType; /** 是否打开拖拽模式下宽度自动等比例计算 默认不打开 */ isColumnWidthAuto?: boolean; columns: TyColumnsType; emptyCfg?: TyEmptyProps; showSorterTooltip?: boolean; tableRef?: RefObject | undefined>; [key: string]: any; } & TableProps; export type TyTableStorageType = { [key: string]: TyColumnsType[]; }; export {};