Эх сурвалжийг харах

Merge branch 'demand-199-copy'

cxmo 4 сар өмнө
parent
commit
3d1c65fefd

+ 7 - 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){
@@ -294,6 +297,7 @@ export default{
         modelId: modelId,
         title:this.choosedItem.title,
         elements: elements,
+        titleDetail:this.titleSetting?this.titleSetting:null
       }
       //把这页删掉,添加新的一页
       const index = this.pageList.findIndex((i) => i.id === this.choosedItem.id); 
@@ -324,6 +328,7 @@ export default{
       list.forEach(page=>{
         page.id = createRandomCode()
         page.elements = checkPPTpageElemant(page)
+        page.titleDetail = this.titleSetting?this.titleSetting:null
         pages.push(page)
       })
       //当前PPT没有页

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

@@ -83,6 +83,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
@@ -204,7 +215,8 @@ export default {
             ModifyTime,
             PublishTime,
             Editor,
-            CoverContent
+            CoverContent,
+            TitleSetting
         } = res.Data
         const pptDate = formatPPTDate(this.currentLang, PptDate)
         let legalContent = JSON.parse(Content)
@@ -212,6 +224,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,
@@ -227,7 +247,8 @@ export default {
             ModifyTime,
             PublishTime,
             Editor,
-            CoverContent
+            CoverContent,
+            TitleSetting:legalTitleSetting
         }
       }else{
         this.result = {status:'',content:'获取ppt数据失败!'}

+ 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')
       }

+ 1 - 0
src/views/ppt_manage/newVersion/css/common.scss

@@ -106,6 +106,7 @@ $titleColor:#333333;
             width:100%;
             height:100%;
             font-size: 16px;
+            word-break: break-all;
             ul{
                 margin-left: 1em;
                 list-style-type: disc;

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

@@ -522,7 +522,7 @@ export default {
       //防止自动保存时,有某一页处于更新图表的状态,其isUpdating为true
       this.pageList.forEach(i=>{
         i.isUpdating = false
-      })     
+      })
       this.dataLoading.close();
       $('.ppt-item').css('background-image',`url(${this.pptBgImage})`);
       //开启自动保存
@@ -534,13 +534,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{
@@ -577,6 +578,7 @@ export default {
             modelId: modelId,
             title:'',
             elements: [],
+            titleDetail:this.titleSetting?this.titleSetting:null
         }
         //限制取消
         /* if(this.pageList.length>=this.maxPageNum){
@@ -1121,7 +1123,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 +1145,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 +1184,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

+ 10 - 4
src/views/ppt_manage/newVersion/pptEnEditor.vue

@@ -540,13 +540,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{
@@ -583,6 +584,7 @@ export default {
             modelId: modelId,
             title:'',
             elements: [],
+            titleDetail:this.titleSetting?this.titleSetting:null
         }
         this.pageList.splice(index,0,page)
         this.changeCurrentItem(page)
@@ -1095,7 +1097,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){
@@ -1114,7 +1117,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){
@@ -1146,11 +1150,13 @@ export default {
           return i
         })
         let Content = JSON.stringify(pageList) 
+        let TitleSetting = JSON.stringify(this.titleSetting)
         pptEnInterface.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

+ 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])