Kaynağa Gözat

Merge branch 'need_pool300'

shanbinzhang 3 ay önce
ebeveyn
işleme
2c12602f3c

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

@@ -26,6 +26,7 @@ import FormatTen from '../newVersion/components/formatPage/FormatTen.vue';
 import FormatEle from '../newVersion/components/formatPage/FormatEle.vue';
 import FormatTwelve from '../newVersion/components/formatPage/FormatTwelve.vue';
 import FormatThirteen from '../newVersion/components/formatPage/FormatThirteen.vue';
+import FormatFourteen from '../newVersion/components/formatPage/FormatFourteen.vue';
 const chunkArray = (array, chunkSize)=>{
     let result = [];
     for (let i = 0; i < array.length; i += chunkSize) {
@@ -35,7 +36,7 @@ const chunkArray = (array, chunkSize)=>{
 }
 export default {
   components:{ FormatOne,FormatTwo,FormatThree,
-    FormatFour,FormatFive,FormatSix,FormatSeven,FormatEight,FormatNine,FormatTen,FormatEle,FormatTwelve,FormatThirteen},
+    FormatFour,FormatFive,FormatSix,FormatSeven,FormatEight,FormatNine,FormatTen,FormatEle,FormatTwelve,FormatThirteen,FormatFourteen},
   computed: {
     globalLang() { //全局语言版本 中文ppt可用 英文ppt固定en忽视
       return this.$store.state.lang

+ 3 - 1
src/views/ppt_manage/newVersion/components/editor/AddFormat.vue

@@ -37,6 +37,7 @@ import FormatPreTen from "@/views/ppt_manage/newVersion/components/formatPreview
 import FormatPreEle from "@/views/ppt_manage/newVersion/components/formatPreview/FormatPreEle";
 import FormatPreTwelve from "@/views/ppt_manage/newVersion/components/formatPreview/FormatPreTwelve";
 import FormatPreThirteen from "@/views/ppt_manage/newVersion/components/formatPreview/FormatPreThirteen";
+import FormatPreFourteen from "@/views/ppt_manage/newVersion/components/formatPreview/FormatPreFourteen";
 import {countComponentName} from '@/views/ppt_manage/newVersion/utils/untils';
 export default {
   name: "AddFormat",
@@ -59,7 +60,8 @@ export default {
     FormatPreTen,
     FormatPreEle,
     FormatPreTwelve,
-    FormatPreThirteen
+    FormatPreThirteen,
+    FormatPreFourteen
   },
   data() {
     return {

+ 2 - 2
src/views/ppt_manage/newVersion/components/formatPage/FormatEle.vue

@@ -28,7 +28,7 @@
                     @getText="getText($event,4)" />
             </div>
         </div>
-        <div class="wrap-full-bottom bottom-15 flex-center"
+        <div class="wrap-full-bottom bottom-ele-15 flex-center"
             :style="pageItem.layers&&!isLayerShow()?TypeName(5)==='ChartEl'?'z-index:5':'z-index:3':''">
             <component :data-position="5" :is="TypeName(5)" :ref="RefName(5)" :index="pageIndex" :position="5"
                 :item="Item(5)" @dragstart.native="onDragStart" @dragover.native="onDragOver" @drop.native="onDrop"
@@ -73,7 +73,7 @@
 <style scoped lang="scss">
 .format-ele{
     .line{
-        height: 41%;
+        height: 35%;
         .line-item{
             width: 50%;
         }

+ 11 - 2
src/views/ppt_manage/newVersion/components/formatPage/FormatFour.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="total-wrap" :style="{'pointer-events' :isPreview?'none':'auto'}">
+  <div class="total-wrap format-four" :style="{'pointer-events' :isPreview?'none':'auto'}">
       <div class="wrap-full-left-half top flex-center" :style="pageItem.layers&&!isLayerShow()?TypeName(1)==='ChartEl'?'z-index:5':'z-index:3':''">
         <component
           :data-position="1"
@@ -42,7 +42,7 @@
           @getText="getText($event,3)"
         ></component>
       </div>
-      <div class="wrap-full-right-half bottom flex-center" :style="pageItem.layers&&!isLayerShow()?TypeName(4)==='ChartEl'?'z-index:5':'z-index:3':''">
+      <div class="wrap-full-right-half four-bottom bottom flex-center" :style="pageItem.layers&&!isLayerShow()?TypeName(4)==='ChartEl'?'z-index:5':'z-index:3':''">
         <component
           :data-position="4"
           :is="TypeName(4)"
@@ -103,4 +103,13 @@ export default {
 </script>
 
 <style scoped lang="scss">
+.format-four {
+  .top {
+    height: 40%;
+  }
+  .bottom {
+    top: 40%;
+    height: 60%;
+  }
+}
 </style>

+ 112 - 0
src/views/ppt_manage/newVersion/components/formatPage/FormatFourteen.vue

@@ -0,0 +1,112 @@
+<template>
+  <div class="total-wrap format-fourteen" :style="{'pointer-events' :isPreview?'none':'auto'}">
+      <div class="wrap-full-left-half top flex-center" :style="pageItem.layers&&!isLayerShow()?TypeName(1)==='ChartEl'?'z-index:5':'z-index:3':''">
+        <component
+          :data-position="1"
+          :is="TypeName(1)"
+          :ref="RefName(1)"
+          :index="pageIndex"
+          :position="1"
+          :item="Item(1)"
+          @dragstart.native="onDragStart"
+          @dragover.native="onDragOver"
+          @drop.native="onDrop"
+          @getText="getText($event,1)"
+        ></component>
+      </div>
+      <div class="wrap-full-left-half bottom flex-center" :style="pageItem.layers&&!isLayerShow()?TypeName(2)==='ChartEl'?'z-index:5':'z-index:3':''">
+        <component
+          :data-position="2"
+          :is="TypeName(2)"
+          :ref="RefName(2)"
+          :index="pageIndex"
+          :position="2"
+          :item="Item(2)"
+          @dragstart.native="onDragStart"
+          @dragover.native="onDragOver"
+          @drop.native="onDrop"
+          @getText="getText($event,2)"
+        ></component>
+      </div>
+   <!--  </div> -->
+    <div class="wrap-full-right fourteen-right flex-center" :style="{'z-index':pageItem.layers&&!isLayerShow()?TypeName(3)==='ChartEl'?'5':'3':'auto'}">
+        <component
+          :data-position="3"
+          :is="TypeName(3)"
+          :ref="RefName(3)"
+          :index="pageIndex"
+          :position="3"
+          :item="Item(3)"
+          @dragstart.native="onDragStart"
+          @dragover.native="onDragOver"
+          @drop.native="onDrop"
+          @getText="getText($event,3)"
+        ></component>
+    </div>
+    <!-- 图层编辑模式 -->
+    <div class="layers" :id="`layers_${pageItem.id}`"
+        v-if="isLayerShow()" @click.stop="clickLayer" @contextmenu.stop="showLayerContentMenu">
+      <template v-for="item in pageItem.layers">
+        <component
+          :is="getLayerElName(item)"
+          :key="item.id"
+          :elementInfo="item"
+          :isActive="item.id===activeLayerEl.id&&!isClickLayer"
+          :isLayerEdit="true"
+          @click.stop.native="changeActEl(item)"
+          @chooseThis="changeActEl(item)"
+          v-on="$listeners"
+        ></component>
+      </template>
+    </div>
+    <!-- 非图层编辑模式 -->
+    <template v-else>
+      <template v-for="item in pageItem.layers">
+        <component
+          :is="getLayerElName(item)"
+          :key="item.id"
+          :elementInfo="item"
+          :isActive="false"
+          :isLayerEdit="false"
+        ></component>
+      </template>
+    </template>
+  </div>
+</template>
+
+<script>
+import mixin from "./mixins";
+import {defaultPosition} from "../../utils/config";
+export default {
+  name: "formatFourteen",
+  mixins: [mixin],
+  data(){
+    return {
+      modelId:14,
+      positionInfo:defaultPosition[14]
+    }
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.format-fourteen {
+  .wrap-full-left-half{
+    width: 40%;
+    &.top {
+      height: 65%;
+    }
+    &.bottom {
+      height: 35%;
+      top: 65%;
+    }
+  }
+  .fourteen-right {
+    width: 60%;
+    .editor-wrap {
+        width: 96%;
+        height: 90%;
+    }
+  }
+}
+</style>

+ 25 - 0
src/views/ppt_manage/newVersion/components/formatPreview/FormatPreFourteen.vue

@@ -0,0 +1,25 @@
+<template>
+  <div class="format-pre-wrap flex-center">
+    <div class="half-left flex-center">
+      <img class="half-top" src="~@/assets/img/ppt_m/format-pic.png" />
+      <!-- <img class="half-bottom" src="~@/assets/img/ppt_m/format-pic.png" /> -->
+      <div class="half-bottom text"></div>
+    </div>
+    <div class="half-right flex-center">
+      <div class="full text"></div>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "formatPreFourteen",
+  data() {
+    return {};
+  },
+  methods: {},
+};
+</script>
+
+<style scoped lang="scss">
+</style>

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

@@ -14,7 +14,7 @@ $titleColor:#333333;
     .mce-content-body{
         width: 100%;
         height: 100%;
-        padding: 10px;
+        padding: 5px;
         box-sizing: border-box;
         font-size: 16px;
         &:focus-visible{

+ 19 - 0
src/views/ppt_manage/newVersion/css/format.scss

@@ -525,6 +525,14 @@ $marginTop:14%;
             top:0;
             right:2.5%;
         }
+
+        //板式4文本框加高度
+        &.four-bottom {
+          .editor-wrap {
+            width: 90%;
+            height: 90%;
+          }
+        }
       }
       .editor-wrap {
         width: 90%;
@@ -572,6 +580,17 @@ $marginTop:14%;
                 top:80%;
             }
         }
+
+        //十一板式底部加高
+        .bottom-ele-15{
+            height: 28%;
+            .chart-bottom-insruction-info,.chart-source{
+                top:80%;
+            }
+            .editor-wrap {
+              width: 95%;
+            }
+        }
     }
 
 }

+ 10 - 5
src/views/ppt_manage/newVersion/pptPublish.vue

@@ -132,6 +132,9 @@ export default {
         return this.LayoutType===2?2:3
     },
 
+    isTestLocal() {
+      return process.env.NODE_ENV==='development'
+    }
   },
   methods: {
     /* 提交 */
@@ -287,14 +290,14 @@ export default {
       //开始计时
       const start = Date.now()
       const SlideMaster = _.cloneDeep(pptSlideMaster) 
-      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)
+      SlideMaster.objects[1] = {image: {x:0,y:0,w:10,h:7,path: this.isTestLocal?require('@/assets/img/pptnextimg.png'):this.pptBgImage}}
+      let pptx = pptConfigInit(new pptxgen(),this.LayoutType,'ch',SlideMaster,this.isTestLocal?require('@/assets/img/pptnextimg.png'):this.pptBgImage)
       //添加封面
       let cover = pptx.addSlide()
       let coverId = 'cover'
       let coverImg = $(`#${coverId} .cover img`)[0].src
       cover.addImage({
-        path: coverImg,
+        path: this.isTestLocal?require('@/assets/img/ppt_m/bg3.jpg'):coverImg,
         x: 0,
         y: 0,
         w:'100%',
@@ -433,7 +436,7 @@ export default {
         let backId = 'back'
         let backImg = $(`#${backId} img`)[0].src
         back.addImage({
-            path: backImg,
+            path: this.isTestLocal?require('@/assets/img/pptlastimg.png'):backImg,
             x: 0,
             y: 0,
             w:'100%',
@@ -447,7 +450,9 @@ export default {
       //结束计时
       const end = Date.now()
       console.log("转换ppt用时:",Math.floor((end-start)/1000),' s')
-      //pptx.writeFile({ fileName: "test.pptx" });//本地测试用
+      if(this.isTestLocal) {
+        return pptx.writeFile({ fileName: "test.pptx" });//本地测试用
+      }
       //直接下载
       if(type==='dowload'){
         this.downloadLoading = this.$loading({

+ 62 - 22
src/views/ppt_manage/newVersion/utils/config.js

@@ -96,6 +96,10 @@ export const formatPre = [{
     },{
         modelId:13,
         text:'xxx'
+    },
+    {
+      modelId:14,
+      text:'左上图左下右文本框'
     }
 ]
 //版式id对应组件名
@@ -112,7 +116,8 @@ export const modelMap = {
     10:'Ten',
     11:'Ele',
     12:'Twelve',
-    13:'Thirteen'
+    13:'Thirteen',
+    14:'Fourteen',
 }
 //版式信息,用于判断图表/文字插入哪个位置
 export const modelInfo = {
@@ -215,7 +220,15 @@ export const modelInfo = {
         positions:[1,2],
         elChartNum:2,
         elTextNum:0
-    }
+    },
+    14: {
+      elNum: 3,
+      elType: ['chart', 'text', 'text'],
+      positions: [1, 2, 3],
+      elChartNum: 1,
+      elTextNum: 2,
+      elTextPosition: 3
+  },
 }
 
 //给标题预留的位置,单位%
@@ -279,27 +292,27 @@ export const modelConfig = [{
         elements: [{
             position: 1,
             width: 100*0.5,
-            height: (restHeight)*0.5*0.84,
+            height: (restHeight)*0.4*0.84,
             x: 0,
-            y: ((restHeight)*0.5-(restHeight)*0.5*0.84)/2
+            y: ((restHeight)*0.4-(restHeight)*0.4*0.84)/2
         }, {
             position: 2,
             width: 100*0.5,
-            height: (restHeight)*0.5*0.84,
+            height: (restHeight)*0.6*0.84,
             x: 0,
-            y: 50-7/* +((restHeight)*0.5-(restHeight)*0.5*0.84)/2 */,//or 50
+            y: 50-17/* +((restHeight)*0.5-(restHeight)*0.5*0.84)/2 */,//or 50
         }, {
             position: 3,
             width: 100*0.5,
-            height: (restHeight)*0.5*0.84,
+            height: (restHeight)*0.4*0.84,
             x: 50,//or 50
             y: ((restHeight)*0.5-(restHeight)*0.5*0.84)/2
         }, {
             position: 4,
             width: 100*0.5,
-            height: (restHeight)*0.5*0.84,
+            height: (restHeight)*0.6*0.9,
             x: 50,
-            y: 50-7/* +((restHeight)*0.5-(restHeight)*0.5*0.84)/2 */,//or 50
+            y: 50-17/* +((restHeight)*0.5-(restHeight)*0.5*0.84)/2 */,//or 50
         }]
     },
     {
@@ -445,33 +458,33 @@ export const modelConfig = [{
         elements:[{
             position:1,
             width:50,
-            height:(restHeight)*0.40*0.9,
+            height:(restHeight)*0.35*0.9,
             x:0,
-            y:(restHeight*0.4*0.1)/2
+            y:(restHeight*0.35*0.1)/2
         },{
             position:2,
             width:50,
-            height:(restHeight)*0.40*0.9,
+            height:(restHeight)*0.35*0.9,
             x:50,
-            y:(restHeight*0.4*0.1)/2
+            y:(restHeight*0.35*0.1)/2
         },{
             position:3,
             width:50,
-            height:(restHeight)*0.40*0.9,
+            height:(restHeight)*0.35*0.9,
             x:0,
-            y:38
+            y:34
         },{
             position:4,
             width:50,
-            height:(restHeight)*0.40*0.9,
+            height:(restHeight)*0.35*0.9,
             x:50,
-            y:38
+            y:34
         },{
             position:5,
-            width:100*0.9,
-            height:(restHeight)*0.18*0.8,
+            width:100*0.95,
+            height:(restHeight)*0.28*0.8,
             x:0,
-            y:74
+            y:64
         }]
     },{
         modelId:10,
@@ -539,7 +552,29 @@ export const modelConfig = [{
             x:0,
             y:(restHeight)*0.5
         }]
-    }
+    },
+    {
+      modelId: 14,
+      elements: [{
+          position: 1,
+          width: 100*0.4,
+          height: (restHeight)*0.65*0.84,
+          x: 0,
+          y: ((restHeight)*0.5-(restHeight)*0.5*0.84)/2
+      }, {
+          position: 2,
+          width: 100*0.4,
+          height: (restHeight)*0.35*0.84,
+          x: 0,
+          y: 52/* +((restHeight)*0.5-(restHeight)*0.5*0.84)/2 */,//or 50
+      }, {
+          position: 3,
+          width: 100*0.6,
+          height: (restHeight)*0.9,
+          x: 40,
+          y: ((restHeight)-(restHeight)*0.9)/2
+      }]
+  },
 ]
 //ppt母版
 export const pptSlideMaster = {
@@ -830,7 +865,12 @@ export const defaultPosition = {
   13:{
     1:{type:'chart'},
     2:{type:'chart'}
-  }
+  },
+  14:{
+    1:{type:'chart'},
+    2:{type:'text'},
+    3:{type:'text'}
+  },
 }
 //画笔工具栏
 export const boardTool = [

+ 10 - 0
src/views/ppt_manage/newVersion/utils/untils.js

@@ -358,6 +358,11 @@ export const getTextContentSize = (model,position)=>{
         },
         13:{
             1:[],2:[]
+        },
+        14: {
+          1:[1,0.4,1,0.9],
+          2:[1,0.4,1,0.9],
+          3:[1,0.6,1,0.96]
         }
     }
     const modelMapHeight = {
@@ -415,6 +420,11 @@ export const getTextContentSize = (model,position)=>{
         },
         13:{
             1:[],2:[]
+        },
+        14: {
+            1:[0.86,1,0.65,0.84],
+            2:[0.86,1,0.35,0.84],
+            3:[0.86,1,0.9]
         }
     }
     const baseWidth=900,baseHeight=630