/** * 交叉评查文件信息组件 */ interface FileInfoProps { fileInfo: { fileName: string; contractNumber: string; fileSize?: string; fileFormat?: string; pageCount?: number; uploadTime?: string; uploadUser?: string; auditStatus?: number; path?: string; previousRoute?: string; fileType?: string; }; onConfirmResults: () => void; } export function FileInfo({ fileInfo, onConfirmResults }: FileInfoProps) { const handleDownloadFile = () => { if (fileInfo.path) { // 创建一个隐藏的下载链接 const link = document.createElement('a'); link.href = fileInfo.path; link.download = fileInfo.fileName; document.body.appendChild(link); link.click(); document.body.removeChild(link); } else { alert('文件路径不存在,无法下载'); } }; const handleExportReport = () => { alert('导出交叉评查报告功能'); }; return (
{/* 文件基本信息已在面包屑区域显示,这里可以不重复显示 */}
{/* 操作按钮区域 */}
{/* 下载原文件按钮 */} {/* 导出评查报告按钮 */} {/* 确认评查结果按钮 - 只在未审核通过时显示 */} {fileInfo.auditStatus !== 1 && ( )} {/* 已确认状态显示 */} {fileInfo.auditStatus === 1 && ( 评查结果已确认 )}
); }