浏览代码

Merge branch 'ETA1.4.9'

cxmo 1 年之前
父节点
当前提交
eec21285a0
共有 25 个文件被更改,包括 1089 次插入301 次删除
  1. 3 0
      src/api/modules/pptApi.js
  2. 3 0
      src/api/modules/pptEnApi.js
  3. 二进制
      src/assets/img/ppt_m/text-icon.png
  4. 2 1
      src/views/ppt_manage/mixins/layerMixins.js
  5. 9 1
      src/views/ppt_manage/mixins/pptEditorMixins.js
  6. 87 35
      src/views/ppt_manage/mixins/pptMixins.js
  7. 1 0
      src/views/ppt_manage/newVersion/components/Cover.vue
  8. 1 0
      src/views/ppt_manage/newVersion/components/CoverEn.vue
  9. 121 0
      src/views/ppt_manage/newVersion/components/CustomCover.vue
  10. 25 118
      src/views/ppt_manage/newVersion/components/catalog/mergePPTDialog.vue
  11. 4 2
      src/views/ppt_manage/newVersion/components/catalog/pptContent.vue
  12. 4 2
      src/views/ppt_manage/newVersion/components/catalog/pptContentEn.vue
  13. 1 0
      src/views/ppt_manage/newVersion/components/editor/ChooseCover.vue
  14. 1 0
      src/views/ppt_manage/newVersion/components/editor/ChooseCoverEn.vue
  15. 325 0
      src/views/ppt_manage/newVersion/components/editor/ChooseCoverNew.vue
  16. 192 0
      src/views/ppt_manage/newVersion/components/editor/chooseCover/TextEl.vue
  17. 204 0
      src/views/ppt_manage/newVersion/components/editor/chooseCover/elMixin.js
  18. 36 22
      src/views/ppt_manage/newVersion/pptEditor.vue
  19. 28 13
      src/views/ppt_manage/newVersion/pptEnEditor.vue
  20. 6 3
      src/views/ppt_manage/newVersion/pptEnPresent.vue
  21. 9 11
      src/views/ppt_manage/newVersion/pptEnPublish.vue
  22. 6 3
      src/views/ppt_manage/newVersion/pptPresent.vue
  23. 13 82
      src/views/ppt_manage/newVersion/pptPublish.vue
  24. 4 4
      src/views/ppt_manage/newVersion/utils/untils.js
  25. 4 4
      src/views/system_manage/etaBaseConfig.vue

+ 3 - 0
src/api/modules/pptApi.js

