Переглянути джерело

fix 标题没有base定位时计算定位而不是使用默认值

cxmo 4 місяців тому
батько
коміт
d4ade667ce

+ 11 - 0
src/views/ppt_manage/mixins/pptMixins.js

@@ -82,6 +82,17 @@ export default {
     }
   },
   methods: {
+    getBasePosition(titleDetail){
+        const {top=6.6,left=10,width=68,height=5} = titleDetail
+        const baseWidth = 900
+        const baseHeight = 630
+        return {
+            baseTop:baseHeight*top/100,
+            baseLeft:baseWidth*left/100,
+            baseWidth:baseWidth*width/100,
+            baseHeight:baseHeight*height/100,
+        }
+    },
     //配置自定义标题内容
     setPPTTitle(slide,page){
         const {titleDetail,title} = page

+ 6 - 0
src/views/ppt_manage/newVersion/components/catalog/pptContent.vue

@@ -161,6 +161,12 @@ export default {
       await this.initPPTAllPage(this.pageList)
       for(let i=0;i<this.pageList.length;i++){
         if(this.interruptLoad) return
+        if(this.pageList[i].titleDetail){
+            this.pageList[i].titleDetail = {
+                ...this.pageList[i].titleDetail,
+                ...this.getBasePosition(this.pageList[i].titleDetail)
+            }
+        }
         this.loadArr.push(this.pageList[i])
         await this.initPageElements(this.pageList[i],'show')
       } 

+ 6 - 0
src/views/ppt_manage/newVersion/components/catalog/pptContentEn.vue

@@ -156,6 +156,12 @@ export default {
       await this.initPPTAllPage(this.pageList)
       for(let i=0;i<this.pageList.length;i++){
         if(this.interruptLoad) return
+        if(this.pageList[i].titleDetail){
+            this.pageList[i].titleDetail = {
+                ...this.pageList[i].titleDetail,
+                ...this.getBasePosition(this.pageList[i].titleDetail)
+            }
+        }
         this.loadArr.push(this.pageList[i])
         await this.initPageElements(this.pageList[i],'show')
       }

+ 6 - 0
src/views/ppt_manage/newVersion/pptEnPresent.vue

@@ -341,6 +341,12 @@ export default {
         const sheetElements = this.pageList[i].elements.filter((item)=>{
           return item.type === 'sheet'
         })
+        if(this.pageList[i].titleDetail){
+            this.pageList[i].titleDetail = {
+                ...this.pageList[i].titleDetail,
+                ...this.getBasePosition(this.pageList[i].titleDetail)
+            }
+        }
         this.listHandle(chartElements,'present');
         this.sheetListHandle(sheetElements);
       }

+ 6 - 0
src/views/ppt_manage/newVersion/pptEnPublish.vue

@@ -199,6 +199,12 @@ export default {
         //获取已加载图表的信息
         let chartInfoMap = {}
         for(let i=0;i<this.pageList.length;i++){
+            if(this.pageList[i].titleDetail){
+                this.pageList[i].titleDetail = {
+                    ...this.pageList[i].titleDetail,
+                    ...this.getBasePosition(this.pageList[i].titleDetail)
+                }
+            }
           this.pageList[i].elements.forEach(item=>{
             if(item.type==='chart'){
               let temp = getChartInfo(this.optionMap[item.chartId])

+ 6 - 0
src/views/ppt_manage/newVersion/pptPresent.vue

@@ -341,6 +341,12 @@ export default {
         const sheetElements = this.pageList[i].elements.filter((item)=>{
           return item.type === 'sheet'
         })
+        if(this.pageList[i].titleDetail){
+            this.pageList[i].titleDetail = {
+                ...this.pageList[i].titleDetail,
+                ...this.getBasePosition(this.pageList[i].titleDetail)
+            }
+        }
         this.listHandle(chartElements,'present');
         this.sheetListHandle(sheetElements);
       }

+ 6 - 0
src/views/ppt_manage/newVersion/pptPublish.vue

@@ -220,6 +220,12 @@ export default {
          //获取已加载图表的信息
         let chartInfoMap = {}
         for(let i=0;i<this.pageList.length;i++){
+            if(this.pageList[i].titleDetail){
+                this.pageList[i].titleDetail = {
+                    ...this.pageList[i].titleDetail,
+                    ...this.getBasePosition(this.pageList[i].titleDetail)
+                }
+            }
           this.pageList[i].elements.forEach(item=>{
             if(item.type==='chart'){
               let temp = getChartInfo(this.optionMap[item.chartId])