|
@@ -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({
|