Browse Source

ppt换封面的字和颜色,中文

cxmo 1 year ago
parent
commit
14fd54a1e3

+ 15 - 5
src/views/ppt_manage/mixins/pptMixins.js

@@ -39,8 +39,12 @@ export default {
       pageLoading:null,//演示时,切换page需要加载图表数据
       publishLoading:null,//发布时loading
       pptCoverList:[],//配置ppt封面
-      pptBgImage:'',
-      pptBackImage:'',
+      pptBgImage:'',//ppt背景图
+      pptBackImage:'',//ppt封底
+      pptCoverCompenyName:'',//封面公司名称
+      pptCoverDepartName:'',//封面部门名称
+      pptCoverTextColor:'',//控制上面两个字段展示的颜色
+
 
       setEnName:false,
       // 传入的formItem所需内容
@@ -56,21 +60,27 @@ export default {
     }
   },
   methods: {
-    //获取ppt配置
+    //获取基本配置-ppt配置
     async getpptConfig(){
         const res = await etaBaseConfigInterence.getBaseConfig()
         if(res.Ret!==200) return 
-        const {CnPptCoverImgs,CnPptBackgroundImg,CnPptBottomImg,
-               EnPptCoverImgs,EnPptBackgroundImg,EnPptBottomImg,
+        const {CnPptCoverImgs,CnPptBackgroundImg,CnPptBottomImg,PptCompanyName,PptTeamName,PptFontColor,
+               EnPptCoverImgs,EnPptBackgroundImg,EnPptBottomImg,PptCompanyNameEn,PptTeamNameEn,PptFontColorEn
               } = res.Data
         if(this.currentLang==='en'){
             this.pptCoverList = EnPptCoverImgs.split(',')
             this.pptBgImage = EnPptBackgroundImg
             this.pptBackImage = EnPptBottomImg
+            this.pptCoverCompenyName = PptCompanyNameEn
+            this.pptCoverDepartName = PptTeamNameEn
+            this.pptCoverTextColor = PptFontColorEn
         }else{
             this.pptCoverList = CnPptCoverImgs.split(',')
             this.pptBgImage = CnPptBackgroundImg
             this.pptBackImage = CnPptBottomImg
+            this.pptCoverCompenyName = PptCompanyName
+            this.pptCoverDepartName = PptTeamName
+            this.pptCoverTextColor = PptFontColor
         }
     },
     //获取ppt详情

+ 12 - 10
src/views/ppt_manage/newVersion/components/Cover.vue

@@ -1,23 +1,23 @@
 <template>
-    <div class="flex-column cover" style="width:100%;" v-if="pageInfo">
+    <div class="flex-column cover" :style="`width:100%;color: ${$parent.pptCoverTextColor||'#fff'};`" v-if="pageInfo">
         <!-- <img :src="pageInfo.BackgroundImg" class="pptbg" /> -->
         <!-- <img :src="base64Url" class="pptbg" /> -->
         <img :src="pageInfo.BackgroundImg" class="pptbg"  style="width:100%"/>
         <div
-        style="width:62%; font-size:16px; text-align:center; line-height:1.6; color:#fff; position:absolute; right:20px; top:50%;zIndex:20;">
-        <p style="height:5px; border-top:1px solid #fff;marginBottom:21px;"></p>
+        style="width:62%; font-size:16px; text-align:center; line-height:1.6;  position:absolute; right:20px; top:50%;zIndex:20;">
+        <p :style="`height:5px; border-top:1px solid ${$parent.pptCoverTextColor||'#fff'};marginBottom:21px;`"></p>
         <p style="font-size:28px;">{{ pageInfo.Title }}</p>
         <p style="display:flex; align-items:center; justify-content:center;margin:10px 0;">
-            <span style="display:inline-block; width:15px; margin-right:5px; border-top:1px solid #fff;"></span>
-            <span>弘则弥道(上海)投资咨询有限公司</span>
+            <span :style="`display:inline-block; width:15px; margin-right:5px; border-top:1px solid ${$parent.pptCoverTextColor||'#fff'};`"></span>
+            <span :style="{'color':$parent.pptCoverTextColor||''}">{{$parent.pptCoverCompenyName||'ETA'}}</span>
             <span
-            style="display:inline-block; width:14px; height:14px; background:#fff; border-radius:100%; margin:0 5px;"></span>
+            :style="`display:inline-block; width:14px; height:14px; background:${$parent.pptCoverTextColor||'#fff'}; border-radius:100%; margin:0 5px;`"></span>
             <span>{{ pageInfo.ReportType }}</span>
-            <span style="display:inline-block; width:15px; margin-left:5px; border-top:1px solid #fff;"></span>
+            <span :style="`display:inline-block; width:15px; margin-left:5px; border-top:1px solid ${$parent.pptCoverTextColor||'#fff'};`"></span>
         </p>
-        <p>FICC研究部</p>
+        <p :style="{'color':$parent.pptCoverTextColor||''}">{{$parent.pptCoverDepartName||'投研部'}}</p>
         <p>{{pageInfo.PptDate}}</p>
-        <p style="width:80%; height:1px; border-bottom:1px solid #fff; margin:21px auto 0;"></p>
+        <p :style="`width:80%; height:1px; border-bottom:1px solid ${$parent.pptCoverTextColor||'#fff'}; margin:21px auto 0;`"></p>
         </div>
     </div>
 </template>
@@ -35,7 +35,9 @@ export default {
     };
   },
   methods: {},
-  mounted(){},
+  mounted(){
+      console.log('test parent',this.$parent)
+  },
 };
 </script>
 

