diff --git a/src/renderer/src/AixPPTist/src/App.vue b/src/renderer/src/AixPPTist/src/App.vue index 1a05300..62045fc 100644 --- a/src/renderer/src/AixPPTist/src/App.vue +++ b/src/renderer/src/AixPPTist/src/App.vue @@ -27,6 +27,7 @@ import msgUtils from '@/plugins/modal' // 消息工具 import * as API_entpcoursefile from '@/api/education/entpcoursefile' // 相关api import { PPTApi } from './api' import { sessionStore } from '@/utils/store' // electron-store 状态管理 +import './api/watcher' // 监听 const loading = ref(true) const _isPC = isPC() @@ -69,25 +70,20 @@ interface Result { } // 获取参数 const initLoad: Function = () => { - // const urlSearch = location.href.split('?')[1] - // const query = Object.fromEntries(new URLSearchParams(urlSearch)) - // const id: String = query.id - // // 如果存在就获取pptx幻灯片内容 - // if (!!id) return PPTApi.getSlideList(id) - // 缓存当前资源信息 + // 获取缓存的ppt 资源数据 const resource = sessionStore.get('curr.resource') if (!!resource) { // 有ppt 资源数据缓存 slidesStore.setTitle(resource.title) + if (!!resource.parentContent) { // 有全局配置项 + const opt = JSON.parse(resource.parentContent) + !!(opt.width??null) && slidesStore.setViewportSize(opt.width) // 有宽度配置项 + !!(opt.ratio??null) && slidesStore.setViewportRatio(opt.ratio)// 有比例配置项 + } return PPTApi.getSlideList(resource.id) } return Promise.resolve() } -// 监听幻灯片内容变化 -watch(() => slidesStore.slides, (newVal, oldVal) => { - // 更新幻灯片内容 - PPTApi.updateSlides(newVal, oldVal) -},{ deep: true })