Sfoglia il codice sorgente

Merge branch 'ppt-demand-124'

cxmo 2 mesi fa
parent
commit
8f81ba004e

+ 19 - 2
src/views/dataEntry_manage/addChart.vue

@@ -110,6 +110,22 @@
 							:placeholder="$t('Chart.InputHolderAll.input_classify')"
 						/>
 					</el-form-item>
+					<!-- 图表别名 英文文案还没给-->
+					<el-form-item label="图表别名" prop="ChartAlias" v-if="[1,5,6].includes(chartInfo.ChartType)">
+						<el-input
+							v-model="chartInfo.ChartAlias"
+							style="width: 90%"
+							placeholder="请输入图表别名"
+							clearable
+						/>
+						<el-tooltip effect="dark" placement="right">
+							<div
+								slot="content"
+								style="line-height: 20px;width:300px"
+								>设置图表别名,默认PPT中插入该图表时显示,若无设置,则PPT中不显示该图表名称。</div>
+							<i class="el-icon-question" style="color: #666" />
+						</el-tooltip>
+					</el-form-item>
 					<el-form-item :label="$t('Chart.Detail.chart_unit')" prop="Unit" v-if="[7,11].includes(chartInfo.ChartType)">
 						<el-select
 							v-model="chartInfo.Unit"
@@ -881,7 +897,7 @@ export default {
 					}
 					
 
-					const { ChartType,ChartName,ChartThemeId,SourcesFrom,Instructions,MarkersLines,MarkersAreas,ChartThemeStyle } = this.chartInfo;
+					const { ChartType,ChartName,ChartThemeId,SourcesFrom,Instructions,MarkersLines,MarkersAreas,ChartThemeStyle,ChartAlias } = this.chartInfo;
 					let public_param = {
 						ChartClassifyId: this.chartInfo.classify.length ? this.chartInfo.classify[this.chartInfo.classify.length - 1] : 0,
 						ChartEdbInfoList: db_arr,
@@ -892,7 +908,8 @@ export default {
 						Instructions,
 						MarkersLines,
 						MarkersAreas,
-						ChartThemeStyle
+						ChartThemeStyle,
+						ChartAlias,//别名
 					}
 
 					//提交参数

+ 19 - 2
src/views/dataEntry_manage/editChart.vue

@@ -131,6 +131,22 @@
 							:placeholder="$t('Chart.InputHolderAll.input_classify')"
 						/>
 					</el-form-item>
+					<!-- 图表别名 英文文案还没给-->
+					<el-form-item label="图表别名" prop="ChartAlias" v-if="[1,5,6].includes(chartInfo.ChartType)">
+						<el-input
+							v-model="chartInfo.ChartAlias"
+							style="width: 90%"
+							placeholder="请输入图表别名"
+							clearable
+						/>
+						<el-tooltip effect="dark" placement="right">
+							<div
+								slot="content"
+								style="line-height: 20px;width:300px"
+								>设置图表别名,默认PPT中插入该图表时显示,若无设置,则PPT中不显示该图表名称。</div>
+							<i class="el-icon-question" style="color: #666" />
+						</el-tooltip>
+					</el-form-item>
 					<el-form-item :label="$t('Chart.Detail.chart_unit')" prop="Unit" v-if="[7,11].includes(chartInfo.ChartType)">
 						<el-select
 							v-model="chartInfo.Unit"
@@ -1031,7 +1047,7 @@ export default {
 						})
 					}
 