+ 2 - 2
src/views/ppt_manage/newVersion/components/CoverEn.vue

@@ -6,14 +6,14 @@
         <p style="height:5px; border-top:1px solid #fff;marginBottom:21px;"></p>
         <p style="font-size:28px;">{{ pageInfo.Title }}</p>
         <p style="display:flex; align-items:center; justify-content:center;margin:10px 0;">
-            <span>HORIZON INSIGHTS PTE. LTD.</span>
+            <span :style="{'color':$parent.pptCoverTextColor||''}">{{$parent.pptCoverCompenyName||'ETA'}}</span>
         </p>
         <p style="display:flex; align-items:center; justify-content:center;">
           <span style="display:inline-block; width:15px; margin-left:5px; border-top:1px solid #fff;"></span>  
           <span>{{ pageInfo.ReportType }}</span>
           <span style="display:inline-block; width:15px; margin-left:5px; border-top:1px solid #fff;"></span>
         </p>
-        <p>FICC Research Department</p>
+        <p :style="{'color':$parent.pptCoverTextColor||''}">{{$parent.pptCoverDepartName||'Research Department'}}</p>
         <p>{{pageInfo.PptDate}}</p>
         <p style="width:80%; height:1px; border-bottom:1px solid #fff; margin:21px auto 0;"></p>
         </div>

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

@@ -241,6 +241,7 @@ export default {
     },
     //计算title的字节数
     getStrCount(title){
+        if(!title) return
         return countStrSize(title)
     }
   },

+ 12 - 10
src/views/ppt_manage/newVersion/components/editor/ChooseCover.vue

@@ -6,26 +6,27 @@
                 <img src="~@/assets/img/ppt_m/close.png" alt="" class="close_ico" @click="closeDialog">
             </header>
             <div class="dialog-bg" :style="'backgroundImage:url('+bgList[bgListIndex]+');backgroundPosition:center;backgroundRepeat:no-repeat;backgroundSize:cover;'">
-                <div style="width:62%; font-size:16px; text-align:center; line-height:1.6; color:#fff; position:absolute; right:20px; top:50%;">
-                    <p style="height:5px; border-top:1px solid #fff;margin-bottom:21px;"></p>
+                <div :style="`width:62%; font-size:16px; text-align:center; line-height:1.6; color:${$parent.pptCoverTextColor}; position:absolute; right:20px; top:50%;`">
+                    <p :style="`height:5px; border-top:1px solid ${$parent.pptCoverTextColor};margin-bottom:21px;`"></p>
                     <el-input
