浏览代码

Merge branch 'ppt-demand-053'

cxmo 1 年之前
父节点
当前提交
e3e6249522
共有 1 个文件被更改,包括 4 次插入6 次删除
  1. 4 6
      src/views/ppt_manage/mixins/pptMixins.js

+ 4 - 6
src/views/ppt_manage/mixins/pptMixins.js

@@ -572,7 +572,8 @@ export default {
         let titleHTML = null
         //中英文发布页需设置title换行
         //一行可容纳的中文字体数
-        let count = parseInt($(`#${refName}`)[0].offsetWidth / 19)*2;
+        const fontSize = chartTheme?chartTheme.titleOptions.style.fontSize:1
+        let count = parseInt($(`#${refName}`)[0].offsetWidth / fontSize)*1.75
         let {total,newStr} = getStrSize(options.MyChartTitle,count)
         const isPublish = this.$route.path==='/pptpublish'||this.$route.path==='/pptenpublish'
         if(isShowTitle){
@@ -580,12 +581,11 @@ export default {
             text-align:${chartTheme&&chartTheme.titleOptions.align};
             font-size:${chartTheme&&chartTheme.titleOptions.style.fontSize}px;
             color:${chartTheme&&chartTheme.titleOptions.style.color};
-            height:18px;
+            min-height:18px;word-break: break-all;
           ">
             ${options.MyChartTitle}
           </div>`
         }
-        const titleOption = isPublish&&isShowTitle?{marginTop:25}:{}
         let SpecialOption = {
           chart: {
             ...defaultOpts.chart,
@@ -595,7 +595,6 @@ export default {
             backgroundColor: "rgba(0,0,0,0)",
             renderTo:$(`#${refName}`)[0],
             ...options.chart||{},
-            ...titleOption
           },
           legend: {
             ...defaultOpts.legend,
@@ -604,9 +603,8 @@ export default {
           colors: options.colors||chartTheme&&chartTheme.colorsOptions||defaultOpts.colors,
           title: isPublish?{
             text: isShowTitle?newStr:null,
-            margin:0,
+            margin:5,
             useHTML:false,
-            floating:true,
             style:{...chartTheme&&chartTheme.titleOptions.style},
             align: (chartTheme&&chartTheme.titleOptions.align) || (total>count?'left':'center'),
           }:{