@@ -23,6 +23,7 @@ export default{
      * FirstPage:{Title,ReportType,PptDate,ImgUrl} 封面信息
      * FirstPage:{Title,ReportType,PptDate,ImgUrl} 封面信息
      * Content:string ppt具体内容,转字符串
      * Content:string ppt具体内容,转字符串
      * GroupId:目录id
      * GroupId:目录id
+     * CoverContent:string 封面页的具体内容,转字符串
      */
      */
     addppt:params=>{
     addppt:params=>{
         return http.post('/pptv2/add',params)
         return http.post('/pptv2/add',params)
@@ -32,6 +33,7 @@ export default{
      * PptId
      * PptId
      * FirstPage
      * FirstPage
      * Content
      * Content
+     * CoverContent
      */
      */
     editppt:params=>{
     editppt:params=>{
         return http.post('/pptv2/edit',params)
         return http.post('/pptv2/edit',params)
@@ -71,6 +73,7 @@ export default{
      * PptId
      * PptId
      * FirstPage
      * FirstPage
      * Content
      * Content
+     * CoverContent
      */
      */
     saveLog:params=>{
     saveLog:params=>{
         return http.post('/pptv2/saveLog',params)
         return http.post('/pptv2/saveLog',params)

+ 3 - 0
src/api/modules/pptEnApi.js

@@ -16,6 +16,7 @@ export const pptEnInterface = {
      * FirstPage:{Title,ReportType,PptDate,ImgUrl} 封面信息
      * FirstPage:{Title,ReportType,PptDate,ImgUrl} 封面信息
      * Content:string ppt具体内容,转字符串
      * Content:string ppt具体内容,转字符串
      * GroupId:目录id
      * GroupId:目录id
+     * CoverContent:string 封面页具体内容,转字符串
      */
      */
     addppt:params=>{
     addppt:params=>{
         return http.post('/ppt_english/add',params)
         return http.post('/ppt_english/add',params)
@@ -25,6 +26,7 @@ export const pptEnInterface = {
      * PptId
      * PptId
      * FirstPage
      * FirstPage
      * Content
      * Content
+     * CoverContent
      */
      */
     editppt:params=>{
     editppt:params=>{
         return http.post('/ppt_english/edit',params)
         return http.post('/ppt_english/edit',params)
@@ -56,6 +58,7 @@ export const pptEnInterface = {
      * PptId
      * PptId
      * FirstPage
      * FirstPage
      * Content
      * Content
+     * CoverContent
      */
      */
     saveLog:params=>{
     saveLog:params=>{
         return http.post('/ppt_english/saveLog',params)
         return http.post('/ppt_english/saveLog',params)

二进制
src/assets/img/ppt_m/text-icon.png


+ 2 - 1
src/views/ppt_manage/mixins/layerMixins.js

@@ -54,9 +54,10 @@ export default {
       }
       }
       //计算图层元素的百分比化的单位:基于.total-wrap而不是基于ppt-item
       //计算图层元素的百分比化的单位:基于.total-wrap而不是基于ppt-item
       const width = $('.total-wrap').width(),height = $('.total-wrap').height()
       const width = $('.total-wrap').width(),height = $('.total-wrap').height()
+      this.activeLayerEl = {...this.activeLayerEl,...options}
       const percentageShape = caclShapePercentage({layerWidth:width,layerHeight:height},this.activeLayerEl)
       const percentageShape = caclShapePercentage({layerWidth:width,layerHeight:height},this.activeLayerEl)
-      this.activeLayerEl = {...this.activeLayerEl,...percentageShape,...options}
       this.activeLayerEl.id = createRandomCode()
       this.activeLayerEl.id = createRandomCode()
+      this.activeLayerEl = {...this.activeLayerEl,...percentageShape}
       layerEls.push(this.activeLayerEl)
       layerEls.push(this.activeLayerEl)
       this.refleshLayerEl(layerEls)
       this.refleshLayerEl(layerEls)
     },
     },

+ 9 - 1
src/views/ppt_manage/mixins/pptEditorMixins.js

@@ -16,6 +16,7 @@ export default{
       copyPages:[],//选中的ppt页
       copyPages:[],//选中的ppt页
       copyPagesMap:{},//选中的ppt页Id
       copyPagesMap:{},//选中的ppt页Id
       savePagesArr:[],//存储上一次选中的ppt页
       savePagesArr:[],//存储上一次选中的ppt页
+      CoverContent:'',//自定义封面页内容
     }
     }
   },
   },
   directives: {
   directives: {
@@ -384,7 +385,14 @@ export default{
           //啥也不干
           //啥也不干
         }
         }
       });
       });
-    }
+    },
+    //保存修改的自定义封面页
+    saveCover2(info){
+        const {firstPage={},content=''} = info
+        this.firstPage = firstPage
+        this.CoverContent = content
+        this.isShowChooseCover = false
+    },
   },
   },
   mounted(){
   mounted(){
     document.addEventListener("keydown",this.handlePasteKey)
     document.addEventListener("keydown",this.handlePasteKey)

+ 87 - 35
src/views/ppt_manage/mixins/pptMixins.js

@@ -10,7 +10,7 @@ import futuresInterface from '@/api/modules/futuresBaseApi';
 import { fittingEquationInterface,statisticFeatureInterface,crossVarietyInterface } from '@/api/modules/chartRelevanceApi';
 import { fittingEquationInterface,statisticFeatureInterface,crossVarietyInterface } from '@/api/modules/chartRelevanceApi';
 import chartRelevanceApi from '@/api/modules/chartRelevanceApi.js';
 import chartRelevanceApi from '@/api/modules/chartRelevanceApi.js';
 import { defaultOpts } from '@/utils/defaultOptions';
 import { defaultOpts } from '@/utils/defaultOptions';
-import {formatPPTDate,checkPPTpageElemant,getStrSize,isShowPPTTitle} from '../newVersion/utils/untils.js';
+import {formatPPTDate,checkPPTpageElemant,getStrSize,isShowPPTTitle,toTextProps,toJson} from '../newVersion/utils/untils.js';
 import FormatOne from '../newVersion/components/formatPage/FormatOne.vue';
 import FormatOne from '../newVersion/components/formatPage/FormatOne.vue';
 import FormatTwo from '../newVersion/components/formatPage/FormatTwo.vue';
 import FormatTwo from '../newVersion/components/formatPage/FormatTwo.vue';
 import FormatThree from '../newVersion/components/formatPage/FormatThree.vue';
 import FormatThree from '../newVersion/components/formatPage/FormatThree.vue';
@@ -41,9 +41,10 @@ export default {
       pptCoverList:[],//配置ppt封面
       pptCoverList:[],//配置ppt封面
       pptBgImage:'',//ppt背景图
       pptBgImage:'',//ppt背景图
       pptBackImage:'',//ppt封底
       pptBackImage:'',//ppt封底
-      pptCoverCompenyName:'',//封面公司名称
-      pptCoverDepartName:'',//封面部门名称
-      pptCoverTextColor:'',//控制上面两个字段展示的颜色
+      pptCoverCompenyName:'',//封面公司名称 ETA1.4.9后不再使用
+      pptCoverDepartName:'',//封面部门名称 ETA1.4.9后不再使用
+      pptCoverTextColor:'',//控制上面两个字段展示的颜色 ETA1.4.9后不再使用
+      pptCoverContent:'',//自定义封面页的内容
 
 
 
 
       setEnName:false,
       setEnName:false,
@@ -60,6 +61,53 @@ export default {
     }
     }
   },
   },
   methods: {
   methods: {
+    //配置自定义封面内容
+    setPPTCover(cover,pptCoverContent='',title=''){
+        let contentList = []
+        try{
+            contentList = JSON.parse(pptCoverContent)
+        }catch(e){
+            contentList=[]
+        }
+        //将contentList的内容通过addText写入,方法与图层写入文字一致
+        for(let i=0;i<contentList.length;i++){
+            const {
+                percentageTop,
+                percentageLeft,
+                percentageWidth,
+                percentageHeight,
+                richContent
+            } = contentList[i]
+            const position = {
+                x:percentageLeft*100+'%',
+                y:percentageTop*100+'%',
+                w:percentageWidth*100+'%',
+                h:percentageHeight*100+'%'
+            }
+            let textData = toTextProps(toJson(richContent))
+            cover.addText(textData,{
+                ...position,
+                margin:10,
+                fontSize:16*0.75,
+                valign:'top'
+            })
+        }
+        //若contentList为空,则在右下的位置显示标题
+        if(!contentList.length){
+            cover.addText(
+                [{text:title,options:{fontSize:28*0.75,breakLine:true}}],
+                {
+                    x:'38%',
+                    y:'50%',
+                    w:'60%',
+                    h:'28%',
+                    color:'333333',
+                    align:'center',
+                    fontFace:'SimHei'
+                })
+        }
+        return cover
+    },
     //获取基本配置-ppt配置
     //获取基本配置-ppt配置
     async getpptConfig(){
     async getpptConfig(){
         const res = await etaBaseConfigInterence.getBaseConfig()
         const res = await etaBaseConfigInterence.getBaseConfig()
@@ -90,37 +138,41 @@ export default {
       }):await pptEnInterface.getpptDetail({PptId:id})
       }):await pptEnInterface.getpptDetail({PptId:id})
       if(res.Ret===200){
       if(res.Ret===200){
         const {
         const {
-			Content,
-			Title,
-			ReportType,
-			BackgroundImg,
-			PptDate,
-			TemplateType,
-      ReportId,
-      ModifyTime,
-      PublishTime,
-      Editor
-		} = res.Data
-      const pptDate = formatPPTDate(this.currentLang,PptDate)
-      let legalContent = JSON.parse(Content)
-      legalContent = legalContent.map(page=>{
-        page.elements = checkPPTpageElemant(page)
-        return page
-      })
-      this.result = {
-			status: 200,
-			content: legalContent,
-			FirstPage: {
-				Title,
-				ReportType,
-				BackgroundImg,
-				PptDate:pptDate,
-				TemplateType,
-			},
-      ReportId,
-      ModifyTime,
-      PublishTime,Editor
-		}
+            Content,
+            Title,
+            ReportType,
+            BackgroundImg,
+            PptDate,
+            TemplateType,
+            ReportId,
+            ModifyTime,
+            PublishTime,
+            Editor,
+            CoverContent
+        } = res.Data
+        const pptDate = formatPPTDate(this.currentLang, PptDate)
+        let legalContent = JSON.parse(Content)
+        legalContent = legalContent.map(page => {
+            page.elements = checkPPTpageElemant(page)
+            return page
+        })
+        this.pptCoverContent = CoverContent
+        this.result = {
+            status: 200,
+            content: legalContent,
+            FirstPage: {
+                Title,
+                ReportType,
+                BackgroundImg,
+                PptDate: pptDate,
+                TemplateType,
+            },
+            ReportId,
+            ModifyTime,
+            PublishTime,
+            Editor,
+            CoverContent
+        }
       }else{
       }else{
         this.result = {status:'',content:'获取ppt数据失败!'}
         this.result = {status:'',content:'获取ppt数据失败!'}
       }
       }

+ 1 - 0
src/views/ppt_manage/newVersion/components/Cover.vue

@@ -1,4 +1,5 @@
 <template>
 <template>
+    <!-- ETA1.4.9之前的展示封面组件,若该版本上线后无回滚需求,可删除 -->
     <div class="flex-column cover" :style="`width:100%;height:100%;color: ${$parent.pptCoverTextColor||'#fff'};`" v-if="pageInfo">
     <div class="flex-column cover" :style="`width:100%;height:100%;color: ${$parent.pptCoverTextColor||'#fff'};`" v-if="pageInfo">
         <!-- <img :src="pageInfo.BackgroundImg" class="pptbg" /> -->
         <!-- <img :src="pageInfo.BackgroundImg" class="pptbg" /> -->
         <!-- <img :src="base64Url" class="pptbg" /> -->
         <!-- <img :src="base64Url" class="pptbg" /> -->

+ 1 - 0
src/views/ppt_manage/newVersion/components/CoverEn.vue

@@ -1,4 +1,5 @@
 <template>
 <template>
+    <!-- ETA1.4.9之前的展示封面组件,若该版本上线后无回滚需求,可删除 -->
     <div class="flex-column cover" style="width:100%;height:100%;" v-if="pageInfo">
     <div class="flex-column cover" style="width:100%;height:100%;" v-if="pageInfo">
         <img :src="pageInfo.BackgroundImg" class="pptbg"  style="width:100%;height:100%;object-fit: fill !important;"/>
         <img :src="pageInfo.BackgroundImg" class="pptbg"  style="width:100%;height:100%;object-fit: fill !important;"/>
         <div
         <div

+ 121 - 0
src/views/ppt_manage/newVersion/components/CustomCover.vue

@@ -0,0 +1,121 @@
+<template>
+    <!-- 自定义封面页渲染 -->
+    <div class="cover-new-wrap cover">
+        <!-- 封面图 -->
+        <img :src="pageInfo.BackgroundImg||''" class="cover-img" style="object-fit: fill !important;">
+        <!-- 自定义文本 -->
+        <div v-for="el in coverList" :key="el.id"
+            class="cover-el el-text" :id="`cover-el-${el.id}`" :style="{
+            top: el.percentageTop*100 + '%',
+            left: el.percentageLeft*100 + '%',
+            width: el.percentageWidth*100 + '%',
+            height: el.percentageHeight*100 + '%',
+            pointerEvents:'none'
+        }" >
+            <div class="layer-editor-wrap">
+                <div style="width:100%;height:100%;" :id="`${el.id}-editorDom`" @mousedown.stop>
+                        <div class="editor-content" :style="{width:el.width+'px'}" v-html="el.richContent"></div>
+                </div>
+            </div>
+        </div>
+        <!-- 如果没有自定义文本,则在右下的位置显示标题 -->
+        <div class="cover-el default" v-if="!coverList.length">
+            <div class="editor-content"><p style="font-size:28px;">{{ pageInfo.Title }}</p></div>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    name:'CoverNew',
+    props: {
+        pageInfo: {
+            type: Object,
+            default:{}
+        },
+        CoverContent: {
+            type: String,
+            default: ''
+        }
+    },
+    watch:{
+        CoverContent(newval){
+            this.setCoverContent()
+        }
+    },
+    data() {
+        return {
+            coverList: [],
+        };
+    },
+    methods: {
+        setCoverContent() {
+            try{
+                this.coverList = JSON.parse(this.CoverContent)
+            }catch(e){
+                this.coverList = []
+            }
+        }
+    },
+    mounted() {
+        this.setCoverContent();
+    },
+};
+</script>
+
+<style lang="scss">
+    .cover-el {
+        .layer-editor-wrap {
+            .editor-content {
+                ul {
+                    margin-left: 1em;
+                    list-style-type: disc;
+                }
+
+                ol {
+                    margin-left: 1em;
+                    list-style-type: decimal;
+                }
+            }
+        }
+    }
+</style>
+<style scoped lang="scss">
+.cover-new-wrap{
+    width:100%;
+    height:100%;
+    position:relative;
+    .cover-img{
+        width: 100%;
+        height: 100%;
+    }
+    .cover-el{
+        position: absolute;
+        .layer-editor-wrap {
+            z-index: 2;
+            width: 100%;
+            height: 100%;
+            /* padding: 10px; */
+            box-sizing: border-box;
+            position: relative;
+            >div {
+                cursor: pointer;
+            }
+            .editor-content {
+                padding: 10px;
+                position: absolute;
+                transform-origin: 0 0;
+                word-wrap: break-word;
+            }
+        }
+        &.default{
+            width:62%; 
+            font-size:16px; 
+            text-align:center; 
+            line-height:1.6;
+            right:20px; 
+            top:50%;
+        }
+    }
+}
+</style>

+ 25 - 118
src/views/ppt_manage/newVersion/components/catalog/mergePPTDialog.vue

@@ -11,97 +11,9 @@
         <span style="fontsize: 16px">合并PPT</span>
         <span style="fontsize: 16px">合并PPT</span>
       </div>
       </div>
       <div class="dialog-container">
       <div class="dialog-container">
-      <!--  <div class="tree-container-wrap">
-          <div class="public-tree">
-            <h3>公共PPT</h3>
-            <div class="tree-container">
-              <div class="tree-list" :key="treeKey">
-                <div class="list-item" v-for="(item,index) in publicList" :key="item.nodeKeyId" @click.stop="expandList(index,'public')">
-                  <p class="item-label"><span @click.stop="expandList(index,'public')"><i :class="item.expand?'el-icon-caret-bottom':'el-icon-caret-right'"></i></span> {{item.label}}</p>
-                  <template v-if="item.expand">
-                    <div class="list-child" v-for="i in item.children" :key="i.nodeKeyId">
-                      <el-checkbox
-                        :disabled="disabled&&!choosedIdArr.includes(i.PptId)||i.disabled"
-                        v-model="i.checked"
-                        @change="(checked)=>{changeCheck(checked,i,'public')}"
-                      >{{i.label}}</el-checkbox>
-                    </div>
-                  </template>
-                </div>
-              </div>
-            </div>
-          </div>
-          <div class="private-tree">
-            <h3>我的PPT</h3>
-            <div class="tree-container">
-              <div class="tree-list" :key="treeKey">
-                <div class="list-item" v-for="(item,index) in privateList" :key="item.nodeKeyId" @click.stop="expandList(index,'private')">
-                  <p class="item-label"><span @click.stop="expandList(index,'private')"><i :class="item.expand?'el-icon-caret-bottom':'el-icon-caret-right'"></i></span> {{item.label}}</p>
-                  <template v-if="item.expand">
-                    <div class="list-child" v-for="i in item.children" :key="i.nodeKeyId">
-                      <el-checkbox
-                        :disabled="disabled&&!choosedIdArr.includes(i.PptId)||i.disabled"
-                        v-model="i.checked"
-                        @change="(checked)=>{changeCheck(checked,i,'private')}"
-                      >{{i.label}}</el-checkbox>
-                    </div>
-                  </template>
-                </div>
-              </div>
-            </div>
-          </div>
-        </div> -->
         <div class="ppt-form">
         <div class="ppt-form">
           <div class="input-item" style="position:relative;">
           <div class="input-item" style="position:relative;">
             <h3>请选择PPT</h3>
             <h3>请选择PPT</h3>
-            <!-- <div class="select-node-show" @click.stop="showCatalog = !showCatalog">
-              <div class="select-node" v-for="item in choosedItemArr" :key="item.PptId">
-                <span>{{ item.Title }}</span>
-                <i class="el-icon-error" @click.stop="changeCheck(false,item,'unknow')"></i>
-              </div>
-              <div v-show="choosedItemArr.length===0" style="color:#606266;opacity:.54;margin-left:10px;">请选择PPT</div>
-              <span class="expand" @click.stop="showCatalog = !showCatalog"><i :class="showCatalog?'el-icon-arrow-up':'el-icon-arrow-down'"></i></span>
-            </div>
-            <div class="catalog-wrap" v-show="showCatalog">
-              <div class="public-tree">
-                <h3>公共PPT</h3>
-                <div class="tree-container">
-                  <div class="tree-list" :key="treeKey">
-                    <div class="list-item" v-for="(item,index) in publicList" :key="item.nodeKeyId" @click.stop="expandList(index,'public')">
-                      <p class="item-label"><span @click.stop="expandList(index,'public')"><i :class="item.expand?'el-icon-caret-bottom':'el-icon-caret-right'"></i></span> {{item.label}}</p>
-                      <template v-if="item.expand">
-                        <div class="list-child" v-for="i in item.children" :key="i.nodeKeyId">
-                          <el-checkbox
-                            :disabled="disabled&&!choosedIdArr.includes(i.PptId)||i.disabled"
-                            v-model="i.checked"
-                            @change="(checked)=>{changeCheck(checked,i,'public')}"
-                          >{{i.label}}</el-checkbox>
-                        </div>
-                      </template>
-                    </div>
-                  </div>
-                </div>
-              </div>
-              <div class="private-tree" style="margin-top:10px;">
-                <h3>我的PPT</h3>
-                <div class="tree-container">
-                  <div class="tree-list" :key="treeKey">
-                    <div class="list-item" v-for="(item,index) in privateList" :key="item.nodeKeyId" @click.stop="expandList(index,'private')">
-                      <p class="item-label"><span @click.stop="expandList(index,'private')"><i :class="item.expand?'el-icon-caret-bottom':'el-icon-caret-right'"></i></span> {{item.label}}</p>
-                      <template v-if="item.expand">
-                        <div class="list-child" v-for="i in item.children" :key="i.nodeKeyId">
-                          <el-checkbox
-                            :disabled="disabled&&!choosedIdArr.includes(i.PptId)||i.disabled"
-                            v-model="i.checked"
-                            @change="(checked)=>{changeCheck(checked,i,'private')}"
-                          >{{i.label}}</el-checkbox>
-                        </div>
-                      </template>
-                    </div>
-                  </div>
-                </div>
-              </div>
-            </div> -->
             <div class="select-ppt-wrap select-wrap">
             <div class="select-ppt-wrap select-wrap">
               <el-tabs value="public">
               <el-tabs value="public">
                 <el-tab-pane label="公共PPT" name="public">
                 <el-tab-pane label="公共PPT" name="public">
@@ -165,21 +77,6 @@
             <h3>PPT标题</h3>
             <h3>PPT标题</h3>
             <el-input  placeholder="请输入PPT标题" v-model="pptInfo.Title" required ></el-input>
             <el-input  placeholder="请输入PPT标题" v-model="pptInfo.Title" required ></el-input>
           </div>
           </div>
-          <div class="input-item">
-            <h3>PPT类型</h3>
-            <el-input  placeholder="请输入PPT类型" v-model="pptInfo.ReportType" required ></el-input>
-          </div>
-  <!--         <div class="input-item date-picker">
-            <h3>PPT日期</h3>
-            <el-date-picker
-              v-model="pptInfo.PptDate"
-              type="month"
-              ref="date_pic"
-              format="yyyy年M月"
-              value-format="yyyy年M月"
-              placeholder="请选择日期">
-            </el-date-picker>
-          </div> -->
         </div>
         </div>
       </div>
       </div>
       <div slot="footer" class="foot-container">
       <div slot="footer" class="foot-container">
@@ -194,6 +91,7 @@
 <script>
 <script>
 import {pptInterface} from '@/api/api.js';
 import {pptInterface} from '@/api/api.js';
 import {pptEnInterface} from '@/api/modules/pptEnApi.js';
 import {pptEnInterface} from '@/api/modules/pptEnApi.js';
+import {etaBaseConfigInterence} from '@/api/modules/etaBaseConfigApi.js';
 import {changeCatalogArr,createRandomCode} from '../../utils/untils';
 import {changeCatalogArr,createRandomCode} from '../../utils/untils';
 export default {
 export default {
   props:{
   props:{
@@ -201,18 +99,14 @@ export default {
       type:Boolean,
       type:Boolean,
       default:false
       default:false
     },
     },
-/*     catalogId:{
-      type:Number,
-      default:0
-    } */
   },
   },
   data() {
   data() {
     return {
     return {
       pptInfo:{
       pptInfo:{
         Title:'',
         Title:'',
-        ReportType:'',
-        BackgroundImg:'https://hzstatic.hzinsights.com/ppt/bg3.jpg',
-        PptDate:(new Date().getFullYear())+'年'+(new Date().getMonth()+1)+'月',
+        //ReportType:'',
+        ImgUrl:'',//读取etaBaseConfig中封面页的第一个
+        //PptDate:(new Date().getFullYear())+'年'+(new Date().getMonth()+1)+'月',
         BackIndex:0,
         BackIndex:0,
         TemplateType:1
         TemplateType:1
       },//PPT的标题信息
       },//PPT的标题信息
@@ -236,6 +130,7 @@ export default {
         this.init()
         this.init()
         this.getCatalogsList()
         this.getCatalogsList()
         this.getPrivateList()
         this.getPrivateList()
+        this.getBaseConfig()
       }
       }
       if(!newValue){
       if(!newValue){
         if(this.saveLoading){
         if(this.saveLoading){
@@ -268,9 +163,17 @@ export default {
       }
       }
       await this.addNewPpt()
       await this.addNewPpt()
       if(this.PptId!==0){
       if(this.PptId!==0){
-        this.$emit('merged',{PptId:this.PptId,catalogId:this.selectedCatalogId})
+        //this.$emit('merged',{PptId:this.PptId,catalogId:this.selectedCatalogId})
+        this.saveLoading.close()
+        //跳转至ppt编辑页
+        const path = this.$parent.currentLang!=='en'?'/ppteditor':'/ppteneditor'
+        this.$router.push({
+            path,
+            query:{
+                id:this.PptId
+            }
+        })
       }
       }
-        
     },
     },
     //检查填写的信息是否合法
     //检查填写的信息是否合法
     checkForm(){
     checkForm(){
@@ -281,12 +184,12 @@ export default {
       if(!this.pptInfo.Title.length){
       if(!this.pptInfo.Title.length){
         return {result:false,msg:'请填写PPT标题'}
         return {result:false,msg:'请填写PPT标题'}
       }
       }
-      if(!this.pptInfo.ReportType){
+      /* if(!this.pptInfo.ReportType){
         return {result:false,msg:'请填写PPT类型'}
         return {result:false,msg:'请填写PPT类型'}
       }
       }
       if(!this.pptInfo.PptDate){
       if(!this.pptInfo.PptDate){
         return {result:false,msg:'请选择日期'}
         return {result:false,msg:'请选择日期'}
-      }
+      } */
       if(this.selectedCatalogId===0){
       if(this.selectedCatalogId===0){
         return {result:false,msg:'请选择一个目录'}
         return {result:false,msg:'请选择一个目录'}
       }
       }
@@ -440,12 +343,16 @@ export default {
     //重置data的值
     //重置data的值
     init(){
     init(){
       Object.assign(this.$data,this.$options.data())
       Object.assign(this.$data,this.$options.data())
+    },
+    getBaseConfig(){
+        etaBaseConfigInterence.getBaseConfig().then(res=>{
+                if(res.Ret!==200) return
+                const {CnPptCoverImgs='',EnPptCoverImgs=''} = res.Data||{}
+                this.pptInfo.ImgUrl = this.$parent.currentLang!=='en'?CnPptCoverImgs.split(',')[0]:EnPptCoverImgs.split(',')[0]
+        })
     }
     }
   },
   },
-  mounted(){
-    //console.log('merge')
-    //this.getCatalogsList()
-  }
+  mounted(){}
 };
 };
 </script>
 </script>
 
 

+ 4 - 2
src/views/ppt_manage/newVersion/components/catalog/pptContent.vue

@@ -4,7 +4,8 @@
     <div class="ppt-scroll">
     <div class="ppt-scroll">
       <template  v-for="(item,index) in loadArr">
       <template  v-for="(item,index) in loadArr">
           <div class="ppt-item" id="cover" v-if="index===0" :key="item.id">
           <div class="ppt-item" id="cover" v-if="index===0" :key="item.id">
-            <Cover :pageInfo="firstPage" v-show="firstPage"></Cover>
+            <!-- <Cover :pageInfo="firstPage" v-show="firstPage"></Cover> -->
+            <CustomCover :pageInfo="firstPage" :CoverContent="pptCoverContent" v-show="firstPage"/>
             <!-- <div class="ppt-info">
             <!-- <div class="ppt-info">
               <p>作者:{{pptItem.AdminRealName}}</p>
               <p>作者:{{pptItem.AdminRealName}}</p>
               <p>{{pptItem.PptxUrl?'发布':'保存'}}时间:{{$moment(pptTime).format('YYYY-MM-DD')}}</p>
               <p>{{pptItem.PptxUrl?'发布':'保存'}}时间:{{$moment(pptTime).format('YYYY-MM-DD')}}</p>
@@ -54,6 +55,7 @@ import Highcharts from "highcharts/highstock";
 import HighchartszhCN  from '@/utils/highcahrts-zh_CN'
 import HighchartszhCN  from '@/utils/highcahrts-zh_CN'
 HighchartszhCN(Highcharts)
 HighchartszhCN(Highcharts)
 import addMyClassifyDia from '@/views/dataEntry_manage/components/addMyClassifyDia';
 import addMyClassifyDia from '@/views/dataEntry_manage/components/addMyClassifyDia';
+import CustomCover from '../CustomCover.vue';
 export default {
 export default {
   props:{
   props:{
     pptItem:{ //ppt信息
     pptItem:{ //ppt信息
@@ -61,7 +63,7 @@ export default {
     }
     }
   },
   },
   mixins:[pptmixin,mixins],
   mixins:[pptmixin,mixins],
-  components:{Cover,addMyClassifyDia},
+  components:{ Cover, addMyClassifyDia, CustomCover },
   data() {
   data() {
     return {
     return {
         pageList:[],//ppt数组
         pageList:[],//ppt数组

+ 4 - 2
src/views/ppt_manage/newVersion/components/catalog/pptContentEn.vue

@@ -3,7 +3,8 @@
     <div class="ppt-scroll">
     <div class="ppt-scroll">
       <template  v-for="(item,index) in loadArr">
       <template  v-for="(item,index) in loadArr">
           <div class="ppt-item" id="cover" v-if="index===0" :key="item.id">
           <div class="ppt-item" id="cover" v-if="index===0" :key="item.id">
-            <Cover :pageInfo="firstPage" v-show="firstPage"></Cover>
+            <!-- <Cover :pageInfo="firstPage" v-show="firstPage"></Cover> -->
+            <CustomCover :pageInfo="firstPage" :CoverContent="pptCoverContent" v-show="firstPage"/>
             <!-- <div class="ppt-info">
             <!-- <div class="ppt-info">
               <p>作者:{{pptItem.AdminRealName}}</p>
               <p>作者:{{pptItem.AdminRealName}}</p>
               <p>{{pptItem.PptxUrl?'发布':'保存'}}时间:{{$moment(pptTime).format('YYYY-MM-DD')}}</p>
               <p>{{pptItem.PptxUrl?'发布':'保存'}}时间:{{$moment(pptTime).format('YYYY-MM-DD')}}</p>
@@ -53,6 +54,7 @@ import Highcharts from "highcharts/highstock";
 import HighchartszhCN  from '@/utils/highcahrts-zh_CN'
 import HighchartszhCN  from '@/utils/highcahrts-zh_CN'
 HighchartszhCN(Highcharts)
 HighchartszhCN(Highcharts)
 import addMyClassifyDia from '@/views/dataEntry_manage/components/addMyClassifyDia';
 import addMyClassifyDia from '@/views/dataEntry_manage/components/addMyClassifyDia';
+import CustomCover from '../CustomCover.vue';
 export default {
 export default {
   props:{
   props:{
     pptItem:{ //ppt信息
     pptItem:{ //ppt信息
@@ -60,7 +62,7 @@ export default {
     }
     }
   },
   },
   mixins:[pptmixin,mixins],
   mixins:[pptmixin,mixins],
-  components:{Cover,addMyClassifyDia},
+  components:{Cover,addMyClassifyDia,CustomCover},
   data() {
   data() {
     return {
     return {
         pageList:[],//ppt数组
         pageList:[],//ppt数组

+ 1 - 0
src/views/ppt_manage/newVersion/components/editor/ChooseCover.vue

@@ -1,4 +1,5 @@
 <template>
 <template>
+    <!-- ETA1.4.9之前的选择封面组件,若该版本上线后无回滚需求,可删除 -->
     <div class="first_dialog">
     <div class="first_dialog">
         <div class="dialog-min">
         <div class="dialog-min">
             <header class="dialog-top">
             <header class="dialog-top">

+ 1 - 0
src/views/ppt_manage/newVersion/components/editor/ChooseCoverEn.vue

@@ -1,4 +1,5 @@
 <template>
 <template>
+    <!-- ETA1.4.9之前的选择封面组件,若该版本上线后无回滚需求,可删除 -->
     <div class="first_dialog">
     <div class="first_dialog">
         <div class="dialog-min">
         <div class="dialog-min">
             <header class="dialog-top">
             <header class="dialog-top">

+ 325 - 0
src/views/ppt_manage/newVersion/components/editor/ChooseCoverNew.vue

@@ -0,0 +1,325 @@
+<template>
+    <!-- ppt自定义封面编辑 -->
+    <el-dialog
+        :visible.sync="isShowChooseCover" 
+        :close-on-click-modal="false" 
+        :modal-append-to-body="false"
+        title="自定义封面页"
+        custom-class="choose-cover-new-wrap"
+        v-dialogDrag center width="75%" top="5vh"
+        @close="$emit('close')"
+    >
+        <div class="container" v-loading="coverLoading">
+            <div class="edit-cover-wrap" @mousedown.stop="clickOutside">
+                <div class="cover">
+                    <!-- 封面图 -->
+                    <div class="editor-area" :style="`background-image:url(${pptCoverList[choosedIndex]});`">
+                        <!-- 封面内文本元素 -->
+                        <TextEl v-for="el in coverElList" :key="el.id"
+                            :element-info="el"
+                            :isCoverEdit="true"
+                            :isActive="el.id===activeEl.id"
+                            @click.stop.native="changeActEl(el)"
+                            @deleteEl="deleteEl"
+                            @copyEl="getCopyEl"
+                        />
+                    </div>
+                </div>
+                <div class="editor-tool">
+                    <div class="title-box box">
+                        <p><span style="color:#D54941;margin-left: 0;margin-right: 3px;">*</span>PPT标题</p>
+                        <el-input v-model="pageData.Title"
+                            placeholder="请输入PPT标题" style="width:100%;margin-top:10px;"></el-input>
+                    </div>
+                    <div class="el-box box">
+                        <p @click.stop="addTextEl">插入文本<span style="vertical-align: middle;"><img src="~@/assets/img/ppt_m/text-icon.png"></span></p>
+                    </div>
+                    <div class="el-tool-box box">
+                        <p style="margin-bottom: 10px;">文本设置 <span v-if="!activeEl.id" style="color:#B2B9CB;">请选择文本元素</span></p>
+                        <div class="cover-text-toolbar" @mousedown.stop></div>
+                    </div>
+                    <div class="dialog-btn">
+                        <el-button @click="changeBg">换一个模板</el-button>
+                        <el-button @click="saveCover">保存</el-button>
+                    </div>
+                </div>
+            </div>
+        </div>
+        
+    </el-dialog>
+
+</template>
+
+<script>
+import TextEl from './chooseCover/TextEl.vue';
+import { BaseTextShape } from '@/views/ppt_manage/newVersion/utils/config';
+import {createRandomCode,caclShapePercentage} from "@/views/ppt_manage/newVersion/utils/untils";
+import {pptInterface} from '@/api/api.js';
+import {pptEnInterface} from '@/api/modules/pptEnApi.js';
+import html2canvas from 'html2canvas';
+export default {
+    props: {
+        isShowChooseCover: {
+            type: Boolean,
+            default: false
+        },
+        firstPage: {
+            type: Object,
+            default: {}
+        },
+        pptCoverList: {
+            type: Array,
+            default: []
+        },
+        CoverContent: {
+            type: String,
+            default: ''
+        },
+        PptId:{
+            type:Number,
+            default:0
+        }
+    },
+    data() {
+        return {
+            coverElList: [], //封面自定义内容
+            activeEl:{}, //当前选择的元素
+            copyEl:{}, //当前copy的元素
+            pageData:{Title:''}, //封面标题,背景图等设置
+            searchIndex:0,
+            choosedIndex:0,
+            coverLoading:false,
+        };
+    },
+    watch:{
+        isShowChooseCover(newVal){
+            this.changeActEl({})
+            if(newVal){
+                this.setCoverInfo()
+            }
+        }
+    },
+    methods: {
+        setCoverInfo() {
+            this.pageData.Title = this.firstPage.Title||''
+            this.searchIndex = this.pptCoverList.findIndex(i=>i===this.firstPage.BackgroundImg)
+            //如果基本配置-封面图,没有当前ppt的封面图,则默认第一个
+            if(this.searchIndex===-1){
+                this.pageData.BackgroundImg = this.pptCoverList[0]
+            }
+            //如果封面页内容不是合法的json,置空
+            try{
+                this.coverElList = JSON.parse(this.CoverContent);
+            }catch(e){
+                this.coverElList = []
+            }
+        },
+        //保存封面配置
+        async saveCover() {
+            if(!this.pageData.Title.length){
+                return this.$message.warning("请输入PPT标题")
+            }
+            const coverContent = JSON.stringify(this.coverElList);
+            //this.coverLoading=true
+            //校验标题
+            const pptId = this.$route.query.id || this.PptId||0
+            const res = this.$parent.currentLang!=='en'
+                ?await pptInterface.pptTitleCheck({PptId:pptId,Title:this.pageData.Title})
+                :await pptEnInterface.pptTitleCheck({PptId:pptId,Title:this.pageData.Title})
+            if(res.Ret===200){
+                //const coverBase64 = await this.coverToCanvas()
+                //this.coverLoading=false
+                this.$emit('saveCover', {
+                        firstPage:Object.assign(this.firstPage,this.pageData),
+                        content:coverContent,
+                        //covetImg:coverBase64||''
+                    })
+            }
+        },
+        //封面截图
+        async coverToCanvas(){
+            console.log('start')
+            this.changeActEl({})
+            //editor-area
+            const canvasWrap = document.querySelector('.editor-area')
+            //将背景图清空,防止跨域的问题
+            if(!canvasWrap) return
+            canvasWrap.scrollTop = 0
+            canvasWrap.scrollLeft=0
+            const width = $('.editor-area').width()
+            const height = Number((width*0.7).toFixed(2))
+            console.log('width,height',width,height)
+            const cover = $('.editor-area')[0]
+            cover.style.backgroundImage = 'none'
+            let canvas = await html2canvas(
+                cover,
+                {
+                    useCORS: true,
+                    allowTaint:true,
+                    backgroundColor: `transparent`,
+                    /* scale: 2, */
+                    imageTimeout: 0,
+                    width:width,
+                    height:height
+                }
+            )
+            console.log('finished')
+            const url = canvas.toDataURL("image/png")
+            this.checkImg(url)
+            //转换完成后,将背景图设置回来
+            cover.style.backgroundImage = `url(${this.pptCoverList[this.choosedIndex]})`
+            return url
+        },
+            //测试用
+        checkImg(dataURL,fileType='png'){
+            let link = document.createElement('a')
+            link.href = dataURL
+            link.download = `test.${fileType}`
+            link.click()
+        },
+        changeActEl(el){
+            this.activeEl = el
+        },
+        clickOutside(){
+            this.changeActEl({})
+        },
+        changeBg(){
+            if(this.choosedIndex<this.pptCoverList.length-1){
+                this.choosedIndex++
+            }else{
+                this.choosedIndex=0
+            }
+            this.pageData.BackgroundImg = this.pptCoverList[this.choosedIndex]
+        },
+        addTextEl(options={}){
+            let el = _.cloneDeep(BaseTextShape)
+            el = {...el,...options}
+            const areaWidth = $(".editor-area").width()||0
+            const areaHeight = areaWidth*0.7
+            const percentageShape = caclShapePercentage({layerWidth:areaWidth,layerHeight:areaHeight},el)
+            el = {...el,...percentageShape}
+            el.id = createRandomCode()
+            this.coverElList.push(el)
+            this.changeActEl(el)
+        },
+        deleteEl(el){
+            this.changeActEl({})
+            const index = this.coverElList.findIndex(e=>e.id===el.id)
+            index!==-1&&(this.coverElList.splice(index,1))
+        },
+        getCopyEl(el){
+            this.copyEl = el
+            this.pasteEl("copy")
+        },
+        pasteEl(type="copy"){
+            const {width,height,left,top} = this.copyEl
+            const areaWidth = $(".editor-area").width()||0
+            const areaHeight = areaWidth*0.7
+            //在原先元素右下方渲染新元素
+            const points = {clientX:left+10,clientY:top+10}
+            const supplyValue = type==='copy'?10:0 //补值,防止渲染出边界
+            const new_left = ((points.clientX+width) - areaWidth)>0?(areaWidth - width - supplyValue):points.clientX
+            const new_top =  ((points.clientY+height) - areaHeight)>0?(areaHeight - height - supplyValue):points.clientY
+            const options = {...this.copyEl,...{
+                left:new_left,
+                top:new_top,
+                width,
+                height,
+                realWidth:width,
+                realHeight:height
+            }}
+            this.addTextEl(options)
+        },
+    },
+    components: { TextEl }
+};
+</script>
+
+<style lang="scss">
+.choose-cover-new-wrap{
+    max-width:1360px;
+    height: 90%;
+    overflow: hidden !important;
+    margin-bottom: 0;
+    display: flex;
+    flex-direction: column;
+    .el-dialog__body{
+        padding:25px !important;
+        flex: 1;
+        overflow: auto;
+        color: inherit;
+    }
+    .tox-menu.tox-swatches-menu.tox-selected-menu{
+      left:auto !important;
+      right:0;
+    }
+    .tox-menu{
+        max-height: 200px !important;
+      }
+}
+</style>
+<style scoped lang="scss">
+.choose-cover-new-wrap{
+    .container{
+        width:100%;
+        height:100%;
+        display: flex;
+        flex-direction: column;
+        .edit-cover-wrap{
+            display: flex;
+            flex: 1;
+            /* overflow: auto; */
+            .cover,.editor-tool{
+                box-sizing: border-box;
+            }
+            .cover{
+                min-width: 640px;
+                flex:1;
+                background-color: #c8cdd921;
+                display: flex;
+                align-items: center;
+                box-sizing: border-box;
+                border:1px solid #C8CDD9;
+                border-radius: 4px;
+                padding:10px;
+                overflow-y: visible;
+                .editor-area{
+                    position: relative;
+                    width:100%;
+                    height: 0;
+                    padding-bottom: 70%;
+                    /* background-color:bisque; */
+                    background-repeat: no-repeat;
+                    background-position: center;
+                    background-size: 100% 100%;
+                }
+            }
+            .editor-tool{
+                min-width:320px;
+                padding-left:20px;
+                position:relative;
+                /* background-color: burlywood; */
+                .box{
+                    margin-bottom: 10px;
+                    p{
+                        span{
+                            cursor: pointer;
+                            margin-left: 10px;
+                            img{
+                                width:23px;
+                                height:23px;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        .dialog-btn{
+            position:absolute;
+            right:0;
+            bottom: 0;
+        }
+        
+    }
+}
+</style>

+ 192 - 0
src/views/ppt_manage/newVersion/components/editor/chooseCover/TextEl.vue

@@ -0,0 +1,192 @@
+<template>
+    <!-- 自定义封面 文本编辑框 -->
+    <div class="cover-el el-text" :id="`cover-el-${elementInfo.id}`" :style="isCoverEdit?{
+        top: elementInfo.top + 'px',
+        left: elementInfo.left + 'px',
+        width: elementInfo.width + 'px',
+        height: elementInfo.height + 'px',
+      }:{
+        top: elementInfo.percentageTop*100 + '%',
+        left: elementInfo.percentageLeft*100 + '%',
+        width: elementInfo.percentageWidth*100 + '%',
+        height: elementInfo.percentageHeight*100 + '%',
+        pointerEvents:'none'
+      }" 
+      @mousedown.stop="(e)=>{handleMoveStart(e,'move')}" @contextmenu.stop="showContentMenu">
+        <!-- 裹一层,方便拖拽和移动 -->
+        <div class="layer-editor-wrap">
+            <div style="width:100%;height:100%;" :id="`${elementInfo.id}-editorDom`" @mousedown.stop>
+                <template v-if="isCoverEdit">
+                    <Editor v-model="elementInfo.richContent" :init="setting" ref="editor"></Editor>
+                </template>
+                <template v-else>
+                    <div class="editor-content" :style="{width:elementInfo.width+'px'}"
+                        v-html="elementInfo.richContent"></div>
+                </template>
+            </div>
+        </div>
+        <div class="borderline" v-if="isActive">
+            <div class="left-1 resize-handle" @mousedown.stop="(e)=>{handleScaleStart(e,'LEFT_TOP')}"></div>
+            <div class="left-2 resize-handle" @mousedown.stop="(e)=>{handleScaleStart(e,'LEFT')}"></div>
+            <div class="left-3 resize-handle" @mousedown.stop="(e)=>{handleScaleStart(e,'LEFT_BOTTOM')}"></div>
+            <div class="line-middle-1 resize-handle" @mousedown.stop="(e)=>{handleScaleStart(e,'TOP')}"></div>
+            <div class="line-middle-2 resize-handle" @mousedown.stop="(e)=>{handleScaleStart(e,'BOTTOM')}"></div>
+            <div class="right-1 resize-handle" @mousedown.stop="(e)=>{handleScaleStart(e,'RIGHT_TOP')}"></div>
+            <div class="right-2 resize-handle" @mousedown.stop="(e)=>{handleScaleStart(e,'RIGHT')}"></div>
+            <div class="right-3 resize-handle" @mousedown.stop="(e)=>{handleScaleStart(e,'RIGHT_BOTTOM')}"></div>
+        </div>
+        <!-- 自定义右键菜单 -->
+        <ContextMenu :menu="contextmenus" :menuId="elementInfo.id" @deleteShape="handleDeleteLayer"
+            @copyShape="handleCopyShape" />
+    </div>
+</template>
+
+<script>
+    import {
+        BaseTextShape
+    } from '@/views/ppt_manage/newVersion/utils/config';
+    import elMixin from './elMixin';
+    import Editor from "@tinymce/tinymce-vue";
+    import "tinymce/themes/silver";
+    import "tinymce/plugins/lists"; //列表插件
+    import "tinymce/plugins/quickbars"; //快速栏插件
+    import "tinymce/plugins/fullscreen"; //全屏插件
+    import "tinymce/plugins/paste"; //黏贴插件
+    import "tinymce/icons/default/icons";
+    export default {
+        mixins: [elMixin],
+        props: {
+            elementInfo: {
+                type: Object,
+                default: () => {
+                    return BaseTextShape
+                }
+            },
+            isCoverEdit:{
+                type:Boolean,
+                default:false,
+            },
+            isActive:{
+                type:Boolean,
+                default:false
+            }
+        },
+        components: {
+            Editor
+        },
+        data() {
+            return {
+                setting: {
+                    language: "zh_CN",
+                    language_url: require("../../../utils/zh_CN.js"),
+                    menubar: false,
+                    toolbar: [
+                        "indent outdent alignleft aligncenter alignright alignjustify forecolor",
+                        "bold italic underline strikethrough numlist bullist backcolor",
+                        "fontselect fontsizeselect",
+                    ],
+                    quickbars_selection_toolbar: false,
+                    quickbars_insert_toolbar: false,
+                    plugins: "lists quickbars paste",
+                    height: 350,
+                    inline: true,
+                    selector: `#${this.elementInfo.id}-editorDom`,
+                    paste_as_text: true,
+                    fontsize_formats: '12px 14px 16px 18px 20px 22px 24px 36px 48px',
+                    font_formats: `微软雅黑='微软雅黑';宋体='宋体';黑体='黑体';仿宋='仿宋';
+                        楷体='楷体';隶书='隶书';幼圆='幼圆';Andale Mono=andale mono,times;
+                        Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;
+                        Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;
+                        Courier New=courier new,courier;Georgia=georgia,palatino;
+                        Helvetica=helvetica;Impact=impact,chicago;
+                        Webdings=webdings;Wingdings=wingdings`,
+                    fixed_toolbar_container: ".cover-text-toolbar", //将toolbar放到指定div上
+                    skin_url: "/static/css",
+                    content_url: "/static/css",
+                    //加placeholder
+                    placeholder: "点击输入文本内容"
+                }
+            };
+        },
+        methods: {
+            
+        },
+    };
+</script>
+<style lang="scss">
+    .cover-el {
+        .layer-editor-wrap {
+            .editor-content {
+                ul {
+                    margin-left: 1em;
+                    list-style-type: disc;
+                }
+
+                ol {
+                    margin-left: 1em;
+                    list-style-type: decimal;
+                }
+            }
+        }
+    }
+</style>
+<style scoped lang="scss">
+    .cover-el {
+        position: absolute;
+        .layer-editor-wrap {
+            z-index: 2;
+            width: 100%;
+            height: 100%;
+            padding: 10px; //空出可以移动的区域
+            box-sizing: border-box;
+            position: relative;
+            >div {
+                cursor: pointer;
+            }
+            .editor-content {
+                /* padding: 10px; */
+                font-size: 16px;
+                position: absolute;
+                transform-origin: 0 0;
+                word-wrap: break-word;
+            }
+            .mce-content-body{
+                padding: 0 !important;
+            }
+            .mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before {
+                left: 0px !important;
+            }
+        }
+        cursor:move;
+        .borderline{
+          z-index: 1;
+          position:absolute;
+          left:0;
+          right:0;
+          top:0;
+          bottom: 0;
+          border: 1px dashed black;
+          &.line{
+            border:none;
+          }
+          .resize-handle{
+            position:absolute;
+            margin: -5px;
+            width:10px;
+            height:10px;
+            border: 1px solid #6324d1;
+            box-sizing: content-box;
+            background-color: #fff;
+            &.left-1,&.left-2,&.left-3{left:0;}
+            &.left-1,&.right-1,&.line-middle-1{top:0;}
+            &.left-2,&.right-2{top:calc(50% + 5px);transform: translateY(-50%);}
+            &.left-3,&.right-3,&.line-middle-2{bottom:0;}
+            &.right-1,&.right-2,&.right-3{right:0;}
+            &.left-1,&.right-3,&.end,&.start{cursor: nwse-resize;}
+            &.left-2,&.right-2{cursor: ew-resize;}
+            &.left-3,&.right-1{cursor: nesw-resize;}
+            &.line-middle-1,&.line-middle-2{left:calc(50% + 5px);transform: translateX(-50%);cursor: ns-resize;}
+          }
+        }
+    }
+</style>

+ 204 - 0
src/views/ppt_manage/newVersion/components/editor/chooseCover/elMixin.js

@@ -0,0 +1,204 @@
+import{getBoundary,caclShapePercentage} from "@/views/ppt_manage/newVersion/utils/untils";
+import ContextMenu from "@/views/ppt_manage/newVersion/components/layer/Element/ShapeContextMenu.vue";
+export default{
+    components:{ContextMenu},
+    data(){
+        return {
+          movePoint:{ //移动时,记录鼠标的位置
+            startX:null,
+            startY:null,
+            moveX:null,
+            moveY:null,
+          },
+          scalePoint:{//缩放时,记录鼠标的位置
+            startX:null,
+            startY:null,
+            moveX:null,
+            moveY:null,
+          },
+          isMouseDown:false,//鼠标是否按下
+          eventType:'move',//当前进行的事件:move:移动元素,resize:缩放元素
+          contextmenus:[
+            {id:1,text:'删除元素',eventName:'deleteShape'},
+            {id:2,text:'复制元素',eventName:'copyShape'}
+          ],//右键菜单的菜单项
+          isContextMenusShow:false,//右键菜单是否显示
+        }
+    },
+    methods:{
+        //开始移动
+        handleMoveStart(event){
+          if(!this.isActive) return
+          //保存移动前的坐标
+          this.isMouseDown = true
+          this.eventType = 'move'
+          this.movePoint.startX = event.clientX
+          this.movePoint.startY = event.clientY
+          document.onmousemove=(e)=>{
+          //如果显示了右键菜单,隐藏掉
+            if(this.isContextMenusShow){
+              this.hideContextMenu()
+            }
+            this.handleMove(e)
+          }
+          document.onmouseup = ()=>{
+            this.isMouseDown = false
+            document.onmousemove = null
+            document.onmouseup = null
+          }
+        },
+        //移动中
+        handleMove(e){
+          if(!this.isMouseDown) return 
+          const {startX,startY} = this.movePoint
+          this.movePoint.moveX = e.clientX-startX
+          this.movePoint.moveY = e.clientY-startY
+          //设置移动的边界点:不能超出editor-area
+          const areaWidth = $(".editor-area").width()||0
+          const areaHeight = areaWidth*0.7
+          let moveInfo = {}
+          moveInfo.left = Math.min(Math.max(this.elementInfo.left+this.movePoint.moveX,0),areaWidth-this.elementInfo.width)
+          moveInfo.top = Math.min(Math.max(this.elementInfo.top+this.movePoint.moveY,0),areaHeight-this.elementInfo.height)
+          this.changeStyle(moveInfo,{})
+          //改变完后,更新movePoint的位置
+          this.movePoint.startX = e.clientX
+          this.movePoint.startY = e.clientY
+        },
+        //开始缩放
+        handleScaleStart(event,direction){
+          this.isMouseDown = true
+          this.eventType = 'resize'
+          this.scalePoint.startX = event.clientX
+          this.scalePoint.startY = event.clientY
+          document.onmousemove=(e)=>{
+            //如果显示了右键菜单,隐藏掉
+            if(this.isContextMenusShow){
+              this.hideContextMenu()
+            }
+            this.handleScale(e,direction)
+          }
+          document.onmouseup = ()=>{
+            this.isMouseDown = false
+            document.onmousemove = null
+            document.onmouseup = null
+          }
+        },
+        //缩放中
+        handleScale(e,direction){
+          if(!this.isMouseDown) return 
+          const {left,top,width,height} = this.elementInfo
+          let scaleInfo = {left:left,top:top,width:width,height:height}
+          //根据direction和moveX,moveY算出元素应该缩放+移动的参数
+          const {startX,startY} = this.scalePoint
+          this.scalePoint.moveX = e.clientX-startX
+          this.scalePoint.moveY = e.clientY-startY
+          //计算拖拽后位置和宽高
+          const areaWidth = $(".editor-area").width()||0
+          const areaHeight = areaWidth*0.7
+          //常规的八个点
+          //左上角:拖拽会改变left,top,width,height
+          if(direction==='LEFT_TOP'){
+            scaleInfo.left = getBoundary(Math.max(left + this.scalePoint.moveX,0),0,(areaWidth - (scaleInfo.width+5)))
+            scaleInfo.top = getBoundary(Math.max(top + this.scalePoint.moveY,0),0,(areaHeight-(scaleInfo.height+5)))
+            if(scaleInfo.left===0){
+             scaleInfo.width = getBoundary(width - this.scalePoint.moveX,25,width) 
+            }else{
+              scaleInfo.width = getBoundary(width - this.scalePoint.moveX,25,areaWidth)
+            }
+            if(scaleInfo.top===0){
+              scaleInfo.height = getBoundary(height - this.scalePoint.moveY,25,height)
+            }else{
+              scaleInfo.height = getBoundary(height - this.scalePoint.moveY,25,areaHeight)
+            }
+          }
+          //左中:拖拽会改变left,width
+          else if (direction==="LEFT"){
+            scaleInfo.width = getBoundary(width - this.scalePoint.moveX,25,areaWidth)
+            scaleInfo.left = getBoundary(Math.max(left + this.scalePoint.moveX,0),0,(areaWidth - (scaleInfo.width+5)))
+            
+          }
+          //左下:拖拽会改变left,width,height
+          else if(direction==="LEFT_BOTTOM"){
+            scaleInfo.width = getBoundary(width - this.scalePoint.moveX,25,areaWidth)
+            scaleInfo.height = getBoundary(height + this.scalePoint.moveY,25,areaHeight)
+            scaleInfo.left = getBoundary(Math.max(left + this.scalePoint.moveX,0),0,(areaWidth - (scaleInfo.width+5)))
+          }
+          //右上:拖拽会改变top,width,height
+          else if(direction==="RIGHT_TOP"){
+            scaleInfo.width = getBoundary(width + this.scalePoint.moveX,25,areaWidth-left)
+            scaleInfo.height = getBoundary(height - this.scalePoint.moveY,25,areaHeight-top)
+            scaleInfo.top = Math.max(top + this.scalePoint.moveY,0)
+          }
+          //右中:拖拽会改变width
+          else if(direction==="RIGHT"){
+            scaleInfo.width = getBoundary(width + this.scalePoint.moveX,25,areaWidth-left)
+          }
+          //右下:拖拽会改变width,height
+          else if(direction==="RIGHT_BOTTOM"){
+            scaleInfo.width = getBoundary(width + this.scalePoint.moveX,25,areaWidth-left)
+            scaleInfo.height = getBoundary(height + this.scalePoint.moveY,25,areaHeight-top)
+          }
+          //中上:拖拽会改变top,height
+          else if(direction==="TOP"){
+            scaleInfo.height = getBoundary(height - this.scalePoint.moveY,25,areaHeight)
+            scaleInfo.top = Math.max(top + this.scalePoint.moveY,0)
+          }
+          //中下:拖拽会改变height
+          else if(direction==="BOTTOM"){
+            scaleInfo.height = getBoundary(height + this.scalePoint.moveY,25,areaHeight)
+          }
+          this.changeStyle({},scaleInfo)
+          this.scalePoint.startX = e.clientX
+          this.scalePoint.startY = e.clientY
+        },
+        changeStyle(moveInfo,scaleInfo){
+          //const {moveX,moveY} = this.movePoint
+          if(this.eventType==='resize'){
+            const {left,top,width,height} = scaleInfo
+            this.elementInfo.left = left
+            this.elementInfo.top = top
+            this.elementInfo.width = width
+            this.elementInfo.height = height
+          }else if(this.eventType==='move'){
+            const {left,top} = moveInfo
+            this.elementInfo.left = left
+            this.elementInfo.top = top
+          }
+          //更新realWidth,realHeight
+          this.elementInfo.realWidth = this.elementInfo.width
+          this.elementInfo.realHeight = this.elementInfo.height
+          //更新percentage单位
+          const width = $('.editor-area').width(),height = width*0.7
+          const percentageShape = caclShapePercentage({layerWidth:width,layerHeight:height},this.elementInfo)
+          this.elementInfo.percentageLeft = percentageShape.percentageLeft
+          this.elementInfo.percentageTop = percentageShape.percentageTop
+          this.elementInfo.percentageWidth = percentageShape.percentageWidth
+          this.elementInfo.percentageHeight = percentageShape.percentageHeight
+        },
+        //显示右键菜单
+        showContentMenu(e){
+          e.preventDefault();
+          if(!this.isCoverEdit) {
+              this.$emit('chooseThis')
+          }
+          $(`#menu-${this.elementInfo.id}`).css({ "left": document.body.scrollLeft + e.clientX, "top": 
+           document.body.scrollTop + e.clientY}).show();
+           this.isContextMenusShow = true
+        },
+        //隐藏右键菜单
+        hideContextMenu(){
+          $(`#menu-${this.elementInfo.id}`).hide();
+          this.isContextMenuShow = false
+        },
+        //删除当前元素
+        handleDeleteLayer(){
+          this.$emit('deleteEl',this.elementInfo)
+          this.hideContextMenu()
+        },
+        //复制当前元素
+        handleCopyShape(){
+            this.$emit('copyEl',this.elementInfo)
+            this.hideContextMenu()
+        }
+      }
+}

+ 36 - 22
src/views/ppt_manage/newVersion/pptEditor.vue

@@ -2,7 +2,7 @@
   <div class="page-wrap">
   <div class="page-wrap">
     <div class="index-wrap ppt-page-wrap flex-column">
     <div class="index-wrap ppt-page-wrap flex-column">
         <div class="cover-wrap" @click="openChooseCover">
         <div class="cover-wrap" @click="openChooseCover">
-            <div class="cover" :style="'background: no-repeat center/cover url('+firstPage.BackgroundImg+');background-color:#F2F6FA;background-size:100% 100%;'">
+            <div class="cover" :style="`background: no-repeat center/cover url(${firstPage.BackgroundImg||''});background-color:#F2F6FA;background-size:100% 100%;`">
                 <img src="~@/assets/img/ppt_m/add_first.png" />
                 <img src="~@/assets/img/ppt_m/add_first.png" />
             </div>
             </div>
             <p class="hint-text">选择封面页</p>
             <p class="hint-text">选择封面页</p>
@@ -114,8 +114,8 @@
                 <el-button type="text" @click="handleChangeEditModal"><i class="el-icon-sort" style="transform: rotate(90deg);margin-right:5px;"></i>{{isEditLayer?'ppt编辑':'图层编辑'}}</el-button>
                 <el-button type="text" @click="handleChangeEditModal"><i class="el-icon-sort" style="transform: rotate(90deg);margin-right:5px;"></i>{{isEditLayer?'ppt编辑':'图层编辑'}}</el-button>
             </div>
             </div>
             <div class="richtext-tool"></div>
             <div class="richtext-tool"></div>
-            <div class="addppt-right-box" v-if="!isEditLayer">
-
+            <!-- 防止el-tabs未渲染时触发scrollToActiveTab 报错,v-if改为v-show-->
+            <div class="addppt-right-box" v-show="!isEditLayer">
               <el-tabs v-model="tabsactive">
               <el-tabs v-model="tabsactive">
                 <el-tab-pane :label="tab" :name="tab" v-for="tab in panelTabs" :key="tab"></el-tab-pane>
                 <el-tab-pane :label="tab" :name="tab" v-for="tab in panelTabs" :key="tab"></el-tab-pane>
               </el-tabs>
               </el-tabs>
@@ -137,7 +137,7 @@
                 <div class="chart-list" v-infinite-scroll="loadReportHandle" :infinite-scroll-immediate="false" ref="chartListRef">
                 <div class="chart-list" v-infinite-scroll="loadReportHandle" :infinite-scroll-immediate="false" ref="chartListRef">
                     <template v-if="chartList.length">
                     <template v-if="chartList.length">
                     <div v-for="(item, index) in chartList" :key="index" @click="chooseChart(item,'chart')" class="chart-item" :style="item.Disabled && 'cursor: not-allowed;'">
                     <div v-for="(item, index) in chartList" :key="index" @click="chooseChart(item,'chart')" class="chart-item" :style="item.Disabled && 'cursor: not-allowed;'">
-                        <p class="chart_tit">{{ item.ChartName }}</p>
+                        <p class="chart_tit" style="word-break: break-all;">{{ item.ChartName }}</p>
                         <img :src="item.ChartImage" ref="insert_img" style="-webkit-user-drag:none;"/>
                         <img :src="item.ChartImage" ref="insert_img" style="-webkit-user-drag:none;"/>
                     </div>
                     </div>
                     </template>
                     </template>
@@ -153,7 +153,6 @@
                     <div v-for="(item,index) in sandTableList" :key="index" class="sandTable-item" >
                     <div v-for="(item,index) in sandTableList" :key="index" class="sandTable-item" >
                       <p class="chart_tit">{{item.Name}}</p>
                       <p class="chart_tit">{{item.Name}}</p>
                       <img :src="item.PicUrl" style="width:100%;-webkit-user-drag:none;"  @click="chooseChart(item,'sandImage')"/>
                       <img :src="item.PicUrl" style="width:100%;-webkit-user-drag:none;"  @click="chooseChart(item,'sandImage')"/>
-                      <!-- <p class="source-identification">来源:弘则研究</p> -->
                     </div>
                     </div>
                     <div v-loading = "sandTableLoading" class="loaded-text">{{loadedText}}</div>
                     <div v-loading = "sandTableLoading" class="loaded-text">{{loadedText}}</div>
                   </template>
                   </template>
@@ -182,7 +181,7 @@
               </div>
               </div>
             </div>
             </div>
             <!-- 图层编辑 -->
             <!-- 图层编辑 -->
-            <div class="layer-edit-box" v-else>
+            <div class="layer-edit-box" v-show="isEditLayer">
               	<el-collapse v-model="activeNames" class="tool-list">
               	<el-collapse v-model="activeNames" class="tool-list">
                   <el-collapse-item title="图层元素" name="el">
                   <el-collapse-item title="图层元素" name="el">
                     <div class="el-wrap">
                     <div class="el-wrap">
@@ -225,12 +224,21 @@
     </div>
     </div>
 
 
     <!-- 选择封面弹窗 -->
     <!-- 选择封面弹窗 -->
-    <choose-cover  v-if="isShowChooseCover"
+    <!-- <choose-cover  v-if="isShowChooseCover"
         :firstPage="firstPage"
         :firstPage="firstPage"
         :pptCoverList="pptCoverList"
         :pptCoverList="pptCoverList"
         :PptId="pptId"
         :PptId="pptId"
         @close="closeChooseCover"
         @close="closeChooseCover"
         @save="saveCover"
         @save="saveCover"
+    /> -->
+    <ChooseCoverNew 
+        :isShowChooseCover="isShowChooseCover"
+        :firstPage="firstPage"
+        :pptCoverList="pptCoverList"
+        :PptId="pptId"
+        :CoverContent="CoverContent"
+        @saveCover="saveCover2"
+        @close="isShowChooseCover=false"
     />
     />
     <!-- 批量删除弹窗 -->
     <!-- 批量删除弹窗 -->
     <delete-page-dialog 
     <delete-page-dialog 
@@ -294,16 +302,18 @@ import addMyClassifyDia from '@/views/dataEntry_manage/components/addMyClassifyD
 import InsertCharts from './components/editor/InsertCharts.vue';
 import InsertCharts from './components/editor/InsertCharts.vue';
 import ContextMenu from './components/ContextMenu.vue';
 import ContextMenu from './components/ContextMenu.vue';
 import InsertSemantics from './components/editor/InsertSemantics.vue';
 import InsertSemantics from './components/editor/InsertSemantics.vue';
+import ChooseCoverNew from './components/editor/ChooseCoverNew.vue';
 export default {
 export default {
   mixins:[pptmixin,//ppt页面共同逻辑
   mixins:[pptmixin,//ppt页面共同逻辑
           mixins,//图表加载逻辑
           mixins,//图表加载逻辑
           layerMixins,//图层操作逻辑
           layerMixins,//图层操作逻辑
           pptEditorMixins,//编辑页共同逻辑
           pptEditorMixins,//编辑页共同逻辑
           ],
           ],
-  components: { 
-        IndexItem, ChooseCover, AddFormat,ShapePreview,
-    LayerEditTool,DeletePageDialog,ChangeFormatDialog,InsertPageDialog,addMyClassifyDia,InsertCharts,ContextMenu,InsertSemantics
-  },
+  components: {
+    IndexItem, ChooseCover, AddFormat, ShapePreview,
+    LayerEditTool, DeletePageDialog, ChangeFormatDialog, InsertPageDialog, addMyClassifyDia, InsertCharts, ContextMenu, InsertSemantics,
+    ChooseCoverNew
+},
   data() {
   data() {
     return {
     return {
         pageList:[],//ppt数组
         pageList:[],//ppt数组
@@ -314,11 +324,11 @@ export default {
         chooseModalId:1,//上一次选择的版式Id
         chooseModalId:1,//上一次选择的版式Id
         firstPage:{
         firstPage:{
             Title:'',
             Title:'',
-            ReportType:'',
+            ReportType:'',//ETA1.4.9不用了
             BackgroundImg:'',
             BackgroundImg:'',
-            PptDate:(new Date().getFullYear())+'年'+(new Date().getMonth()+1)+'月',
-            BackIndex:0,
-            TemplateType:1
+            PptDate:(new Date().getFullYear())+'年'+(new Date().getMonth()+1)+'月',//ETA1.4.9不用了
+            BackIndex:0,//ETA基本配置上线后不用了
+            TemplateType:1,//ETA基本配置上线后不用了
         },//封面信息
         },//封面信息
         key_word:'',//搜索图表关键字
         key_word:'',//搜索图表关键字
         chartList:[],//图表数组
         chartList:[],//图表数组
@@ -450,6 +460,7 @@ export default {
           this.firstPage.BackIndex = FirstPage.TemplateType-1
           this.firstPage.BackIndex = FirstPage.TemplateType-1
           this.currentItem = this.pageList[0]
           this.currentItem = this.pageList[0]
           this.ReportId=ReportId
           this.ReportId=ReportId
+          this.CoverContent = this.result.CoverContent
           //开启自动保存
           //开启自动保存
           this.autoSave()
           this.autoSave()
         }else{
         }else{
@@ -997,7 +1008,8 @@ export default {
       pptInterface.addppt({
       pptInterface.addppt({
         FirstPage:FirstPage,
         FirstPage:FirstPage,
         Content:Content,
         Content:Content,
-        GroupId:this.catalogId
+        GroupId:this.catalogId,
+        CoverContent:this.CoverContent
       }).then(res=>{
       }).then(res=>{
         if(res.Ret===200){
         if(res.Ret===200){
           this.$message.success('新增成功')
           this.$message.success('新增成功')
@@ -1016,7 +1028,8 @@ export default {
       pptInterface.editppt({
       pptInterface.editppt({
         PptId:parseInt(ppt_id),
         PptId:parseInt(ppt_id),
         FirstPage:FirstPage,
         FirstPage:FirstPage,
-        Content:Content
+        Content:Content,
+        CoverContent:this.CoverContent
       }).then(res=>{
       }).then(res=>{
         if(res.Ret===200){
         if(res.Ret===200){
           if(type==='save'){
           if(type==='save'){
@@ -1054,7 +1067,8 @@ export default {
         pptInterface.saveLog({
         pptInterface.saveLog({
           PptId:parseInt(ppt_id),
           PptId:parseInt(ppt_id),
           FirstPage:FirstPage,
           FirstPage:FirstPage,
-          Content:Content
+          Content:Content,
+          CoverContent:this.CoverContent
         }).then((res)=>{})
         }).then((res)=>{})
       },10000)
       },10000)
     },
     },
@@ -1062,9 +1076,9 @@ export default {
     save_checkPPT(){
     save_checkPPT(){
       if(!this.firstPage.Title){
       if(!this.firstPage.Title){
         return {result:false,hintText:'请输入封面标题!'}
         return {result:false,hintText:'请输入封面标题!'}
-      }else if(!this.firstPage.ReportType){
+      }/* else if(!this.firstPage.ReportType){
         return {result:false,hintText:'请输入ppt类型!'}
         return {result:false,hintText:'请输入ppt类型!'}
-      }
+      } */
       if(this.pageList.length===0){
       if(this.pageList.length===0){
         return {result:false,hintText:'请至少添加一张PPT!'}
         return {result:false,hintText:'请至少添加一张PPT!'}
       }
       }
@@ -1075,9 +1089,9 @@ export default {
       //检验首页
       //检验首页
       if(!this.firstPage.Title){
       if(!this.firstPage.Title){
         return {result:false,hintText:'请输入封面标题!'}
         return {result:false,hintText:'请输入封面标题!'}
-      }else if(!this.firstPage.ReportType){
+      }/* else if(!this.firstPage.ReportType){
         return {result:false,hintText:'请输入ppt类型!'}
         return {result:false,hintText:'请输入ppt类型!'}
-      }
+      } */
       if(this.pageList.length===0){
       if(this.pageList.length===0){
         return {result:false,hintText:'请至少添加一张PPT!'}
         return {result:false,hintText:'请至少添加一张PPT!'}
       }
       }

+ 28 - 13
src/views/ppt_manage/newVersion/pptEnEditor.vue

@@ -2,7 +2,7 @@
   <div class="page-wrap">
   <div class="page-wrap">
     <div class="index-wrap ppt-page-wrap flex-column">
     <div class="index-wrap ppt-page-wrap flex-column">
         <div class="cover-wrap" @click="openChooseCover">
         <div class="cover-wrap" @click="openChooseCover">
-            <div class="cover" :style="'background: no-repeat center/cover url('+firstPage.BackgroundImg+');background-color:#F2F6FA;background-size:100% 100%;'">
+            <div class="cover" :style="`background: no-repeat center/cover url(${firstPage.BackgroundImg||''});background-color:#F2F6FA;background-size:100% 100%;`">
                 <img src="~@/assets/img/ppt_m/add_first.png" />
                 <img src="~@/assets/img/ppt_m/add_first.png" />
             </div>
             </div>
             <p class="hint-text">选择封面页</p>
             <p class="hint-text">选择封面页</p>
@@ -111,7 +111,7 @@
                 <el-button type="text" @click="handleChangeEditModal"><i class="el-icon-sort" style="transform: rotate(90deg);margin-right:5px;"></i>{{isEditLayer?'ppt编辑':'图层编辑'}}</el-button>
                 <el-button type="text" @click="handleChangeEditModal"><i class="el-icon-sort" style="transform: rotate(90deg);margin-right:5px;"></i>{{isEditLayer?'ppt编辑':'图层编辑'}}</el-button>
             </div>
             </div>
             <div class="richtext-tool"></div>
             <div class="richtext-tool"></div>
-            <div class="addppt-right-box" v-if="!isEditLayer">
+            <div class="addppt-right-box" v-show="!isEditLayer">
 
 
               <el-tabs v-model="tabsactive">
               <el-tabs v-model="tabsactive">
                 <el-tab-pane :label="tab" :name="tab" v-for="tab in panelTabs" :key="tab"></el-tab-pane>
                 <el-tab-pane :label="tab" :name="tab" v-for="tab in panelTabs" :key="tab"></el-tab-pane>
@@ -138,7 +138,7 @@
                           <span v-if="item.IsEnChart">En</span>
                           <span v-if="item.IsEnChart">En</span>
                           <i class="el-icon-edit" v-else style="font-size:15px"/>
                           <i class="el-icon-edit" v-else style="font-size:15px"/>
                         </div>
                         </div>
-                        <p class="chart_tit">{{ chart_source===1 ? (item.ChartNameEn||item.ChartName) : item.ChartName }}</p>
+                        <p class="chart_tit" style="word-break: break-all;">{{ chart_source===1 ? (item.ChartNameEn||item.ChartName) : item.ChartName }}</p>
                         <img :src="item.ChartImage" ref="insert_img" />
                         <img :src="item.ChartImage" ref="insert_img" />
                     </div>
                     </div>
                     </template>
                     </template>
@@ -186,7 +186,7 @@
               </div>
               </div>
             </div>
             </div>
             <!-- 图层编辑 -->
             <!-- 图层编辑 -->
-            <div class="layer-edit-box" v-else>
+            <div class="layer-edit-box" v-show="isEditLayer">
               	<el-collapse v-model="activeNames" class="tool-list">
               	<el-collapse v-model="activeNames" class="tool-list">
                   <el-collapse-item title="图层元素" name="el">
                   <el-collapse-item title="图层元素" name="el">
                     <div class="el-wrap">
                     <div class="el-wrap">
@@ -225,12 +225,21 @@
     </div>
     </div>
 
 
     <!-- 选择封面弹窗 -->
     <!-- 选择封面弹窗 -->
-    <choose-cover  v-if="isShowChooseCover"
+    <!-- <choose-cover  v-if="isShowChooseCover"
         :firstPage="firstPage"
         :firstPage="firstPage"
         :pptCoverList="pptCoverList"
         :pptCoverList="pptCoverList"
         :PptId="pptId"
         :PptId="pptId"
         @close="closeChooseCover"
         @close="closeChooseCover"
         @save="saveCover"
         @save="saveCover"
+    /> -->
+    <ChooseCoverNew 
+        :isShowChooseCover="isShowChooseCover"
+        :firstPage="firstPage"
+        :pptCoverList="pptCoverList"
+        :PptId="pptId"
+        :CoverContent="CoverContent"
+        @saveCover="saveCover2"
+        @close="isShowChooseCover=false"
     />
     />
     <!-- 批量删除弹窗 -->
     <!-- 批量删除弹窗 -->
     <delete-page-dialog 
     <delete-page-dialog 
@@ -306,6 +315,7 @@ import InsertCharts from './components/editor/InsertCharts.vue';
 import setEnNameDia from '@/views/dataEntry_manage/components/setEnNameDia.vue';
 import setEnNameDia from '@/views/dataEntry_manage/components/setEnNameDia.vue';
 import ContextMenu from './components/ContextMenu.vue';
 import ContextMenu from './components/ContextMenu.vue';
 import InsertSemantics from './components/editor/InsertSemantics.vue';
 import InsertSemantics from './components/editor/InsertSemantics.vue';
+import ChooseCoverNew from './components/editor/ChooseCoverNew.vue';
 export default {
 export default {
   mixins:[pptmixin,//ppt页面共同逻辑
   mixins:[pptmixin,//ppt页面共同逻辑
           mixins,//图表加载逻辑
           mixins,//图表加载逻辑
@@ -325,7 +335,8 @@ export default {
     addMyClassifyDia,
     addMyClassifyDia,
     InsertCharts,
     InsertCharts,
     ContextMenu,
     ContextMenu,
-    InsertSemantics
+    InsertSemantics,
+    ChooseCoverNew
   },
   },
   data() {
   data() {
     return {
     return {
@@ -471,6 +482,7 @@ export default {
           this.firstPage.BackIndex = FirstPage.TemplateType-1
           this.firstPage.BackIndex = FirstPage.TemplateType-1
           this.currentItem = this.pageList[0]
           this.currentItem = this.pageList[0]
           this.ReportId=ReportId
           this.ReportId=ReportId
+          this.CoverContent = this.result.CoverContent
           //开启自动保存
           //开启自动保存
           this.autoSave()
           this.autoSave()
         }else{
         }else{
@@ -984,7 +996,8 @@ export default {
       pptEnInterface.addppt({
       pptEnInterface.addppt({
         FirstPage:FirstPage,
         FirstPage:FirstPage,
         Content:Content,
         Content:Content,
-        GroupId:this.catalogId
+        GroupId:this.catalogId,
+        CoverContent:this.CoverContent
       }).then(res=>{
       }).then(res=>{
         if(res.Ret===200){
         if(res.Ret===200){
           this.$message.success('新增成功')
           this.$message.success('新增成功')
@@ -1001,7 +1014,8 @@ export default {
       pptEnInterface.editppt({
       pptEnInterface.editppt({
         PptId:parseInt(ppt_id),
         PptId:parseInt(ppt_id),
         FirstPage:FirstPage,
         FirstPage:FirstPage,
-        Content:Content
+        Content:Content,
+        CoverContent:this.CoverContent
       }).then(res=>{
       }).then(res=>{
         if(res.Ret===200){
         if(res.Ret===200){
           if(type==='save'){
           if(type==='save'){
@@ -1032,7 +1046,8 @@ export default {
         pptEnInterface.saveLog({
         pptEnInterface.saveLog({
           PptId:parseInt(ppt_id),
           PptId:parseInt(ppt_id),
           FirstPage:FirstPage,
           FirstPage:FirstPage,
-          Content:Content
+          Content:Content,
+          CoverContent:this.CoverContent
         }).then((res)=>{})
         }).then((res)=>{})
       },10000)
       },10000)
     },
     },
@@ -1040,9 +1055,9 @@ export default {
     save_checkPPT(){
     save_checkPPT(){
       if(!this.firstPage.Title){
       if(!this.firstPage.Title){
         return {result:false,hintText:'请输入封面标题!'}
         return {result:false,hintText:'请输入封面标题!'}
-      }else if(!this.firstPage.ReportType){
+      }/* else if(!this.firstPage.ReportType){
         return {result:false,hintText:'请输入ppt类型!'}
         return {result:false,hintText:'请输入ppt类型!'}
-      }
+      } */
       if(this.pageList.length===0){
       if(this.pageList.length===0){
         return {result:false,hintText:'请至少添加一张PPT!'}
         return {result:false,hintText:'请至少添加一张PPT!'}
       }
       }
@@ -1053,9 +1068,9 @@ export default {
       //检验首页
       //检验首页
       if(!this.firstPage.Title){
       if(!this.firstPage.Title){
         return {result:false,hintText:'请输入封面标题!'}
         return {result:false,hintText:'请输入封面标题!'}
-      }else if(!this.firstPage.ReportType){
+      }/* else if(!this.firstPage.ReportType){
         return {result:false,hintText:'请输入ppt类型!'}
         return {result:false,hintText:'请输入ppt类型!'}
-      }
+      } */
       if(this.pageList.length===0){
       if(this.pageList.length===0){
         return {result:false,hintText:'请至少添加一张PPT!'}
         return {result:false,hintText:'请至少添加一张PPT!'}
       }
       }

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

@@ -40,7 +40,8 @@
           <div class="ppt-wrap" @wheel.stop="normalMouseWheel">
           <div class="ppt-wrap" @wheel.stop="normalMouseWheel">
             <!-- 封面 -->
             <!-- 封面 -->
             <div class="ppt-item" id="cover" v-if="currentIndex===0" style="background-size:20%;">
             <div class="ppt-item" id="cover" v-if="currentIndex===0" style="background-size:20%;">
-              <Cover :pageInfo="coverInfo.page" v-show="coverInfo.page"></Cover>
+              <!-- <Cover :pageInfo="coverInfo.page" v-show="coverInfo.page"></Cover> -->
+              <CustomCover :pageInfo="coverInfo.page" :CoverContent="pptCoverContent" v-show="coverInfo.page"></CustomCover>
             </div>
             </div>
             <!-- 封底 -->
             <!-- 封底 -->
             <div class="ppt-item" id="back" v-else-if="currentIndex===pageList.length+1" style="background-size:20%;">
             <div class="ppt-item" id="back" v-else-if="currentIndex===pageList.length+1" style="background-size:20%;">
@@ -98,7 +99,8 @@
           <div class="ppt-wrap">
           <div class="ppt-wrap">
             <!-- 封面 -->
             <!-- 封面 -->
             <div class="ppt-item" id="cover" v-if="currentIndex===0" style="background-size:20%;">
             <div class="ppt-item" id="cover" v-if="currentIndex===0" style="background-size:20%;">
-              <Cover :pageInfo="coverInfo.page" v-show="coverInfo.page"></Cover>
+              <!-- <Cover :pageInfo="coverInfo.page" v-show="coverInfo.page"></Cover> -->
+              <CustomCover :pageInfo="coverInfo.page" :CoverContent="pptCoverContent" v-show="coverInfo.page"></CustomCover>
             </div>
             </div>
             <!-- 封底 -->
             <!-- 封底 -->
             <div class="ppt-item" id="back" v-else-if="currentIndex===pageList.length+1" style="background-size:20%;">
             <div class="ppt-item" id="back" v-else-if="currentIndex===pageList.length+1" style="background-size:20%;">
@@ -166,6 +168,7 @@
 
 
 <script>
 <script>
 import Cover from './components/CoverEn.vue';
 import Cover from './components/CoverEn.vue';
+import CustomCover from './components/CustomCover.vue';
 import IndexItem from './components/IndexItem.vue';
 import IndexItem from './components/IndexItem.vue';
 import {countComponentName,setFullscreen,isFullscreen,exitFullscreen,calcScale,countStrSize} from './utils/untils';
 import {countComponentName,setFullscreen,isFullscreen,exitFullscreen,calcScale,countStrSize} from './utils/untils';
 import {pptCoverEn} from './utils/config'
 import {pptCoverEn} from './utils/config'
@@ -181,7 +184,7 @@ const reloadPPTWid = ()=>{
   window.dispatchEvent(resizeEvent)
   window.dispatchEvent(resizeEvent)
 }
 }
 export default {
 export default {
-  components: { IndexItem, Cover ,ContextMenu, DrawingBoardTool},
+  components: { IndexItem, Cover ,ContextMenu, DrawingBoardTool,CustomCover},
   mixins:[pptmixin,mixins],
   mixins:[pptmixin,mixins],
   data() {
   data() {
     return {
     return {

+ 9 - 11
src/views/ppt_manage/newVersion/pptEnPublish.vue

@@ -20,7 +20,8 @@
         <div class="ppt-wrap flex-center">
         <div class="ppt-wrap flex-center">
           <!-- 封面 -->
           <!-- 封面 -->
           <div class="ppt-item" id="cover" style="background-size:20%;">
           <div class="ppt-item" id="cover" style="background-size:20%;">
-            <Cover :pageInfo="coverInfo.page"></Cover>
+            <!-- <Cover :pageInfo="coverInfo.page"></Cover> -->
+            <CustomCover :pageInfo="coverInfo.page" :CoverContent="pptCoverContent" v-show="coverInfo.page"></CustomCover>
           </div>
           </div>
           <!-- 内容 -->
           <!-- 内容 -->
           <div class="ppt-item" v-for="(item,index) in pageList" :key="item.id">
           <div class="ppt-item" v-for="(item,index) in pageList" :key="item.id">
@@ -47,8 +48,9 @@
 
 
 <script>
 <script>
 import Cover from './components/CoverEn.vue';
 import Cover from './components/CoverEn.vue';
+import CustomCover from './components/CustomCover.vue';
 import TransReport from './components/catalog/transReport.vue';
 import TransReport from './components/catalog/transReport.vue';
-import {countComponentName,pptInit,pptConfigInit,toTextProps,toJson,svg2Base64,getImgRealSize,calcScale,getShapeOptions,createRandomCode,getTableData} from './utils/untils';
+import {countComponentName,pptConfigInit,toTextProps,toJson,svg2Base64,getImgRealSize,calcScale,getShapeOptions,createRandomCode,getTableData} from './utils/untils';
 import {marginTop,modelConfig,pptSlideMaster,pptSlideMasterEn,pptCoverEn} from './utils/config';
 import {marginTop,modelConfig,pptSlideMaster,pptSlideMasterEn,pptCoverEn} from './utils/config';
 import pptmixin from '../mixins/pptMixins';
 import pptmixin from '../mixins/pptMixins';
 import mixins from '../mixins/mixins';
 import mixins from '../mixins/mixins';
@@ -65,7 +67,7 @@ import {uploadFileDirect} from "@/utils/common.js"
 HightchartsExport(Highcharts)
 HightchartsExport(Highcharts)
 HighchartszhCN(Highcharts)
 HighchartszhCN(Highcharts)
 export default {
 export default {
-  components: {Cover,TransReport},
+  components: {Cover,TransReport,CustomCover},
   mixins:[pptmixin,mixins],
   mixins:[pptmixin,mixins],
   data() {
   data() {
     return {
     return {
@@ -214,7 +216,6 @@ export default {
     async pageToPptx(){
     async pageToPptx(){
       //开始计时
       //开始计时
       const start = Date.now()
       const start = Date.now()
-      //let pptx = pptInit(new pptxgen(),this.LayoutType,'en');
       const SlideMaster = _.cloneDeep(pptSlideMasterEn) 
       const SlideMaster = _.cloneDeep(pptSlideMasterEn) 
       SlideMaster.objects[1] = {image: {x:0,y:0,w:10,h:7,path:this.pptBgImage}}
       SlideMaster.objects[1] = {image: {x:0,y:0,w:10,h:7,path:this.pptBgImage}}
       let pptx = pptConfigInit(new pptxgen(),this.LayoutType,'en',SlideMaster,this.pptBgImage)
       let pptx = pptConfigInit(new pptxgen(),this.LayoutType,'en',SlideMaster,this.pptBgImage)
@@ -223,8 +224,6 @@ export default {
       const length = this.pageList.length;
       const length = this.pageList.length;
       for (let i = 0; i < length; i++) {
       for (let i = 0; i < length; i++) {
         let slide = pptx.addSlide({ masterName: pptSlideMaster.title });
         let slide = pptx.addSlide({ masterName: pptSlideMaster.title });
-        //添加背景图片
-        //slide.background = { path: "/static/pptnextimg.png" };
         slide.addText(this.pageList[i].title, {
         slide.addText(this.pageList[i].title, {
           placeholder:"slideTitle",
           placeholder:"slideTitle",
           x:'8%',
           x:'8%',
@@ -306,7 +305,6 @@ export default {
               valign:'top'
               valign:'top'
             })
             })
           }else if(imgData2){
           }else if(imgData2){
-            //console.log('src',imgData2)
             const realSize = getImgRealSize(imgData2Obj)
             const realSize = getImgRealSize(imgData2Obj)
             const percentWidth = Number(width.substring(0,width.length-1))
             const percentWidth = Number(width.substring(0,width.length-1))
             const percentHeight = Number(height.substring(0,height.length-1))
             const percentHeight = Number(height.substring(0,height.length-1))
@@ -339,7 +337,6 @@ export default {
           if(['shape','line'].includes(layers[j].type)){
           if(['shape','line'].includes(layers[j].type)){
             const scale = calcScale({w:906,h:906*0.7},{w:$('.ppt-item').width(),h:$('.ppt-item').width()*this.coefficient})
             const scale = calcScale({w:906,h:906*0.7},{w:$('.ppt-item').width(),h:$('.ppt-item').width()*this.coefficient})
             let options = getShapeOptions(layers[j],position,scale)
             let options = getShapeOptions(layers[j],position,scale)
-            //console.log('options',options)
             if(layers[j].shapeType==='Circle'){ //circle的points太复杂,直接用插件预设的
             if(layers[j].shapeType==='Circle'){ //circle的points太复杂,直接用插件预设的
                 slide.addShape('ellipse', options);
                 slide.addShape('ellipse', options);
             }else{
             }else{
@@ -377,7 +374,6 @@ export default {
       }
       }
       //为了把封面放到第一页,操作pptx.slides达不成想要的效果,于是弄了个pptx2
       //为了把封面放到第一页,操作pptx.slides达不成想要的效果,于是弄了个pptx2
       //将封面放在最后生成是因为htmlToCanvans占用太多内存会导致页面假死
       //将封面放在最后生成是因为htmlToCanvans占用太多内存会导致页面假死
-      //let pptx2 = pptInit(new pptxgen(),this.LayoutType,'en');
       let pptx2 = pptConfigInit(new pptxgen(),this.LayoutType,'en',SlideMaster,this.pptBgImage)
       let pptx2 = pptConfigInit(new pptxgen(),this.LayoutType,'en',SlideMaster,this.pptBgImage)
       //添加封面
       //添加封面
       let cover = pptx2.addSlide()
       let cover = pptx2.addSlide()
@@ -393,7 +389,7 @@ export default {
         size: { type: "contain" },
         size: { type: "contain" },
       })
       })
       //生成的ppt需要可以在封面页更改标题和类型,所以封面信息手动写入
       //生成的ppt需要可以在封面页更改标题和类型,所以封面信息手动写入
-      const coverInfo = [
+      /* const coverInfo = [
         //{text:'—————————————————————————————————\n',options:{fontSize:16*0.75,breakLine:true}},
         //{text:'—————————————————————————————————\n',options:{fontSize:16*0.75,breakLine:true}},
         {text:this.coverInfo.page.Title,options:{fontSize:28*0.75,breakLine:true}},
         {text:this.coverInfo.page.Title,options:{fontSize:28*0.75,breakLine:true}},
         {text:`\n${this.pptCoverCompenyName||'ETA'}`,
         {text:`\n${this.pptCoverCompenyName||'ETA'}`,
@@ -411,7 +407,9 @@ export default {
         color:(this.pptCoverTextColor||'#ffffff').slice(1),
         color:(this.pptCoverTextColor||'#ffffff').slice(1),
         align:'center',
         align:'center',
         fontFace:'SimHei'
         fontFace:'SimHei'
-      })
+      }) */
+      //自定义封面页的内容
+      cover = this.setPPTCover(cover,this.pptCoverContent,this.coverInfo.page.Title)
       //遍历pptx.slides,重新给每一项的部分属性赋值,再推入pptx2.slides中
       //遍历pptx.slides,重新给每一项的部分属性赋值,再推入pptx2.slides中
       //第一页不需要,因为是空白的
       //第一页不需要,因为是空白的
       for(let i=1;i<pptx.slides.length;i++){
       for(let i=1;i<pptx.slides.length;i++){

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

@@ -40,7 +40,8 @@
           <div class="ppt-wrap" @wheel.stop="normalMouseWheel">
           <div class="ppt-wrap" @wheel.stop="normalMouseWheel">
             <!-- 封面 -->
             <!-- 封面 -->
             <div class="ppt-item" id="cover" v-if="currentIndex===0" style="background-size:20%;">
             <div class="ppt-item" id="cover" v-if="currentIndex===0" style="background-size:20%;">
-              <Cover :pageInfo="coverInfo.page" v-show="coverInfo.page"></Cover>
+              <!-- <Cover :pageInfo="coverInfo.page" v-show="coverInfo.page"></Cover> -->
+              <CustomCover :pageInfo="coverInfo.page" :CoverContent="pptCoverContent" v-show="coverInfo.page"></CustomCover>
             </div>
             </div>
             <!-- 封底 -->
             <!-- 封底 -->
             <div class="ppt-item" id="back" v-else-if="currentIndex===pageList.length+1" style="background-size:20%;">
             <div class="ppt-item" id="back" v-else-if="currentIndex===pageList.length+1" style="background-size:20%;">
@@ -98,7 +99,8 @@
           <div class="ppt-wrap">
           <div class="ppt-wrap">
             <!-- 封面 -->
             <!-- 封面 -->
             <div class="ppt-item" id="cover" v-if="currentIndex===0" style="background-size:20%;">
             <div class="ppt-item" id="cover" v-if="currentIndex===0" style="background-size:20%;">
-              <Cover :pageInfo="coverInfo.page" v-show="coverInfo.page"></Cover>
+              <!-- <Cover :pageInfo="coverInfo.page" v-show="coverInfo.page"></Cover> -->
+              <CustomCover :pageInfo="coverInfo.page" :CoverContent="pptCoverContent" v-show="coverInfo.page"></CustomCover>
             </div>
             </div>
             <!-- 封底 -->
             <!-- 封底 -->
             <div class="ppt-item" id="back" v-else-if="currentIndex===pageList.length+1" style="background-size:20%;">
             <div class="ppt-item" id="back" v-else-if="currentIndex===pageList.length+1" style="background-size:20%;">
@@ -166,6 +168,7 @@
 
 
 <script>
 <script>
 import Cover from './components/Cover.vue';
 import Cover from './components/Cover.vue';
+import CustomCover from './components/CustomCover.vue';
 import IndexItem from './components/IndexItem.vue';
 import IndexItem from './components/IndexItem.vue';
 import {countComponentName,setFullscreen,isFullscreen,exitFullscreen,calcScale,countStrSize} from './utils/untils';
 import {countComponentName,setFullscreen,isFullscreen,exitFullscreen,calcScale,countStrSize} from './utils/untils';
 import pptmixin from '../mixins/pptMixins';
 import pptmixin from '../mixins/pptMixins';
@@ -180,7 +183,7 @@ const reloadPPTWid = ()=>{
   window.dispatchEvent(resizeEvent)
   window.dispatchEvent(resizeEvent)
 }
 }
 export default {
 export default {
-  components: { IndexItem, Cover ,ContextMenu, DrawingBoardTool},
+  components: { IndexItem, Cover ,ContextMenu, DrawingBoardTool, CustomCover},
   mixins:[pptmixin,mixins],
   mixins:[pptmixin,mixins],
   data() {
   data() {
     return {
     return {

+ 13 - 82
src/views/ppt_manage/newVersion/pptPublish.vue

@@ -21,7 +21,8 @@
         <div class="ppt-wrap flex-center">
         <div class="ppt-wrap flex-center">
           <!-- 封面 -->
           <!-- 封面 -->
           <div class="ppt-item" id="cover" style="background-size:20%;">
           <div class="ppt-item" id="cover" style="background-size:20%;">
-            <Cover :pageInfo="coverInfo.page"></Cover>
+            <!-- <Cover :pageInfo="coverInfo.page"></Cover> -->
+            <CustomCover :pageInfo="coverInfo.page" :CoverContent="pptCoverContent" v-show="coverInfo.page"></CustomCover>
           </div>
           </div>
           <!-- 内容 -->
           <!-- 内容 -->
           <div class="ppt-item" v-for="(item,index) in pageList" :key="item.id">
           <div class="ppt-item" v-for="(item,index) in pageList" :key="item.id">
@@ -43,57 +44,6 @@
           </div>
           </div>
         </div>
         </div>
       </template>
       </template>
-      <!-- 虚拟列表 -->
-      <template v-else>
-        <div class="list-wrap" id="scroller" @scroll="handleScroll">
-          <div class="ppt-wrap flex-center" id="scroller-inner">
-            <!-- <div class="ppt-item" v-for="(item,index) in loadList" :key="item.id" :data-set="item.title">
-              <span style="font-size:24px;">第{{index}}项,title{{item.title}}</span>
-            </div> -->
-            <template v-for="(item) in loadList">
-              <template v-if="item.index">
-                <!-- 是封面 -->
-                <div class="ppt-item" id="cover" v-if="coverInfo.page" :key="item.id" :data-set="item.title">
-                  <Cover :pageInfo="coverInfo.page"></Cover>
-                </div>
-              </template>
-              <template v-else-if="item.idName==='back'">
-                <!-- 是封底 -->
-                <div class="ppt-item" id="back" :key="item.id" :data-set="item.title">
-                  <img src="~@/assets/img/pptlastimg.png" class="pptbg" />
-                </div>
-              </template>
-              <template v-else>
-                <!-- 是内容 -->
-                <div class="ppt-item" :key="item.id" :data-set="item.title">
-                  <div class="title-wrap">
-                    {{item.title}} 
-                  </div>
-                  <component
-                    :is="getComponentName(item.modelId)"
-                    :ref="`pptPage_${item.sourceIndex}`"
-                    :pageIndex="item.sourceIndex"
-                    :pageItem="item" 
-                    type="show"
-                    >
-                  </component>
-                </div>
-              </template>
-          </template>
-          </div>
-        </div>
-      </template>
-      <!-- 封面封底 -->
-      <template v-if="isPublish&&!loadingAll">
-        <div class="fixed-wrap">
-          <div class="ppt-item" id="changecover">
-              <Cover :pageInfo="coverInfo.page"></Cover>
-          </div>
-          <div class="ppt-item" id="changeback" style="overflow:hidden;">
-              <img src="~@/assets/img/pptlastimg.png" class="pptbg" style="width:100%;"/>
-            </div>
-          </div>
-      </template>
       <!-- <trans-report
       <!-- <trans-report
         v-if="coverInfo.page"
         v-if="coverInfo.page"
         :transReportShow="transReportShow"
         :transReportShow="transReportShow"
@@ -106,9 +56,10 @@
 
 
 <script>
 <script>
 import Cover from './components/Cover.vue';
 import Cover from './components/Cover.vue';
+import CustomCover from './components/CustomCover.vue';
 import TransReport from './components/catalog/transReport.vue';
 import TransReport from './components/catalog/transReport.vue';
 //import {pageList} from './utils/mock';
 //import {pageList} from './utils/mock';
-import {countComponentName,pptInit,pptConfigInit,toTextProps,toJson,svg2Base64,getImgRealSize,calcScale,getShapeOptions,createRandomCode,getTableData} from './utils/untils';
+import {countComponentName,pptConfigInit,toTextProps,toJson,svg2Base64,getImgRealSize,calcScale,getShapeOptions,createRandomCode,getTableData} from './utils/untils';
 import {marginTop,modelConfig,pptSlideMaster} from './utils/config';
 import {marginTop,modelConfig,pptSlideMaster} from './utils/config';
 import pptmixin from '../mixins/pptMixins';
 import pptmixin from '../mixins/pptMixins';
 import mixins from '../mixins/mixins';
 import mixins from '../mixins/mixins';
@@ -125,7 +76,7 @@ import {uploadFileDirect} from "@/utils/common.js"
 HightchartsExport(Highcharts)
 HightchartsExport(Highcharts)
 HighchartszhCN(Highcharts)
 HighchartszhCN(Highcharts)
 export default {
 export default {
-  components: {Cover,TransReport},
+  components: {Cover,TransReport,CustomCover},
   mixins:[pptmixin,mixins,virtualScroll],
   mixins:[pptmixin,mixins,virtualScroll],
   data() {
   data() {
     return {
     return {
@@ -184,12 +135,8 @@ export default {
       });
       });
       this.isPublish = true
       this.isPublish = true
       if(this.loadingAll){
       if(this.loadingAll){
-        await this.pageToPptx()       
-      }else{
-        //将滚动条置顶
-        this.scroller.scrollTop = 0
-        await this.pageToPptx()
-      }  
+        await this.pageToPptx() 
+      }
       this.isPublish = false
       this.isPublish = false
     },
     },
     //计算ppt的版式名称
     //计算ppt的版式名称
@@ -281,7 +228,6 @@ export default {
     async pageToPptx(){
     async pageToPptx(){
       //开始计时
       //开始计时
       const start = Date.now()
       const start = Date.now()
-      //let pptx = pptInit(new pptxgen(),this.LayoutType);
       const SlideMaster = _.cloneDeep(pptSlideMaster) 
       const SlideMaster = _.cloneDeep(pptSlideMaster) 
       SlideMaster.objects[1] = {image: {x:0,y:0,w:10,h:7,path:this.pptBgImage}}
       SlideMaster.objects[1] = {image: {x:0,y:0,w:10,h:7,path:this.pptBgImage}}
       let pptx = pptConfigInit(new pptxgen(),this.LayoutType,'ch',SlideMaster,this.pptBgImage)
       let pptx = pptConfigInit(new pptxgen(),this.LayoutType,'ch',SlideMaster,this.pptBgImage)
@@ -289,17 +235,7 @@ export default {
       pptx.addSlide()
       pptx.addSlide()
       const length = this.pageList.length;
       const length = this.pageList.length;
       for (let i = 0; i < length; i++) {
       for (let i = 0; i < length; i++) {
-        //console.log(`正在生成,第${i+1}页...`,`lastVisibleItemIndex:`,this.lastVisibleItemIndex)
-        if(!this.loadingAll){
-          if(this.lastVisibleItemIndex<=i+this.buffer+1){
-            //将滚动条触底,加载下一页
-            const {scrollHeight} = this.scroller
-            this.scroller.scrollTop = scrollHeight
-          }
-        }
         let slide = pptx.addSlide({ masterName: pptSlideMaster.title });
         let slide = pptx.addSlide({ masterName: pptSlideMaster.title });
-        //添加背景图片
-        //slide.background = { path: "/static/pptnextimg.png" };
         slide.addText(this.pageList[i].title, {
         slide.addText(this.pageList[i].title, {
           placeholder:"slideTitle",
           placeholder:"slideTitle",
           x:'10%',
           x:'10%',
@@ -381,7 +317,6 @@ export default {
               valign:'top'
               valign:'top'
             })
             })
           }else if(imgData2){
           }else if(imgData2){
-            //console.log('src',imgData2)
             const realSize = getImgRealSize(imgData2Obj)
             const realSize = getImgRealSize(imgData2Obj)
             const percentWidth = Number(width.substring(0,width.length-1))
             const percentWidth = Number(width.substring(0,width.length-1))
             const percentHeight = Number(height.substring(0,height.length-1))
             const percentHeight = Number(height.substring(0,height.length-1))
@@ -418,7 +353,6 @@ export default {
           if(['shape','line'].includes(layers[j].type)){
           if(['shape','line'].includes(layers[j].type)){
             const scale = calcScale({w:906,h:906*0.7},{w:$('.ppt-item').width(),h:$('.ppt-item').width()*this.coefficient})
             const scale = calcScale({w:906,h:906*0.7},{w:$('.ppt-item').width(),h:$('.ppt-item').width()*this.coefficient})
             let options = getShapeOptions(layers[j],position,scale)
             let options = getShapeOptions(layers[j],position,scale)
-            //console.log('options',options)
             if(layers[j].shapeType==='Circle'){ //circle的points太复杂,直接用插件预设的
             if(layers[j].shapeType==='Circle'){ //circle的points太复杂,直接用插件预设的
                 slide.addShape('ellipse', options);
                 slide.addShape('ellipse', options);
             }else{
             }else{
@@ -458,7 +392,6 @@ export default {
       
       
       //为了把封面放到第一页,操作pptx.slides达不成想要的效果,于是弄了个pptx2
       //为了把封面放到第一页,操作pptx.slides达不成想要的效果,于是弄了个pptx2
       //将封面放在最后生成是因为htmlToCanvans占用太多内存会导致页面假死
       //将封面放在最后生成是因为htmlToCanvans占用太多内存会导致页面假死
-      //let pptx2 = pptInit(new pptxgen(),this.LayoutType);
       let pptx2 = pptConfigInit(new pptxgen(),this.LayoutType,'ch',SlideMaster,this.pptBgImage)
       let pptx2 = pptConfigInit(new pptxgen(),this.LayoutType,'ch',SlideMaster,this.pptBgImage)
       //添加封面
       //添加封面
       let cover = pptx2.addSlide()
       let cover = pptx2.addSlide()
@@ -473,14 +406,14 @@ export default {
         size: { type: "contain" },
         size: { type: "contain" },
       })
       })
       //生成的ppt需要可以在封面页更改标题和类型,所以封面信息手动写入
       //生成的ppt需要可以在封面页更改标题和类型,所以封面信息手动写入
-      const coverInfo = [
-        //{text:'—————————————————————————————————\n',options:{fontSize:16*0.75,breakLine:true}},
+      /* const coverInfo = [
+        {text:'—————————————————————————————————\n',options:{fontSize:16*0.75,breakLine:true}},
         {text:this.coverInfo.page.Title,options:{fontSize:28*0.75,breakLine:true}},
         {text:this.coverInfo.page.Title,options:{fontSize:28*0.75,breakLine:true}},
         {text:`\n— ${this.pptCoverCompenyName||'ETA'} ● ${this.coverInfo.page.ReportType} —`,
         {text:`\n— ${this.pptCoverCompenyName||'ETA'} ● ${this.coverInfo.page.ReportType} —`,
          options:{fontSize:16*0.75,breakLine:false}},
          options:{fontSize:16*0.75,breakLine:false}},
         {text:`\n${this.pptCoverDepartName||'投研部'}`,options:{fontSize:16*0.75,breakLine:true}},
         {text:`\n${this.pptCoverDepartName||'投研部'}`,options:{fontSize:16*0.75,breakLine:true}},
         {text:this.coverInfo.page.PptDate,options:{fontSize:16*0.75,breakLine:true}},
         {text:this.coverInfo.page.PptDate,options:{fontSize:16*0.75,breakLine:true}},
-        //{text:'\n—————————————————————————',options:{fontSize:16*0.75,breakLine:true}}
+        {text:'\n—————————————————————————',options:{fontSize:16*0.75,breakLine:true}}
       ]
       ]
       cover.addText(coverInfo,{
       cover.addText(coverInfo,{
         x:'38%',
         x:'38%',
@@ -490,7 +423,9 @@ export default {
         color:(this.pptCoverTextColor||'#ffffff').slice(1),
         color:(this.pptCoverTextColor||'#ffffff').slice(1),
         align:'center',
         align:'center',
         fontFace:'SimHei'
         fontFace:'SimHei'
-      })
+      }) */
+      //自定义封面页的内容
+      cover = this.setPPTCover(cover,this.pptCoverContent,this.coverInfo.page.Title)
       //遍历pptx.slides,重新给每一项的部分属性赋值,再推入pptx2.slides中
       //遍历pptx.slides,重新给每一项的部分属性赋值,再推入pptx2.slides中
       //第一页不需要,因为是空白的
       //第一页不需要,因为是空白的
       for(let i=1;i<pptx.slides.length;i++){
       for(let i=1;i<pptx.slides.length;i++){
@@ -746,10 +681,6 @@ export default {
   mounted(){
   mounted(){
     this.init()
     this.init()
     this._scrollTop = 0
     this._scrollTop = 0
-    if(!this.loadingAll){
-      this.scroller = document.getElementById('scroller')
-      this.scrollerInner = document.getElementById("scroller-inner")
-    }
   },
   },
   updated(){
   updated(){
     /*
     /*

+ 4 - 4
src/views/ppt_manage/newVersion/utils/untils.js

@@ -486,10 +486,10 @@ export const calcScale = (oldShap,newShap)=>{
 export const caclShapePercentage = (layer,el)=>{
 export const caclShapePercentage = (layer,el)=>{
   const {layerWidth,layerHeight} = layer
   const {layerWidth,layerHeight} = layer
   const {left,top,width,height} = el
   const {left,top,width,height} = el
-  const percentageLeft = left/layerWidth
-  const percentageTop = top/layerHeight
-  const percentageWidth = width/layerWidth
-  const percentageHeight = height/layerHeight
+  const percentageLeft = Number((left/layerWidth).toFixed(5))
+  const percentageTop = Number((top/layerHeight).toFixed(5))
+  const percentageWidth = Number((width/layerWidth).toFixed(5))
+  const percentageHeight = Number((height/layerHeight).toFixed(5))
   return {percentageLeft,percentageTop,percentageWidth,percentageHeight}
   return {percentageLeft,percentageTop,percentageWidth,percentageHeight}
 }
 }
 //计算图层元素的真实宽高
 //计算图层元素的真实宽高

+ 4 - 4
src/views/system_manage/etaBaseConfig.vue

@@ -201,7 +201,7 @@
                     <el-radio-button label="en">英文PPT</el-radio-button>
                     <el-radio-button label="en">英文PPT</el-radio-button>
                 </el-radio-group>
                 </el-radio-group>
                 <div v-if="isShowPPT" v-show="pptLang === 'cn'" class="ppt-form-item-wrap">
                 <div v-if="isShowPPT" v-show="pptLang === 'cn'" class="ppt-form-item-wrap">
-                    <div class="inner-input-wrap">
+                    <!-- <div class="inner-input-wrap">
                         <el-form-item label="公司名称" prop="PptCompanyName" class="inline-form-item">
                         <el-form-item label="公司名称" prop="PptCompanyName" class="inline-form-item">
                             <el-input type="text" v-model="formData.PptCompanyName"></el-input>
                             <el-input type="text" v-model="formData.PptCompanyName"></el-input>
                         </el-form-item>
                         </el-form-item>
@@ -211,7 +211,7 @@
                         <el-form-item label="字体颜色" prop="PptFontColor" class="inline-form-item">
                         <el-form-item label="字体颜色" prop="PptFontColor" class="inline-form-item">
                             <el-input type="color" style="width:64px;" v-model="formData.PptFontColor"></el-input>
                             <el-input type="color" style="width:64px;" v-model="formData.PptFontColor"></el-input>
                         </el-form-item>
                         </el-form-item>
-                    </div>
+                    </div> -->
                     
                     
                     <el-form-item label="PPT封面图" prop="CnPptCoverImgs" style="min-width:400px;">
                     <el-form-item label="PPT封面图" prop="CnPptCoverImgs" style="min-width:400px;">
                         <div class="input-line" style="display:flex;">
                         <div class="input-line" style="display:flex;">
@@ -251,7 +251,7 @@
                     </el-form-item>
                     </el-form-item>
                 </div>
                 </div>
                 <div v-if="isShowEnPPT" v-show="pptLang === 'en'" class="ppt-form-item-wrap">
                 <div v-if="isShowEnPPT" v-show="pptLang === 'en'" class="ppt-form-item-wrap">
-                    <div class="inner-input-wrap">
+                    <!-- <div class="inner-input-wrap">
                         <el-form-item label="公司名称" prop="PptCompanyNameEn" class="inline-form-item">
                         <el-form-item label="公司名称" prop="PptCompanyNameEn" class="inline-form-item">
                             <el-input type="text" v-model="formData.PptCompanyNameEn"></el-input>
                             <el-input type="text" v-model="formData.PptCompanyNameEn"></el-input>
                         </el-form-item>
                         </el-form-item>
@@ -261,7 +261,7 @@
                         <el-form-item label="字体颜色" prop="PptFontColorEn" class="inline-form-item">
                         <el-form-item label="字体颜色" prop="PptFontColorEn" class="inline-form-item">
                             <el-input type="color" style="width:64px;" v-model="formData.PptFontColorEn"></el-input>
                             <el-input type="color" style="width:64px;" v-model="formData.PptFontColorEn"></el-input>
                         </el-form-item>
                         </el-form-item>
-                    </div>
+                    </div> -->
                     <el-form-item label="PPT封面图" prop="EnPptCoverImgs" style="min-width:400px;">
                     <el-form-item label="PPT封面图" prop="EnPptCoverImgs" style="min-width:400px;">
                         <div class="input-line" style="display:flex;">
                         <div class="input-line" style="display:flex;">
                             <ImgUpload 
                             <ImgUpload