/// import { FormItemProps, TableProps } from 'antd'; import { FormInstance } from 'antd/lib'; import { ActionBarButtonExtraParams, ActionColumnButtonsProps, ButtonItem, ColumnType, DuplicateCheckItem, EditableCellProps, NewRowOperationProps, SelectionMode, TableEventsProps } from '../table'; import { ActionBarButtonKey } from '@/constants'; export type ActionBarButton = ButtonItem; export type SharedColumnType = Omit & { selfRender?: (value: any, record: Record, rowIndex: number) => React.ReactNode; }; /** * 手动引用组件表格基础类型 */ export type SharedBaseTableProps = TableProps & NewRowOperationProps & { rs_id?: string; columns: SharedColumnType[]; selectionMode?: SelectionMode; showPagination?: boolean; showIndex?: boolean; exportUrl?: string; exportParams?: Record; extraParams?: ActionBarButtonExtraParams; saveUrl?: string; checkForDuplicates?: DuplicateCheckItem[]; actionBarButtons?: { text?: boolean; buttonItems?: ButtonItem[]; }; hideActionBarButtons?: ActionBarButtonKey[]; actionColumnButtons?: ActionColumnButtonsProps; enableDoubleClick?: boolean; onCell?: (record: Record, rowIndex: number | undefined) => any; onHeaderCell?: () => { width: number; dataIndex: string; onResize: (dataIndex: string) => void; }; onCellClick?: EditableCellProps['onClick']; onCellDoubleClick?: EditableCellProps['onDoubleClick']; onRowClick?: TableEventsProps['onRowClick']; onSelectChange?: TableEventsProps['onSelectChange']; onPageChange?: TableEventsProps['onPageChange']; onQueryChange?: TableEventsProps['onQueryChange']; onRefresh?: (params?: Record) => void; onBeforeSave?: () => boolean | Promise; onDelete?: () => void; selectedRows?: { keys: React.Key[]; }; }; export type SharedSubFormTableProps = SharedBaseTableProps & FormItemProps & { name: string; form: FormInstance; };