From 1004567103ec86b9ff9ede705feb107e787375e0 Mon Sep 17 00:00:00 2001
From: zhangxuelin <959231531@qq.com>
Date: Fri, 26 Jul 2024 13:57:04 +0800
Subject: [PATCH] =?UTF-8?q?pdf=E5=B1=95=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/renderer/src/utils/tool.js | 21 ++++++++++++++++++++
src/renderer/src/views/classBegins/index.vue | 8 ++++++--
src/renderer/src/views/prepare/index.vue | 9 +++++++--
3 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/src/renderer/src/utils/tool.js b/src/renderer/src/utils/tool.js
index 55070f4..69a267a 100644
--- a/src/renderer/src/utils/tool.js
+++ b/src/renderer/src/utils/tool.js
@@ -3,6 +3,8 @@
*/
// const { ipcRenderer } = window.electron || {}
// import { ipcRenderer } from 'electron' // 渲染器里面可以使用ipcRenderer
+
+
// const path = require('path')
const Remote = require('@electron/remote')
@@ -61,6 +63,21 @@ export const createWindow = async (type, data) => {
eventHandles(type, win) // 事件监听处理
return win
}
+ case 'open-PDF': { //课本展示-pdf
+ const option = data.option||{}
+ const defOption = {
+ frame: false, // 要创建无边框窗口
+ resizable: true, // 禁止窗口大小缩放
+ alwaysOnTop: false, // 窗口是否总是显示在其他窗口之前
+ }
+ data.option = {...defOption, ...option}
+ const win = await toolWindow(data)
+
+ win.show()
+ win.setFullScreen(true) // 设置窗口为全屏
+ eventHandles(type, win) // 事件监听处理
+ break
+ }
default:
break
}
@@ -140,6 +157,10 @@ const eventHandles = (type, win) => {
}
publicMethods(on) // 加载公共方法
break}
+ case 'open-PDF': {
+ // 最小化窗口
+ Remote.ipcMain.once('open-PDF:minimize', () => {win.minimize()})
+ break}
default:
break
}
diff --git a/src/renderer/src/views/classBegins/index.vue b/src/renderer/src/views/classBegins/index.vue
index 26e226d..59a844f 100644
--- a/src/renderer/src/views/classBegins/index.vue
+++ b/src/renderer/src/views/classBegins/index.vue
@@ -26,6 +26,7 @@
下一页
+