UNPKG

@grc/business

Version:

更新sider选项 : forceSubMenuRender

87 lines (86 loc) 2.8 kB
import React from "react"; import { ColumnProps } from "@grc/base/components/table"; export interface UploadFile extends File { response?: any; result?: any; } interface ImportFileResultInnerProps { prefixCls: string; file: UploadFile; } interface ImportFileResultOuterProps { title?: React.ReactNode | ((result: any, status?: any) => React.ReactNode); tip?: React.ReactNode | ((result: any, status?: any) => React.ReactNode); } interface ImportFileFailOuterProps<T extends any> extends ImportFileResultOuterProps { reasonChildren?: (result: any) => React.ReactNode; reasonDefault?: { dataSource: (result: any) => Array<T> | null; columns?: Partial<ColumnProps<T>>[] | undefined; }; } export interface UploadComponentProps { action: string; prefixCls?: string; name?: string; disabled?: boolean; withCredentials?: boolean; formateResponse?: (response: { result: any; response: any; isSuccess: boolean; }) => { result: any; response: any; isSuccess: boolean; }; onSuccess?: (file: UploadFile, result: any) => void; onFail?: (file: UploadFile, result: any, response: any) => void; onChange?: (file: UploadFile | null) => void; } export interface FailReasonDefaultComponentProps { dataSource: Array<any> | null; columns?: Partial<ColumnProps<any>>[] | undefined; } export interface ImportFileComponentProps<T> { action: string; headerChildren?: React.ReactNode; uploadPlaceholder?: React.ReactNode; uploadIcon?: string; formateResponse?: (response: { result: any; response: any; isSuccess: boolean; }) => { result: any; response: any; isSuccess: boolean; }; onChange?: (file: UploadFile | null) => void; onFail?: (result: any, response: any) => void; onBack?: (isSuccess: boolean) => void; onCancel?: () => void; modalProps?: { reImportText?: React.ReactNode; continueText?: React.ReactNode; cancelText?: React.ReactNode; }; successProps?: ImportFileResultOuterProps; failProps?: ImportFileFailOuterProps<T>; } export interface ImportFileComponentState { uploadStatus: "fail" | "success" | "init"; currentFile: UploadFile | null; modalVisible: boolean; } export declare type ImportFileSuccessComponentProps = ImportFileResultOuterProps & ImportFileResultInnerProps; export declare type ImportFileFailComponentProps = ImportFileFailOuterProps<any> & ImportFileResultInnerProps; export interface ImportFileModalComponentProps { prefixCls: string; visible: boolean; cancelText?: React.ReactNode; continueText?: React.ReactNode; onCancel?: () => void; onContinue?: () => void; } export {};