-					const { ChartType,ChartName,ChartThemeId,SourcesFrom,Instructions,MarkersLines,MarkersAreas,ChartThemeStyle } = this.chartInfo;
+					const { ChartType,ChartName,ChartThemeId,SourcesFrom,Instructions,MarkersLines,MarkersAreas,ChartThemeStyle,ChartAlias } = this.chartInfo;
 					let public_param = {
 						ChartClassifyId: this.chartInfo.classify.length ? this.chartInfo.classify[this.chartInfo.classify.length - 1] : 0,
 						ChartInfoId: this.chartInfo.ChartInfoId,
@@ -1043,7 +1059,8 @@ export default {
 						Instructions,
 						MarkersLines,
 						MarkersAreas,
-						ChartThemeStyle
+						ChartThemeStyle,
+						ChartAlias,//别名
 					}
 
 					//提交参数

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

@@ -386,7 +386,8 @@ export default {
                             Source:this.chartInfo.Source,//图表来源,和MyChartType一起确定是什么图
                             Instructions: this.chartInfo.Instructions,
                             SourcesFrom: this.chartInfo.SourcesFrom,
-                            ChartThemeStyle: this.chartInfo.ChartThemeStyle
+                            ChartThemeStyle: this.chartInfo.ChartThemeStyle,
+                            ChartAlias:this.chartInfo.ChartAlias||'',//图表别名
                           }
         this.optionMap[id] = { ...defaultOpts, ...this.options,...otherOpts };
       }else{
@@ -719,7 +720,7 @@ export default {
       /* if(!$(`#${refName}`)[0]) return */
       /*
         Source:1
-        MyChartType: 2 季节性图,7 柱形图,  10 截面散点图,
+        MyChartType: 2 季节性图,7 柱形图,  10 截面散点图,11 雷达图
         Source:2
         MyChartType: 8 商品价格曲线图
         Source:5
@@ -727,9 +728,16 @@ export default {
         Source:6 拟合方程曲线
         Source:7 统计特征
         以上图表需要显示标题
+
+        Source:1
+        MyChartType:1 曲线图 5 散点图 6组合图 
+        以上图表需要显示别名
+
+        后端控制->通过新字段来判断是否显示标题/别名
       */
      const {Source,MyChartType,ChartThemeStyle} = options
      const isShowTitle = isShowPPTTitle(Source,MyChartType)
+     const isShowOtherTitle = Source===1&&[1,5,6].includes(MyChartType)
      
     /* 主题样式*/
     const chartTheme =  ChartThemeStyle ? JSON.parse(ChartThemeStyle) : null;
@@ -770,16 +778,16 @@ export default {
         //一行可容纳的中文字体数
         const fontSize = chartTheme?chartTheme.titleOptions.style.fontSize:16
         let count = parseInt($(`#${refName}`)[0].offsetWidth / fontSize)*1.75
-        let {total,newStr} = getStrSize(options.MyChartTitle,count)
+        let {total,newStr} = getStrSize(isShowTitle?options.MyChartTitle:isShowOtherTitle?options.ChartAlias:'',count)
         const isPublish = this.$route.path==='/pptpublish'||this.$route.path==='/pptenpublish'
-        if(isShowTitle){
+        if(isShowTitle||(isShowOtherTitle&&options.ChartAlias.length)){
           titleHTML = `<div style="
             text-align:${chartTheme&&chartTheme.titleOptions.align};
             font-size:${chartTheme&&chartTheme.titleOptions.style.fontSize}px;
             color:${chartTheme&&chartTheme.titleOptions.style.color};
             min-height:18px;word-break: break-all;
           ">
-            ${options.MyChartTitle}
+            ${isShowTitle?options.MyChartTitle:isShowOtherTitle?options.ChartAlias:''}
           </div>`
         }
         let SpecialOption = {
@@ -797,7 +805,7 @@ export default {
           },
           colors: options.colors||chartTheme&&chartTheme.colorsOptions||defaultOpts.colors,
           title: isPublish?{
-            text: isShowTitle?newStr:null,
+            text: (isShowTitle||(isShowOtherTitle&&options.ChartAlias.length))?newStr:null,
             margin:5,
             useHTML:false,
             style:{...chartTheme&&chartTheme.titleOptions.style},

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

@@ -37,6 +37,10 @@ $marginTop:14%;
             height: 100%;
             display: none;
         }
+        span.highcharts-title{
+            width:97% !important;
+            left:0 !important;
+        }
     }
     .editor-wrap{
         position: relative;