فهرست منبع

应用设置跟随PPT保存

cxmo 4 ماه پیش
والد
کامیت
3f3f0abc76

+ 5 - 2
src/views/ppt_manage/mixins/pptEditorMixins.js

@@ -213,10 +213,14 @@ export default{
     //全局改变标题设置,并存储本次设置
     changeSettingAll(detail){
         this.titleSetting = detail
+        this.settingAllPage()
+        this.$message.success(this.$t('MsgPrompt.set_success_msg'))
+    },
+    settingAllPage(){
         const baseWidth = 900
         const baseHeight = 630
         this.pageList.forEach((page,index)=>{
-            const {top,left,width,height,color,fontFamily,fontSize} = detail
+            const {top=6.6,left=10,width=68,height=5,color='#333',fontFamily='helvetica',fontSize=22} = this.titleSetting
             page.titleDetail = {
                 top,left,width,height,
                 baseTop:baseHeight*top/100,//px单位,基准为编辑页的ppt大小
@@ -227,7 +231,6 @@ export default{
             }
             this.$set(this.pageList,index,page)
         })
-        this.$message.success(this.$t('MsgPrompt.set_success_msg'))
     },
     //显示切换模板弹窗
     handleChangeFormat(item){

+ 12 - 2
src/views/ppt_manage/mixins/pptMixins.js

@@ -203,7 +203,8 @@ export default {
             ModifyTime,
             PublishTime,
             Editor,
-            CoverContent
+            CoverContent,
+            TitleSetting
         } = res.Data
         const pptDate = formatPPTDate(this.currentLang, PptDate)
         let legalContent = JSON.parse(Content)
@@ -211,6 +212,14 @@ export default {
             page.elements = checkPPTpageElemant(page)
             return page
         })
+        let legalTitleSetting = null
+        try{
+            legalTitleSetting = JSON.parse(TitleSetting)
+        }catch(e){
+            console.log(e)
+            legalTitleSetting = null
+        }
+        
         this.pptCoverContent = CoverContent
         this.result = {
             status: 200,
@@ -226,7 +235,8 @@ export default {
             ModifyTime,
             PublishTime,
             Editor,
-            CoverContent
+            CoverContent,
+            TitleSetting:legalTitleSetting
         }
       }else{
         this.result = {status:'',content:'获取ppt数据失败!'}

+ 14 - 5
src/views/ppt_manage/newVersion/pptEditor.vue

@@ -522,7 +522,11 @@ export default {
       //防止自动保存时,有某一页处于更新图表的状态,其isUpdating为true
       this.pageList.forEach(i=>{
         i.isUpdating = false
-      })     
+      })
+      //如果有标题默认设置,应用这个设置
+      if(this.titleSetting){
+        this.settingAllPage()
+      }
       this.dataLoading.close();
       $('.ppt-item').css('background-image',`url(${this.pptBgImage})`);
       //开启自动保存
@@ -534,13 +538,14 @@ export default {
         await this.getpptDataById(id)
         const {status} = this.result
         if(status===200){
-          const {content,FirstPage,ReportId} = this.result
+          const {content,FirstPage,ReportId,TitleSetting} = this.result
           this.pageList = content
           this.firstPage = FirstPage
           this.firstPage.BackIndex = FirstPage.TemplateType-1
           this.currentItem = this.pageList[0]
           this.ReportId=ReportId
           this.CoverContent = this.result.CoverContent
+          this.titleSetting = TitleSetting||null
           /* //开启自动保存
           this.autoSave() */
         }else{
@@ -1121,7 +1126,8 @@ export default {
         FirstPage:FirstPage,
         Content:Content,
         GroupId:this.catalogId,
-        CoverContent:this.CoverContent
+        CoverContent:this.CoverContent,
+        TitleSetting:JSON.stringify(this.titleSetting)
       }).then(res=>{
         this.isSaved = false
         if(res.Ret===200){
@@ -1142,7 +1148,8 @@ export default {
         PptId:parseInt(ppt_id),
         FirstPage:FirstPage,
         Content:Content,
-        CoverContent:this.CoverContent
+        CoverContent:this.CoverContent,
+        TitleSetting:JSON.stringify(this.titleSetting)
       }).then(res=>{
         this.isSaved = false
         if(res.Ret===200){
@@ -1180,11 +1187,13 @@ export default {
           return i
         })
         let Content = JSON.stringify(pageList) 
+        let TitleSetting = JSON.stringify(this.titleSetting)
         pptInterface.saveLog({
           PptId:parseInt(ppt_id),
           FirstPage:FirstPage,
           Content:Content,
-          CoverContent:this.CoverContent
+          CoverContent:this.CoverContent,
+          TitleSetting,
         }).then((res)=>{
             if(res.Ret!==200) return 
             this.showLastSaveTime = true