|
@@ -306,7 +306,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
//默认来源搞一下
|
|
|
- this.setDefaultSourceFrom(ChartInfo);
|
|
|
+ this.setDefaultSourceFrom();
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -592,7 +592,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
//默认来源搞一下
|
|
|
- this.setDefaultSourceFrom(ChartInfo);
|
|
|
+ this.setDefaultSourceFrom();
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -761,6 +761,7 @@ export default {
|
|
|
|
|
|
this.tableData[index].ChartWidth = themeOpt.lineOptions.lineWidth;
|
|
|
})
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/* 获取主题列表 type init时重新设置默认样式和主题*/
|
|
@@ -781,14 +782,66 @@ export default {
|
|
|
/* 改变主题时 */
|
|
|
changeThemeHandle() {
|
|
|
this.chartInfo.ChartThemeStyle = this.chartThemeArr.find(_ => _.ChartThemeId===this.chartInfo.ChartThemeId).Config;
|
|
|
- this.resetChartEdbDefault()
|
|
|
-
|
|
|
+
|
|
|
+ //重置指标样式
|
|
|
+ this.resetChartEdbDefault();
|
|
|
+
|
|
|
+ //重置标识线区来源样式
|
|
|
+ this.resetMarkerThemeStyle();
|
|
|
+
|
|
|
this.reLoadChartOption();
|
|
|
},
|
|
|
|
|
|
+ //切换主题重置标示线,区,来源,说明等配置样式
|
|
|
+ resetMarkerThemeStyle() {
|
|
|
+ let themeOpt = JSON.parse(this.chartInfo.ChartThemeStyle);
|
|
|
+
|
|
|
+ if(this.chartInfo.Instructions) {
|
|
|
+ let instructionObj = JSON.parse(_.cloneDeep(this.chartInfo.Instructions))
|
|
|
+ this.chartInfo.Instructions = JSON.stringify({
|
|
|
+ ...instructionObj,
|
|
|
+ color: themeOpt.markerOptions.style.color,
|
|
|
+ fontSize: themeOpt.markerOptions.style.fontSize,
|
|
|
+ })
|
|
|
+
|
|
|
+ this.$refs.markerSectionRef&&this.$refs.markerSectionRef.initData(this.chartInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.chartInfo.SourcesFrom) {
|
|
|
+ let sourceObj = JSON.parse(_.cloneDeep(this.chartInfo.SourcesFrom))
|
|
|
+ this.chartInfo.SourcesFrom = JSON.stringify({
|
|
|
+ ...sourceObj,
|
|
|
+ color: themeOpt.markerOptions.style.color,
|
|
|
+ fontSize: themeOpt.markerOptions.style.fontSize,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.chartInfo.MarkersLines&&JSON.parse(this.chartInfo.MarkersLines).length) {
|
|
|
+ let markerLines = JSON.parse(_.cloneDeep(this.chartInfo.MarkersLines))
|
|
|
+ this.chartInfo.MarkersLines = JSON.stringify(markerLines.map(_ => ({
|
|
|
+ ..._,
|
|
|
+ textColor: themeOpt.markerOptions.style.color,
|
|
|
+ textFontSize: themeOpt.markerOptions.style.fontSize,
|
|
|
+ })))
|
|
|
+
|
|
|
+ this.$refs.markerSectionRef&&this.$refs.markerSectionRef.initData(this.chartInfo);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.chartInfo.MarkersAreas&&JSON.parse(this.chartInfo.MarkersAreas).length) {
|
|
|
+ let markerAreas = JSON.parse(_.cloneDeep(this.chartInfo.MarkersAreas))
|
|
|
+ this.chartInfo.MarkersAreas = JSON.stringify(markerAreas.map(_ => ({
|
|
|
+ ..._,
|
|
|
+ textColor: themeOpt.markerOptions.style.color,
|
|
|
+ textFontSize: themeOpt.markerOptions.style.fontSize,
|
|
|
+ })))
|
|
|
+
|
|
|
+ this.$refs.markerSectionRef&&this.$refs.markerSectionRef.initData(this.chartInfo);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
/* 更新图表标识区,标识线,图表说明 */
|
|
|
setChartMarkerInfo({ markerLinesArr,markerAreasArr,chartInstruction }) {
|
|
|
- this.chartInfo.MarkersLines = JSON.stringify (markerLinesArr);
|
|
|
+ this.chartInfo.MarkersLines = JSON.stringify(markerLinesArr);
|
|
|
this.chartInfo.MarkersAreas = JSON.stringify(markerAreasArr);
|
|
|
this.chartInfo.Instructions = JSON.stringify(chartInstruction);
|
|
|
|
|
@@ -808,18 +861,6 @@ 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({
|