From e31858a3fe8ce1583a6c4af0d59d2e46e0b620f8 Mon Sep 17 00:00:00 2001 From: zhangxuelin <959231531@qq.com> Date: Wed, 4 Sep 2024 21:06:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9pdf=E7=94=BB=E7=AC=94bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/utils/tool.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/utils/tool.js b/src/renderer/src/utils/tool.js index c42f2c8..76c0d5a 100644 --- a/src/renderer/src/utils/tool.js +++ b/src/renderer/src/utils/tool.js @@ -31,7 +31,8 @@ export const localStore = store.localStore // 暴露Store存储对象 export const Store = store - +// 延时 +const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)) /** * 获取静态资源,开发和生产环境 * @param {*} url @@ -270,6 +271,15 @@ const eventHandles = (type, win) => { winPdf=null win&&win.destroy() }) + + // 监听窗口的激活事件 + win.on('focus', async () => { + toolState.isPdfWin=true + await sleep(20) // 延时 + toolState.showBoardAll=false //恢复默认值 + await sleep(50) // 延时 + + }); const on = { onClosed: () => { Remote.ipcMain.removeHandler('open-PDF:minimize')