From e0a406c497e3190125312be945b4639f7d6422c5 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Thu, 19 Dec 2024 11:07:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=AB=E6=A0=BC=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 + .../src/components/grid-pic/index.vue | 172 ++++++++++++++++++ .../src/components/grid-pic/viewer-item.vue | 59 ++++++ src/renderer/src/main.js | 5 +- src/renderer/src/router/index.js | 5 + src/renderer/src/views/prepare/index.vue | 9 + 6 files changed, 250 insertions(+), 2 deletions(-) create mode 100644 src/renderer/src/components/grid-pic/index.vue create mode 100644 src/renderer/src/components/grid-pic/viewer-item.vue diff --git a/package.json b/package.json index f861a30..0f89d82 100644 --- a/package.json +++ b/package.json @@ -92,6 +92,8 @@ "tinycolor2": "^1.6.0", "tinymce": "6.8.3", "tippy.js": "^6.3.7", + "v-viewer": "^3.0.11", + "viewerjs": "^1.11.7", "vite-plugin-electron": "^0.28.8", "vue": "^3.4.34", "vue-cropper": "1.0.3", diff --git a/src/renderer/src/components/grid-pic/index.vue b/src/renderer/src/components/grid-pic/index.vue new file mode 100644 index 0000000..8913651 --- /dev/null +++ b/src/renderer/src/components/grid-pic/index.vue @@ -0,0 +1,172 @@ + + + + diff --git a/src/renderer/src/components/grid-pic/viewer-item.vue b/src/renderer/src/components/grid-pic/viewer-item.vue new file mode 100644 index 0000000..f62bbfc --- /dev/null +++ b/src/renderer/src/components/grid-pic/viewer-item.vue @@ -0,0 +1,59 @@ + + + diff --git a/src/renderer/src/main.js b/src/renderer/src/main.js index fbf0a59..ab4962c 100644 --- a/src/renderer/src/main.js +++ b/src/renderer/src/main.js @@ -17,14 +17,14 @@ import log from 'electron-log/renderer' // 渲染进程日志-文件记录 import customComponent from '@/components/common' // 自定义组件 import plugins from './plugins' // plugins插件 import useUserStore from '@/store/modules/user' - +import VueViewer from 'v-viewer' +import 'viewerjs/dist/viewer.css' if(process.env.NODE_ENV != 'development') { // 非开发环境,将日志打印到日志文件 Object.assign(console, log.functions) // 渲染进程日志-控制台替换 } const app = createApp(App) - //专为菁优网配置的请求转发 app.config.globalProperties.$requestGetJYW = (url,config)=>{ config.params = config.params?config.params:{} @@ -42,6 +42,7 @@ import Directive from '@/AixPPTist/src/plugins/directive' app.use(router) .use(store) + .use(VueViewer) .use(ElementPlus, { locale: zhLocale }) .use(customComponent) // 自定义组件 .use(plugins) diff --git a/src/renderer/src/router/index.js b/src/renderer/src/router/index.js index 470b3b9..8f982da 100644 --- a/src/renderer/src/router/index.js +++ b/src/renderer/src/router/index.js @@ -31,6 +31,11 @@ export const constantRoutes = [ component: () => import('@/AixPPTist/src/App.vue'), hidden: true }, + { + path: '/gridPic', + component: () => import('@/components/grid-pic/index.vue'), + hidden: true + }, { path: '/model', component: Layout, diff --git a/src/renderer/src/views/prepare/index.vue b/src/renderer/src/views/prepare/index.vue index c593d06..ca770aa 100644 --- a/src/renderer/src/views/prepare/index.vue +++ b/src/renderer/src/views/prepare/index.vue @@ -10,6 +10,7 @@ 新建文枢课件 AI一键生成 + 打开宫格 导入PPT @@ -341,6 +342,14 @@ export default { // } // }, methods: { + openGridPic() { + createWindow('open-win', { + url: '/gridPic', // 窗口关闭时,清除缓存 + option: { + maximizable: true + } + }) + }, // 延时 sleep(ms){return new Promise(resolve => setTimeout(resolve, ms))}, addAiPPT(item) {