Procházet zdrojové kódy

季节性图配置,颜色处理

hbchen před 5 měsíci
rodič
revize
66c820a843

+ 5 - 5
src/views/dataEntry_manage/mixins/chartPublic.js

@@ -731,7 +731,6 @@ export const chartSetMixin = {
 
       /* 主题样式*/
       const chartTheme =  this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
-      console.log(this.chartInfo,'chartTheme',chartTheme);
       //拼接标题 数据列
       let data = [];
       let ydata = [];
@@ -1097,9 +1096,10 @@ export const chartSetMixin = {
                             this.isPredictorChart?chartData.DataList.List.filter((item, index) => index > 0):
                             chartData.DataList.filter((item, index) => index > 0):
                             chartData.DataList
-       /* 主题样式*/
-       const chartTheme =  this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
-
+      /* 主题样式*/
+      const chartTheme =  this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
+      // 跟颜色对应
+      chartTheme.lineOptionList=chartTheme.lineOptionList.reverse().slice(-chartDataHandle.length)
       let seasonYdata = [],
         seasonData = [];
 
@@ -1121,7 +1121,7 @@ export const chartSetMixin = {
         // console.log(j,index);
         //预测指标配置
         let predict_params =  chartData.EdbInfoCategoryType === 1 ? this.getSeasonPredictParams(j.CuttingDataTimestamp) : {};
-        
+
         let serie_item = {
           data: [],
           type: (chartTheme&&chartTheme.lineOptionList[index].lineType) || chartData.ChartStyle,

+ 2 - 1
src/views/ppt_manage/mixins/mixins.js

@@ -438,7 +438,8 @@ export default {
 
        /* 主题样式*/
       const chartTheme =  this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
-
+      // 跟颜色对应
+      chartTheme.lineOptionList=chartTheme.lineOptionList.reverse().slice(-chartDataHandle.length)
 
       // 农历数据需要去除第一项 在ETA1.0.5之后,除了这里 农历和公历处理逻辑一样
       const temChartDataList=chartData.DataList||[]

+ 0 - 21
src/views/system_manage/chartTheme/components/optionsSection.vue

@@ -334,26 +334,6 @@ export default {
       colorsOptions:this.chartType===2?seasonOptions.colors:defaultETAOptions.colorsOptions,
       lineIndex:0,
       lengendPositions: verticalPositions.filter(_ => _.value!=='middle'),
-      // typeLabelMap: {
-      //   1: {label:'线条设置',lineLabel: '条'},
-      //   2: {label:'线条设置',lineLabel: '条'},
-      //   4: {label:'柱形设置',lineLabel: '根'},
-      //   5: {label:'散点设置',lineLabel: '系列'},
-      //   6: {label:'线条、柱形设置',lineLabel: '系列'},
-      //   7: {label:'柱形设置',lineLabel: '根'},
-      //   10: {label:'散点设置',lineLabel: '系列'},
-      //   11: {label:'线条设置',lineLabel: '条'},
-      // },
-      // labelMap: new Map([
-      //   ['lineOptionList','线条设置'],
-      //   ['scatterOptions','散点设置'],
-      //   ['legendOptions','图例设置'],
-      //   ['titleOptions','标题设置'],
-      //   ['markerOptions','标记文字设置(来源,标识)'],
-      //   ['xAxisOptions','横轴设置'],
-      //   ['yAxisOptions','纵轴设置'],
-      //   ['drawOption','绘图区设置'],
-      // ]),
       configOptions: []
     }
   },
@@ -370,7 +350,6 @@ export default {
           spinner: 'el-icon-loading',
           background: 'rgba(255, 255, 255, 0.8)'
       });
-      console.log(this.themeOptions,'themeOptions');
       this.themeOptions = {
         // lineOptions: {
         //   dashStyle: options.lineOptions.dashStyle,

+ 1 - 1
src/views/system_manage/chartTheme/themeSetting.vue

@@ -165,7 +165,7 @@ export default {
       const { legendOptions,titleOptions,markerOptions,xAxisOptions,yAxisOptions,drawOption,lineOptionList } = this.$refs.optionsSectionRef.themeOptions;
       
       let options = {
-        colorsOptions: this.$refs.optionsSectionRef.colorsOptions,
+        colorsOptions: lineOptionList.map(it => it.color),
         lineOptionList,
         legendOptions,
         titleOptions,