@aliretail/react-materials-components
Version:
76 lines (75 loc) • 2.15 kB
TypeScript
import React from 'react';
import { Query, ExportResponse, QueryItem, ExportStateResponse } from './type';
declare type IProps = typeof DataExport.defaultProps & {
/**
* 导出接口
*/
onExport: (query: Query) => Promise<ExportResponse>;
/**
* 查询导出进度
*/
queryExportState: (jobId: string) => Promise<ExportStateResponse>;
/**
* 获取导出历史接口
*/
onFetchHistory: (currentPage: number, pageSize: number) => Promise<ExportResponse>;
/**
* 当导出按钮点击时,需要返回查询条件
*/
onExportButtonClick: (event: React.MouseEvent) => Query;
/**
* 翻译查询条件接口
*/
translateQuery: (query: Query) => QueryItem[];
/**
* 子节点
*/
children?: React.ReactChildren;
onExportError: (result: any) => boolean;
onExportSuccess: (result: any) => boolean;
};
declare type IState = {
/**
* 是否展示导出历史
* @default false
*/
exportHistoryVisible: boolean;
/**
* 是否展示导出二次确认框
* @default false
*/
exportConfirmVisible: boolean;
/**
* 操作历史当前页
*/
currentPage: number;
exportQuery: Query;
};
declare class DataExport extends React.Component<IProps, IState> {
static propTypes: {
onExport: any;
onExportButtonClick: any;
onFetchHistory: any;
translateQuery: any;
children: any;
onExportError: any;
};
static defaultProps: {
children: any;
};
historyRef: any;
state: IState;
handleExportButtonClick: (event: any) => void;
handleCancelExport: () => void;
handleCloseHistory: () => void;
handleShowExportHistoryButtonClick: () => void;
handleDoExportButtonClick: () => void;
doExport: (query: Query) => void;
queryExportState: (jobId: any, retryCount?: number) => any;
onExportFinish: (status: string, result: any, jobId: string) => void;
renderChildren(): any;
renderConfirm(): JSX.Element;
renderHistory(): JSX.Element;
render(): JSX.Element;
}
export default DataExport;