Prechádzať zdrojové kódy

Merge branch 'eta1.4.1' into eta1.4.6

Karsa 10 mesiacov pred
rodič
commit
957c88ddb9

+ 3 - 0
src/views/dataEntry_manage/components/satterSeriesDia.vue

@@ -403,6 +403,9 @@ export default {
         //遍历请求xEdbs yEdbs的指标详情,获取最新日期和值
         this.getEdbData()
         this.getEdbNewInfo()
+      }else {
+        let themeOpt = this.$parent.chartInfo.ChartThemeStyle ? JSON.parse(this.$parent.chartInfo.ChartThemeStyle) : null;      
+        this.form.color = themeOpt&&themeOpt.colorsOptions[0] || defaultOpts.colors[0];
       }
     }
   },

+ 39 - 2
src/views/dataEntry_manage/mixins/addOreditMixin.js

@@ -207,6 +207,25 @@ export default {
 							this.tableData.push(tableItem);
 							this.isSetExtremeValue = true;
 							// console.log(this.tableData)
+							
+							//默认拼接来源
+							if(!this.chartInfo.SourcesFrom) {
+
+								this.chartInfo.SourcesFrom = JSON.stringify({
+									isShow: this.chartInfo.SourcesFromVisable,
+									text: res.Data.ChartInfo.ChartSource,
+									color: JSON.parse(this.chartInfo.ChartThemeStyle).markerOptions.style.color,
+									fontSize: JSON.parse(this.chartInfo.ChartThemeStyle).markerOptions.style.fontSize
+								});
+							}else {
+								let sourceObj = JSON.parse(_.cloneDeep(this.chartInfo.SourcesFrom));
+								let concatSourceArr = `${sourceObj.text},${res.Data.ChartInfo.ChartSource}`.split(',');
+								let sourceStr = Array.from(new Set(concatSourceArr)).join(',');
+								this.chartInfo.SourcesFrom = JSON.stringify({
+									...sourceObj,
+									text: sourceStr
+								});
+							}
 
 							this.$nextTick(()=>{
 								// 等待 tableData的 监听里面的获取到 起始时间和最近日期
@@ -261,7 +280,7 @@ export default {
 			dataBaseInterface.getBarData(params).then(res => {
 				if(res.Ret !== 200) return
 
-				const { EdbInfoList,XEdbIdValue,YDataList } = res.Data;
+				const { EdbInfoList,XEdbIdValue,YDataList,ChartInfo } = res.Data;
 
 				let xData = XEdbIdValue.map(_ => EdbInfoList.find(edb => edb.EdbInfoId===_).EdbAliasName)
 
@@ -278,6 +297,9 @@ export default {
 						max: Math.max(...value_arr)
 					}
 				}
+				
+				//默认来源搞一下
+				this.setDefaultSourceFrom(ChartInfo);
 			})
 		},
 
@@ -592,7 +614,7 @@ export default {
 			}).then(res => {
 				if(res.Ret !== 200) return
 				
-				const { EdbInfoList,DataResp } = res.Data;
+				const { EdbInfoList,DataResp,ChartInfo } = res.Data;
 
 				this.sectionScatterData = DataResp;
 				this.tableData = EdbInfoList;
@@ -608,6 +630,9 @@ export default {
 						x_max: Math.max(...x_value_arr)
 					}
 				}
+
+				//默认来源搞一下
+				this.setDefaultSourceFrom(ChartInfo);
 			})
 		},
 
@@ -841,6 +866,18 @@ export default {
 				: this.setChartOptionHandle(this.tableData);
 		},
 
+		/* 添加图表默认显示图表来源 */
+		setDefaultSourceFrom(ChartInfo) {
+			if(!this.chartInfo.SourcesFrom) {
+				this.chartInfo.SourcesFrom = JSON.stringify({
+					isShow: this.chartInfo.SourcesFromVisable,
+					text: ChartInfo.ChartSource,
+					color: JSON.parse(this.chartInfo.ChartThemeStyle).markerOptions.style.color,
+					fontSize: JSON.parse(this.chartInfo.ChartThemeStyle).markerOptions.style.fontSize
+				});
+			}
+		},
+
 		/* 数据来源显示隐藏 */
 		changeSourceVisable() {
 			this.chartInfo.SourcesFrom = JSON.stringify({

+ 8 - 3
src/views/dataEntry_manage/mixins/chartPublic.js

@@ -976,8 +976,10 @@ export const chartSetMixin = {
         },
         xDateFormat: '%m/%d',
       }
+
+      let colors = chartTheme&&chartTheme.colorsOptions.reverse();
       this.options = {
-        colors:chartTheme&&chartTheme.colorsOptions.slice(-chartDataHandle.length),
+        colors: colors.slice(-chartDataHandle.length),
         series: seasonData,
         yAxis: seasonYdata,
         xAxis,
@@ -2486,7 +2488,9 @@ export const chartSetMixin = {
         let markerValue='';
         if(isXDateAxis) {
           //季节图x轴额外拼个年份
-          let nowYear = new Date().getFullYear();
+          let nowYear = ChartType===2 ? new Date(this.tableData[0].DataList[1].DataList
+[0].DataTimestamp).getFullYear() : '';
+          console.log(nowYear)
           markerValue = ChartType===2 
             ? new Date(`${nowYear}-${_.value}`).getTime()
             : new Date(_.value).getTime()
@@ -2526,7 +2530,8 @@ export const chartSetMixin = {
         let fromMarkerValue='',toMarkerValue='';
         if(isXDateAxis) {
           //季节图x轴额外拼个年份
-          let nowYear = new Date().getFullYear();
+          let nowYear = ChartType===2 ? new Date(this.tableData[0].DataList[1].DataList
+            [0].DataTimestamp).getFullYear() : '';
           fromMarkerValue = ChartType===2 
             ? new Date(`${nowYear}-${_.fromValue}`).getTime()
             : new Date(_.fromValue).getTime()

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

@@ -484,8 +484,9 @@ export default {
         xDateFormat: '%m/%d',
       }
 
+      let colors = chartTheme&&chartTheme.colorsOptions.reverse();
       this.options = {
-        colors:chartTheme&&chartTheme.colorsOptions.slice(-chartDataHandle.length),
+        colors: colors.slice(-chartDataHandle.length),
         series: seasonData,
         yAxis: seasonYdata,
         xAxis,
@@ -1724,7 +1725,8 @@ export default {
         let markerValue='';
         if(isXDateAxis) {
           //季节图x轴额外拼个年份
-          let nowYear = new Date().getFullYear();
+          let nowYear = ChartType===2 ? new Date(this.dataList[0].DataList[1].DataList
+            [0].DataTimestamp).getFullYear() : '';
           markerValue = ChartType===2 
             ? new Date(`${nowYear}-${_.value}`).getTime()
             : new Date(_.value).getTime()
@@ -1764,7 +1766,8 @@ export default {
         let fromMarkerValue='',toMarkerValue='';
         if(isXDateAxis) {
           //季节图x轴额外拼个年份
-          let nowYear = new Date().getFullYear();
+          let nowYear = ChartType===2 ? new Date(this.dataList[0].DataList[1].DataList
+            [0].DataTimestamp).getFullYear() : '';
           fromMarkerValue = ChartType===2 
             ? new Date(`${nowYear}-${_.fromValue}`).getTime()
             : new Date(_.fromValue).getTime()