chore(cleaner): clean up legacy report viewer references

Remove ReportViewerDialog and ReportAnalysisDialog lazy imports, state
variables, Suspense wrappers, and the "查看报告" toolbar button. These
components were for the old Markdown file-based report viewer which has
been replaced by database-backed operation history.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-04-13 12:30:10 +08:00
parent 4c40457c71
commit b95f12fca1
2 changed files with 0 additions and 32 deletions

View File

@@ -4,7 +4,6 @@ import {
Eye,
EyeOff,
FileSpreadsheet,
FileText,
HardDrive,
History,
Search,
@@ -27,7 +26,6 @@ interface CleanerToolbarProps {
handleValidation: () => Promise<void>
handleConfirmDeletion: () => Promise<void>
handleExportResults: () => Promise<void>
setIsReportViewerOpen: (open: boolean) => void
setShowHistoryModal: (open: boolean) => void
typeManagementButtonRef: React.RefObject<HTMLButtonElement | null>
}
@@ -45,7 +43,6 @@ export function CleanerToolbar({
handleValidation,
handleConfirmDeletion,
handleExportResults,
setIsReportViewerOpen,
setShowHistoryModal,
typeManagementButtonRef
}: CleanerToolbarProps): React.JSX.Element {
@@ -139,12 +136,6 @@ export function CleanerToolbar({
>
<FileSpreadsheet size={14} /> {isExporting ? '导出中...' : '导出结果'}
</button>
<button
onClick={() => setIsReportViewerOpen(true)}
className="text-xs bg-emerald-50 border border-emerald-200 text-emerald-700 px-3 py-1.5 rounded shadow-sm hover:bg-emerald-100 flex items-center gap-1.5 font-medium transition-colors"
>
<FileText size={14} />
</button>
</div>
</div>
</>

View File

@@ -10,8 +10,6 @@ const MaterialTypeManagementDialog = React.lazy(
() => import('../components/MaterialTypeManagementDialog')
)
const ExecutionReportDialog = React.lazy(() => import('../components/ExecutionReportDialog'))
const ReportViewerDialog = React.lazy(() => import('../components/ReportViewerDialog'))
const ReportAnalysisDialog = React.lazy(() => import('../components/ReportAnalysisDialog'))
const CleanerOperationHistoryModal = React.lazy(
() => import('../components/CleanerOperationHistoryModal')
)
@@ -69,8 +67,6 @@ const CleanerPage: React.FC = () => {
confirmDialog
} = useCleaner()
const [isReportViewerOpen, setIsReportViewerOpen] = React.useState(false)
const [isReportAnalysisOpen, setIsReportAnalysisOpen] = React.useState(false)
const [showHistoryModal, setShowHistoryModal] = React.useState(false)
return (
@@ -100,7 +96,6 @@ const CleanerPage: React.FC = () => {
handleValidation={handleValidation}
handleConfirmDeletion={handleConfirmDeletion}
handleExportResults={handleExportResults}
setIsReportViewerOpen={setIsReportViewerOpen}
setShowHistoryModal={setShowHistoryModal}
typeManagementButtonRef={typeManagementButtonRef}
/>
@@ -172,24 +167,6 @@ const CleanerPage: React.FC = () => {
/>
</Suspense>
<Suspense fallback={null}>
<ReportViewerDialog
isOpen={isReportViewerOpen}
onClose={() => setIsReportViewerOpen(false)}
isAdmin={isAdmin}
currentUsername={currentUsername}
onOpenAnalysis={() => setIsReportAnalysisOpen(true)}
/>
</Suspense>
<Suspense fallback={null}>
<ReportAnalysisDialog
isOpen={isReportAnalysisOpen}
onClose={() => setIsReportAnalysisOpen(false)}
isAdmin={isAdmin}
/>
</Suspense>
<Suspense fallback={null}>
<CleanerOperationHistoryModal
isOpen={showHistoryModal}