年度报告优化 #720

This commit is contained in:
cc
2026-04-19 19:28:14 +08:00
parent bc2e7d616a
commit 682f43bf2f
6 changed files with 93 additions and 16 deletions

View File

@@ -3555,6 +3555,24 @@ function registerIpcHandlers() {
}
})
ipcMain.handle('annualReport:captureCurrentWindow', async (event) => {
try {
const win = BrowserWindow.fromWebContents(event.sender)
if (!win || win.isDestroyed()) {
return { success: false, error: '窗口不可用' }
}
const image = await win.webContents.capturePage()
return {
success: true,
dataUrl: image.toDataURL(),
size: image.getSize()
}
} catch (e) {
return { success: false, error: String(e) }
}
})
// 密钥获取
ipcMain.handle('key:autoGetDbKey', async (event) => {
return keyService.autoGetDbKey(180_000, (message: string, level: number) => {