feat(report): stream available years loading

This commit is contained in:
tisonhuang
2026-03-04 16:33:20 +08:00
parent d476fbbdae
commit 28d68d8a8e
5 changed files with 242 additions and 40 deletions

View File

@@ -483,6 +483,15 @@ export interface ElectronAPI {
data?: number[]
error?: string
}>
startAvailableYearsLoad: () => Promise<{
success: boolean
taskId?: string
error?: string
}>
cancelAvailableYearsLoad: (taskId: string) => Promise<{
success: boolean
error?: string
}>
generateReport: (year: number) => Promise<{
success: boolean
data?: {
@@ -567,6 +576,13 @@ export interface ElectronAPI {
dir?: string
error?: string
}>
onAvailableYearsProgress: (callback: (payload: {
taskId: string
years?: number[]
done: boolean
error?: string
canceled?: boolean
}) => void) => () => void
onProgress: (callback: (payload: { status: string; progress: number }) => void) => () => void
}
dualReport: {