浏览代码

fix 改动同步ppt

cxmo 9 月之前
父节点
当前提交
7f36dd8cf8
共有 2 个文件被更改,包括 18 次插入4 次删除
  1. 1 1
      src/views/dataEntry_manage/components/markersSection.vue
  2. 17 3
      src/views/ppt_manage/mixins/mixins.js

+ 1 - 1
src/views/dataEntry_manage/components/markersSection.vue

@@ -3,7 +3,7 @@
     <!-- 季节性图升级-添加右轴指标-->
     <!-- 季节性图升级-添加右轴指标-->
     <div class="section-item" v-if="chartInfo.ChartType===2">
     <div class="section-item" v-if="chartInfo.ChartType===2">
         <div class="average-item" v-if="rightEdbForm.IsAdd">
         <div class="average-item" v-if="rightEdbForm.IsAdd">
-            <span>{{rightEdbForm.EdbName||0}}</span>
+            <span>{{$t('Chart.Detail.r_axis')}}</span>
             <div style="flex-shrink:0">
             <div style="flex-shrink:0">
                 <i class="el-icon-view icon" :style="rightEdbForm.IsShow?'color:#0052D9':'color:#999'" @click="rightEdbForm.IsShow=!rightEdbForm.IsShow;previewSeason('updateSeason')"/>
                 <i class="el-icon-view icon" :style="rightEdbForm.IsShow?'color:#0052D9':'color:#999'" @click="rightEdbForm.IsShow=!rightEdbForm.IsShow;previewSeason('updateSeason')"/>
                 <i class="el-icon-edit icon" style="margin:0 6px" @click="isAddRightEdbDialogShow=true"/>
                 <i class="el-icon-edit icon" style="margin:0 6px" @click="isAddRightEdbDialogShow=true"/>

+ 17 - 3
src/views/ppt_manage/mixins/mixins.js

@@ -2,6 +2,12 @@
 import Highcharts from 'highcharts';
 import Highcharts from 'highcharts';
 import { defaultOpts, seasonOptions,getTerminal,browser } from '@/utils/defaultOptions';
 import { defaultOpts, seasonOptions,getTerminal,browser } from '@/utils/defaultOptions';
 
 
+//获取RGBA的透明度
+const parseRgbaColor = (color='rgba(51, 51, 51, 1)') => {
+    const arr = color.match(/(\d(\.\d+)?)+/g) || ['','','',1];
+    return parseFloat(arr[3]||1)
+}
+
 // 散点x轴
 // 散点x轴
 const scatterXAxis = {
 const scatterXAxis = {
   tickPosition: 'inside',
   tickPosition: 'inside',
@@ -500,7 +506,8 @@ export default {
             type:'arearange',//上下限是一个范围
             type:'arearange',//上下限是一个范围
             data:[],
             data:[],
             name:MaxMinLimits.Legend||'同期上下限',
             name:MaxMinLimits.Legend||'同期上下限',
-            color:MaxMinLimits.Color||'#075EEE'
+            color:MaxMinLimits.Color||'#075EEE',
+            fillOpacity:parseRgbaColor(MaxMinLimits.Color||'')>0.75?0.75:parseRgbaColor(MaxMinLimits.Color||'') //透明度最高0.75 
         }
         }
         MaxMinLimits.List.forEach(item=>{
         MaxMinLimits.List.forEach(item=>{
             serieItem.data.push([item.DataTimestamp,item.MinValue,item.MaxValue])
             serieItem.data.push([item.DataTimestamp,item.MinValue,item.MaxValue])
@@ -526,7 +533,8 @@ export default {
             type:'arearange',//标准差也是一个范围
             type:'arearange',//标准差也是一个范围
             data:[],
             data:[],
             name:SamePeriodStandardDeviation.Legend||'同期标准差',
             name:SamePeriodStandardDeviation.Legend||'同期标准差',
-            color:SamePeriodStandardDeviation.Color||'#075EEE'
+            color:SamePeriodStandardDeviation.Color||'#075EEE',
+            fillOpacity:parseRgbaColor(SamePeriodStandardDeviation.Color||'')>0.75?0.75:parseRgbaColor(SamePeriodStandardDeviation.Color||'')
         }
         }
         SamePeriodStandardDeviation.List.forEach(item=>{
         SamePeriodStandardDeviation.List.forEach(item=>{
             serieItem.data.push([item.DataTimestamp,item.MinValue,item.MaxValue])
             serieItem.data.push([item.DataTimestamp,item.MinValue,item.MaxValue])
@@ -607,6 +615,12 @@ export default {
       //如果有右轴,seasonYdata加上右轴
       //如果有右轴,seasonYdata加上右轴
       if(SeasonRightConfig.IsShow){
       if(SeasonRightConfig.IsShow){
         const rightEdb = (SeasonRightConfig.IndicatorType===1?SeasonRightConfig.EdbInfoList[0]:this.dataList[1])||{unit:''}
         const rightEdb = (SeasonRightConfig.IndicatorType===1?SeasonRightConfig.EdbInfoList[0]:this.dataList[1])||{unit:''}
+        //左轴同比:text为空或% 右轴指标:取指标单位
+        if(SeasonRightConfig.IndicatorType===1){
+            rightEdb.Unit = SeasonRightConfig.NumFormat===1?'%':''
+        }else{
+            rightEdb.Unit = this.dataList[1]&&(this.dataList[1].ConvertUnit||this.dataList[1].Unit)||''
+        }
         seasonYdata.push({
         seasonYdata.push({
             ...seasonOptions.yAxis,
             ...seasonOptions.yAxis,
             opposite: true,//右轴
             opposite: true,//右轴
@@ -621,7 +635,7 @@ export default {
                 }
                 }
               },
               },
               title: {
               title: {
-                text: SeasonRightConfig.Legend||'右轴test',
+                text: rightEdb.Unit||'',
                 style:{
                 style:{
                   ...chartTheme&&chartTheme.yAxisOptions.style
                   ...chartTheme&&chartTheme.yAxisOptions.style
                 },
                 },