From 964e99c186120793c7bae3f68a2209fdba668909 Mon Sep 17 00:00:00 2001 From: zhangxuelin <959231531@qq.com> Date: Thu, 8 Aug 2024 17:02:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E6=89=93=E5=BC=80=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=A0=8F=E4=B8=8D=E5=85=81=E8=AE=B8=E6=93=8D=E4=BD=9C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/components/pdf/index.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/pdf/index.vue b/src/renderer/src/components/pdf/index.vue index 1447c37..c686d14 100644 --- a/src/renderer/src/components/pdf/index.vue +++ b/src/renderer/src/components/pdf/index.vue @@ -120,6 +120,13 @@ const renderPage = async (canvasobj) => { } // 保存数据 const savaDataStore = () => { + if(!toolState.isToolWin){ + toolState.isPdfWin=false + toolState.showBoardAll=true //恢复默认值 + ipcRenderer.invoke('tool-sphere:reset') //重置tool状态 + ipcRenderer.send('open-PDF:minimize') + return + } imgarr.value.forEach((a) => { if (a.index == 0) { a.JSONdata = canvasFabricVue.value.canvas.toJSON() @@ -170,7 +177,8 @@ const initPdf = async (type = 'default') => { a.JSONdata = canvas1FabricVue.value.canvas.toJSON() } }) - if (type != 'default') { + // 判断是否翻页以及工具窗口是否打开 满足 翻页+打开工具才能保存数据 + if (type != 'default' && toolState.isToolWin) { const nameMap = new Map(canvsStore.pageArr.map((item) => [item.page, item.id])) // 创建一个用于存储所有异步操作的数组 let promises = [] @@ -274,7 +282,6 @@ const initPdfone = async () => { } onMounted(async () => { try { - console.log(props.pdfObj.pdfUrl) // 创建canvas转化成图片 const pdf = await pdfjsLib.getDocument(props.pdfObj.pdfUrl).promise numPagesTotal.value = pdf.numPages