浏览代码

Merge branch 'eta1.4.1' into eta1.4.6

Karsa 10 月之前
父节点
当前提交
77d69b2c7a
共有 1 个文件被更改,包括 7 次插入5 次删除
  1. 7 5
      src/views/dataEntry_manage/mixins/addOreditMixin.js

+ 7 - 5
src/views/dataEntry_manage/mixins/addOreditMixin.js

@@ -431,13 +431,15 @@ export default {
 		/* 添加指标时 配置默认颜色 线条等 */
 		setAddChartDefault() {
 
-			let themeOpt = JSON.parse(this.chartInfo.ChartThemeStyle);
+			let themeOpt = this.chartInfo.ChartThemeStyle ? JSON.parse(this.chartInfo.ChartThemeStyle) : null;
 
 			this.tableData.forEach((item,index) => {
-				item.ChartColor = item.ChartColor || themeOpt.colorsOptions[index];
-				item.PredictChartColor = item.PredictChartColor || themeOpt.colorsOptions[index];
-				item.ChartStyle = item.ChartStyle || (themeOpt.lineOptions.lineType||'spline');
-				this.tableData[index].ChartWidth = this.tableData[index].ChartWidth || themeOpt.lineOptions.lineWidth;
+				item.ChartColor = item.ChartColor || (themeOpt&&themeOpt.colorsOptions[index]||defaultOpts.colors[index]);
+				item.PredictChartColor = item.PredictChartColor || (themeOpt&&themeOpt.colorsOptions[index]||defaultOpts.colors[index]);
+				item.ChartStyle = item.ChartStyle || (themeOpt&&themeOpt.lineOptions.lineType||'spline');
+				
+				let configLineWid = index===0?3:1;//兼容预测指标绘图无主题配置
+				this.tableData[index].ChartWidth = this.tableData[index].ChartWidth || (themeOpt&&themeOpt.lineOptions.lineWidth||configLineWid);
 			})
 		},