+                      :data-textcolor="$parent.pptCoverTextColor"
                       type="textarea"
                       autosize
                       placeholder="请输入标题"
                       :maxlength="48"
                       v-model="pageData.Title" />
                     <p style="display:flex; align-items:center; justify-content:center;margin:10px 0;">
-                        <span style="display:inline-block; width:15px; margin-right:5px; border-top:1px solid #fff;"></span>
-                        <span>弘则弥道(上海)投资咨询有限公司</span>
-                        <span style="display:inline-block; width:14px; height:14px; background:#fff; border-radius:100%; margin:0 5px;"></span>
+                        <span style="display:inline-block; width:15px; margin-right:5px; border-top:1px solid $parent.pptCoverTextColor;"></span>
+                        <span :style="{'color':$parent.pptCoverTextColor||''}">{{$parent.pptCoverCompenyName||'ETA'}}</span>
+                        <span :style="`display:inline-block; width:14px; height:14px; background:${$parent.pptCoverTextColor}; border-radius:100%; margin:0 5px;`"></span>
                         <input 
                         type="text" 
-                        style="width:80px;background:transparent;color:#fff;border:none;text-align:center;display:inline-block" 
+                        :style="`width:80px;background:transparent;color:${$parent.pptCoverTextColor};border:none;text-align:center;display:inline-block`" 
                         v-model="pageData.ReportType"
                         placeholder="请输入类型">
-                        <span style="display:inline-block; width:15px; margin-left:5px; border-top:1px solid #fff;"></span>
+                        <span :style="`display:inline-block; width:15px; margin-left:5px; border-top:1px solid ${$parent.pptCoverTextColor};`"></span>
                     </p>
-                    <p>FICC研究部</p>
+                    <p :style="{'color':$parent.pptCoverTextColor||''}">{{$parent.pptCoverDepartName||'投研部'}}</p>
                     <el-date-picker
                         v-model="pageData.PptDate"
                         type="month"
@@ -34,7 +35,7 @@
                         value-format="yyyy年M月"
                         placeholder="请选择日期">
                     </el-date-picker>
-                    <p style="width:80%; height:1px; border-bottom:1px solid #fff; margin:21px auto 0;"></p>
+                    <p :style="`width:80%; height:1px; border-bottom:1px solid ${$parent.pptCoverTextColor}; margin:21px auto 0;`"></p>
                 </div>
             </div>
             <div class="dialog-bot">
