export interface IFilePreviewProps { /** 文件url */ filePath?: string; /** * 已有数据,展示成Table */ tableConfig?: { /** 表头 */ header: string[]; /** 行数据 */ rows: string[][]; /** 数据总行数,如果传入,内部会判断`rows.length`和`rowCount`的大小,决定是否展示预览提示信息(请下载查看完整内容) */ rowCount?: number; /** 单元格内容最多显示多少行,默认固定显示2行,超出显示省略号 */ maxLines?: number; }; /** * 已有数据,展示成JSON */ jsonConfig?: { /** 数据 */ data: string | Record[] | Record; }; /** * 是否是在modal中展示 */ openInModal: boolean; /** * 如果是在modal中展示,可以提供modal的配置 */ modalProps?: { /** 是否展示 */ show: boolean; /** * 标题 */ title?: string; /** 取消回调 */ onCancel: () => void; }; /** 错误回调 */ onError?: (error: any) => void; /** 成功回调 */ onSuccess?: () => void; }