Prechádzať zdrojové kódy

奇怪柱形图和截面散点默认颜色

Karsa 10 mesiacov pred
rodič
commit
46317e401d

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

@@ -330,6 +330,7 @@
 					<bar-option
 						v-if="chartInfo.ChartType===7"
 						ref="BarOptRef"
+						:chartInfo="chartInfo"
 						:edblist="tableData"
 						:datedata="barDateList"
 						@getData="getBarPreviewData"
@@ -339,6 +340,7 @@
 					<sectional-scatter-option
 						v-if="chartInfo.ChartType===10"
 						ref="SectionScatterOptRef"
+						:chartInfo="chartInfo"
 						@getData="getSectionScatterData"
 						@modifySeriesName="IsNameDefault = false"
 					/>

+ 6 - 1
src/views/dataEntry_manage/components/barOptionSection.vue

@@ -140,6 +140,9 @@ export default {
   props: {
     edblist: Array,
     datedata: Array,
+    chartInfo: {
+      type: Object
+    },
     initData: {
       default: null
     }
@@ -246,8 +249,10 @@ export default {
           Color: ''
         }
         this.dateList.push(date_item)
+        
+        let themeOpt = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
         this.dateList.forEach((item,index) => {
-          item.Color = item.Color || defaultOpts.colors[index];
+          item.Color = item.Color || (themeOpt&&themeOpt.colorsOptions[index]||defaultOpts.colors[index]);
         })
       }
       this.cancelDialog()

+ 6 - 1
src/views/dataEntry_manage/components/sectionalScatterOption.vue

@@ -174,6 +174,9 @@ export default {
         type:Array,
         default:[]
     },
+    chartInfo: {
+      type: Object
+    },
     IsNameDefault:{
         type:Boolean,
         default:true
@@ -320,8 +323,10 @@ export default {
 
     /* 新增系列弹窗 */
     addSeriesHandle() {
+
+      let themeOpt = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
       this.dialogForm.show = true;
-      this.dialogForm.color = defaultOpts.colors[this.seriesArr.length];
+      this.dialogForm.color = themeOpt&&themeOpt.colorsOptions[this.seriesArr.length] || defaultOpts.colors[this.seriesArr.length];
     },
 
     /* 保存新增系列 */

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

@@ -319,6 +319,7 @@
 					<bar-option
 						v-if="chartInfo.ChartType===7"
 						ref="BarOptRef"
+						:chartInfo="chartInfo"
 						:edblist="tableData"
 						:datedata="barDateList"
 						:initData="initBarOptions"
@@ -329,6 +330,7 @@
 					<sectional-scatter-option
 						v-if="chartInfo.ChartType===10"
 						ref="SectionScatterOptRef"
+						:chartInfo="chartInfo"
 						:initData="chartInfo.ExtraConfig?JSON.parse(chartInfo.ExtraConfig):null"
 						:edbInfoData="tableData"
 						:IsNameDefault="IsNameDefault"