feat: add bulk photo import and image format handling

This commit is contained in:
2026-07-17 12:43:40 +08:00
parent 0015063a03
commit e999f8b606
21 changed files with 2161 additions and 1421 deletions
+27
View File
@@ -42,6 +42,33 @@ const api = {
workImage2: string
importedAt: string
}) => ipcRenderer.invoke('student:update-profile', profile),
importStudentPhotos: (payload: { batchId: string; classId: string; zipPath: string }) =>
ipcRenderer.invoke('photos:import', payload),
pausePhotoImport: (batchId: string) => ipcRenderer.invoke('photos:pause-import', batchId),
resumePhotoImport: (batchId: string) => ipcRenderer.invoke('photos:resume-import', batchId),
stopPhotoImport: (batchId: string) => ipcRenderer.invoke('photos:stop-import', batchId),
onPhotoImportProgress: (
callback: (progress: {
batchId: string
status: 'parsing' | 'started' | 'image-finished' | 'paused' | 'stopped' | 'finished'
classId: string
className: string
studentId?: string
studentName?: string
current: number
total: number
matchedImageCount: number
skippedImageCount: number
}) => void
): (() => void) => {
const listener = (
_: Electron.IpcRendererEvent,
progress: Parameters<typeof callback>[0]
): void => callback(progress)
ipcRenderer.on('photos:import-progress', listener)
return () => ipcRenderer.removeListener('photos:import-progress', listener)
},
generateStudentComment: (payload: { profileId: string }) =>
ipcRenderer.invoke('student:generate-comment', payload),
generateStudentComments: (payload: { classId?: string; profileIds?: string[] }) =>