antd-curd
Version:
基于 ant design 、 dva 的增删改查页面组件
46 lines (45 loc) • 1.56 kB
TypeScript
import { PureComponent } from 'react';
import { TableProps, ColumnProps, PaginationConfig } from 'antd/lib/table';
declare type OmittedTableProps<T> = Omit<TableProps<T>, 'dataSource' | 'store' | 'checkboxPropsCache' | 'setCheckboxPropsCache'>;
export interface StandardTableColumnProps<T> extends ColumnProps<T> {
needTotal?: boolean;
}
export interface StandardTableProps<T> extends OmittedTableProps<T> {
columns: StandardTableColumnProps<T>[];
onSelectRow: (rows: T[]) => void;
data: {
list: T[];
pagination?: PaginationConfig;
};
checkable?: boolean;
selectedRows?: T[];
}
interface StandardTableState<T> {
selectedRowKeys: string[] | number[];
needTotalList: StandardTableColumnProps<T> & {
total: number;
}[];
}
declare class StandardTable<T> extends PureComponent<StandardTableProps<T>, StandardTableState<T>> {
static defaultProps: {
rowKey: string;
checkable: boolean;
data: {
list: never[];
pagination: {};
};
onSelectRow: () => void;
};
static getDerivedStateFromProps<T>(nextProps: StandardTableProps<T>): {
selectedRowKeys: never[];
needTotalList: any[];
} | null;
state: {
selectedRowKeys: never[];
needTotalList: any[];
};
handleRowSelectChange: (selectedRowKeys: string[] | number[], selectedRows: T[]) => void;
cleanSelectedKeys: () => void;
render(): JSX.Element;
}
export default StandardTable;