@@ -123,6 +124,7 @@ export default {
     .dialog-bg{
       .el-textarea{
         max-width: 95%;
+        --text-color:attr(data-textcolor);
         textarea{
           outline: none;
           border: none;
@@ -132,7 +134,7 @@ export default {
           text-align: center;
           resize: none;
           font-weight:bolder; 
-          color: #fff;
+          color:var(--text-color);
           scrollbar-width: none; 
           -ms-overflow-style: none;
           &::-webkit-scrollbar {

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

@@ -15,7 +15,7 @@
                       :maxlength="48"
                       v-model="pageData.Title" />
                     <p style="display:flex; align-items:center; justify-content:center;margin:10px 0;">
-                        <span>HORIZON INSIGHTS PTE. LTD.</span>
+                        <span :style="{'color':$parent.pptCoverTextColor||''}">{{$parent.pptCoverCompenyName||'ETA'}}</span>
                     </p>
                     <p style="display:flex; align-items:center; justify-content:center;">
                       <span style="display:inline-block; width:15px; margin-left:5px; border-top:1px solid #fff;"></span>
@@ -26,7 +26,7 @@
                         placeholder="请输入类型"/>
                         <span style="display:inline-block; width:15px; margin-left:5px; border-top:1px solid #fff;"></span>
                     </p>
-                    <p>FICC Research Department</p>
+                    <p :style="{'color':$parent.pptCoverTextColor||''}">{{$parent.pptCoverDepartName||'Research Department'}}</p>
                     <el-date-picker
                         v-model="pageData.PptDate"
                         type="month"

+ 3 - 3
src/views/ppt_manage/newVersion/pptPublish.vue

@@ -474,9 +474,9 @@ export default {
       const coverInfo = [
         {text:'—————————————————————————————————\n',options:{fontSize:16*0.75,breakLine:true}},
         {text:this.coverInfo.page.Title,options:{fontSize:28*0.75,breakLine:true}},
-        {text:`\n— 弘则弥道(上海)投资咨询有限公司 ● ${this.coverInfo.page.ReportType} —`,
+        {text:`\n— ${this.pptCoverCompenyName||'ETA'} ● ${this.coverInfo.page.ReportType} —`,
          options:{fontSize:16*0.75,breakLine:false}},
-        {text:'\nFICC研究部',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:'\n—————————————————————————',options:{fontSize:16*0.75,breakLine:true}}
       ]
@@ -485,7 +485,7 @@ export default {
         y:'50%',
         w:'60%',
         h:'28%',
-        color:'ffffff',
+        color:(this.pptCoverTextColor||'#ffffff').slice(1),
         align:'center',
         fontFace:'SimHei'
       })

+ 35 - 0
src/views/system_manage/etaBaseConfig.vue

@@ -42,6 +42,18 @@
                     <el-radio-button label="en">英文PPT</el-radio-button>
                 </el-radio-group>
                 <div v-if="isShowPPT" v-show="pptLang === 'cn'" class="ppt-form-item-wrap">
+                    <div class="inner-input-wrap">
+                        <el-form-item label="公司名称" prop="PptCompanyName">
+                            <el-input type="text" v-model="formData.PptCompanyName"></el-input>
+                        </el-form-item>
+                        <el-form-item label="团队名称" prop="PptTeamName">
+                            <el-input type="text" v-model="formData.PptTeamName"></el-input>
+                        </el-form-item>
+                        <el-form-item label="字体颜色" prop="PptFontColor">
+                            <el-input type="color" style="width:100px;" v-model="formData.PptFontColor"></el-input>
+                        </el-form-item>
+                    </div>
+                    
                     <el-form-item label="PPT封面图" prop="CnPptCoverImgs">
                         <div class="input-line" style="display:flex;">
                             <ImgUpload 
@@ -80,6 +92,17 @@
                     </el-form-item>
                 </div>
                 <div v-if="isShowEnPPT" v-show="pptLang === 'en'" class="ppt-form-item-wrap">
+                    <div class="inner-input-wrap">
+                        <el-form-item label="公司名称" prop="PptCompanyNameEn">
+                            <el-input type="text" v-model="formData.PptCompanyNameEn"></el-input>
+                        </el-form-item>
+                        <el-form-item label="团队名称" prop="PptTeamNameEn">
+                            <el-input type="text" v-model="formData.PptTeamNameEn"></el-input>
+                        </el-form-item>
+                        <el-form-item label="字体颜色" prop="PptFontColorEn">
+                            <el-input type="color" style="width:100px;" v-model="formData.PptFontColorEn"></el-input>
+                        </el-form-item>
+                    </div>
                     <el-form-item label="PPT封面图" prop="EnPptCoverImgs">
                         <div class="input-line" style="display:flex;">
                             <ImgUpload 
@@ -447,6 +470,18 @@ export default {
                 width:100%;
                 display: flex;
                 justify-content: space-between;
+                flex-wrap: wrap;
+                .inner-input-wrap{
+                    width: 100%;
+                    display: flex;
+                    justify-content: space-between;
+                    >.el-form-item{
+                        width:30%;
+                    }
+                }
+                >.el-form-item{
+                    width:30%;
+                }
             }
         }
     }