Browse Source

修复获取ppt配置,发布的问题

cxmo 1 year ago
parent
commit
c98aac725f
2 changed files with 14 additions and 10 deletions
  1. 2 0
      src/views/ppt/Detail.vue
  2. 12 10
      src/views/ppt/hooks/usePPTPublish.js

+ 2 - 0
src/views/ppt/Detail.vue

@@ -11,6 +11,7 @@ import {useDownLoadFile} from '@/hooks/useDownLoadFile'
 import { useWindowScroll } from '@vueuse/core'
 import moment from 'moment';
 import { showToast } from 'vant';
+import { useConfigSettingStore } from '@/store/modules/etaConfig'
 
 const route=useRoute()
 const router=useRouter()
@@ -24,6 +25,7 @@ const { y } = useWindowScroll()
 let PPTInfo=ref(null)
 let conArr=ref([])
 async function getPPTDetail(){
+    await useConfigSettingStore().getBaseConfigSetting()
     const res=await apiPPTDetail({PptId:Number(pptId)})
     if(res.Ret!=200) return
     PPTInfo.value=res.Data

+ 12 - 10
src/views/ppt/hooks/usePPTPublish.js

@@ -594,16 +594,18 @@ async function pageToPPT(){
     }
 
     //添加封底
-    let back = PPTINS.addSlide()
-    let backImg = $(`#ppt-last-page img`)[0].src
-    back.addImage({
-        path: backImg,
-        x: 0,
-        y: 0,
-        w:'100%',
-        h: '100%',
-        size: { type: "contain" },
-    })
+    if($(`#ppt-last-page img`)[0]){
+        let back = PPTINS.addSlide()
+        let backImg = $(`#ppt-last-page img`)[0].src
+        back.addImage({
+            path: backImg,
+            x: 0,
+            y: 0,
+            w:'100%',
+            h: '100%',
+            size: { type: "contain" },
+        })
+    }
 
     //为了把封面放到第一页,操作pptx.slides达不成想要的效果,于是弄了个pptx2
     //将封面放在最后生成是因为htmlToCanvans占用太多内存会导致页面假死