mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-04-22 07:26:46 +00:00
年度报告优化 #720
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user