import { default as React } from 'react'; import { TableProps, TableColumnType } from 'antd'; import { APP, BaseComponentProps } from '../../typings'; import { TableFooterDataRender } from './type'; import { Clipboard, useClipboard } from './useClipboard'; import { BasicsAttribute } from '../../utils/attribute'; type OriginalColumnTypes = TableColumnType>; type CompatibleITabColumn = { tabInfo?: any; instance?: APP.instanceInfoType; }; export type BasicsColumn = OriginalColumnTypes & { dataIndex: string; apicode?: string; sort?: number; id?: string; editable?: boolean; formitem?: any; search?: any; required?: boolean; addDefValue?: string | null; dataFrom?: '0' | '1' | '2'; canNotView?: boolean; isUser?: boolean; isVersion?: string; attr?: BasicsAttribute; children?: BasicsColumn[]; }; type ExtendColumnType = BasicsColumn & CompatibleITabColumn; export type singleColumnType = ExtendColumnType; export type TableColumnsType = ExtendColumnType[]; export interface OnChainTableProps extends Omit, 'onScroll'>, BaseComponentProps { selectedCell?: Record; columns: TableColumnsType; onSubmit?: (values: any, col: any) => void; onSelectCell?: (cellData?: any) => void; onDoubleClick?: (col: any, record: any) => Promise | boolean; onTableHeightChange?: (height: number) => void; onFill?: (type: string, values: any) => void; onBeforeScroll?: () => boolean; isTree?: boolean; /** * Table的粘贴回调 * @param selectedCell 粘贴的selectedCell位置 * @param pasteData 粘贴数据 * @param columns 用于粘贴多列,拿到后续每列的dataIndex * @returns */ onPaste?: (pasteData: Record) => void; /** * Table的复制回调 * @param copyData 复制数据 * @returns */ onCopy?: (copyData: string) => void; clipboard?: Clipboard; tab?: string; pageNo?: number; pageSize?: number; total?: number; scrollUpdate?: (isFullscreen: boolean, autoHeight: number) => void; toggleFullscreen?: () => void; isFullscreen?: boolean; showcheckbox?: boolean; canselectcell?: boolean; tableKey?: string; onScroll?: (pageNo: number) => void; filterAndSorterSpliceSymbol?: string; onFilterAndSorter?: (sorters: string, filters: string, sortersField: string, filtersObject: any, extra?: { isFooterRefresh?: boolean; }) => void; hideFooter?: boolean; hideTableCount?: boolean; /** 屏蔽右键菜单 */ fillContextMenu?: false; /** 全屏时tableHeight需要减少的高度(例如有按钮在时,这个值为的按钮高度 40) */ fullScreenMinusHeight?: number; searchHeight?: boolean; /** 自定义渲染底部数据 */ tableFooterDateRender?: TableFooterDataRender; tableFooterClassName?: string; } export type OnChainColumn = Partial; export type OnChainTableColumnProps = Partial[]; export declare const EditableContext: React.Context; export interface OnChainTableRef { scrollTo: (y: number) => void; scrollXTo: (x: number) => void; clearFilters: () => void; setTableFiltered: (params: { sort: (data: any) => Record; screen: (data: any) => Record; }) => void; clipboard: ReturnType; } export declare const GLOBAL_TABLE_TOP_CLASS = "tableTopBox"; declare const OnChainTable: React.ForwardRefExoticComponent & React.RefAttributes>; export default OnChainTable;