cxmo 9 месяцев назад
Родитель
Сommit
7f36dd8cf8

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

@@ -3,7 +3,7 @@
     <!-- 季节性图升级-添加右轴指标-->
     <div class="section-item" v-if="chartInfo.ChartType===2">
         <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">
                 <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"/>

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

@@ -2,6 +2,12 @@
 import Highcharts from 'highcharts';
 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轴
 const scatterXAxis = {
   tickPosition: 'inside',
@@ -500,7 +506,8 @@ export default {
             type:'arearange',//上下限是一个范围
             data:[],
             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=>{
             serieItem.data.push([item.DataTimestamp,item.MinValue,item.MaxValue])
@@ -526,7 +533,8 @@ export default {
             type:'arearange',//标准差也是一个范围
             data:[],
             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=>{
             serieItem.data.push([item.DataTimestamp,item.MinValue,item.MaxValue])
@@ -607,6 +615,12 @@ export default {
       //如果有右轴,seasonYdata加上右轴
       if(SeasonRightConfig.IsShow){
         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({
             ...seasonOptions.yAxis,
             opposite: true,//右轴
@@ -621,7 +635,7 @@ export default {
                 }
               },
               title: {
-                text: SeasonRightConfig.Legend||'右轴test',
+                text: rightEdb.Unit||'',
                 style:{
                   ...chartTheme&&chartTheme.yAxisOptions.style
                 },