|
@@ -14,7 +14,7 @@ export default {
|
|
Source:1,
|
|
Source:1,
|
|
Unit: '',
|
|
Unit: '',
|
|
ChartName: '',
|
|
ChartName: '',
|
|
- Theme: 0,
|
|
|
|
|
|
+ ThemeId: 0,
|
|
SourcesFrom: 'wind,ths',
|
|
SourcesFrom: 'wind,ths',
|
|
SourcesFromVisible: 1,
|
|
SourcesFromVisible: 1,
|
|
Instructions: '图标说明是的货物以带回去五个一给我倭寇的贫困我的卡我极为强劲的的我吉庆街得我',
|
|
Instructions: '图标说明是的货物以带回去五个一给我倭寇的贫困我的卡我极为强劲的的我吉庆街得我',
|
|
@@ -414,14 +414,14 @@ export default {
|
|
|
|
|
|
/* 添加指标时 配置默认颜色 线条等 */
|
|
/* 添加指标时 配置默认颜色 线条等 */
|
|
setAddChartDefault() {
|
|
setAddChartDefault() {
|
|
|
|
+
|
|
|
|
+ let themeOpt = JSON.parse(this.chartInfo.ChartThemeStyle);
|
|
|
|
+
|
|
this.tableData.forEach((item,index) => {
|
|
this.tableData.forEach((item,index) => {
|
|
- item.ChartColor = item.ChartColor || defaultOpts.colors[index];
|
|
|
|
- item.PredictChartColor = item.PredictChartColor || defaultOpts.colors[index];
|
|
|
|
- item.ChartStyle = item.ChartStyle || 'spline';
|
|
|
|
- if (index === 0)
|
|
|
|
- this.tableData[index].ChartWidth = this.tableData[index].ChartWidth || 3;
|
|
|
|
- if (index >= 1)
|
|
|
|
- this.tableData[index].ChartWidth = this.tableData[index].ChartWidth || 1;
|
|
|
|
|
|
+ item.ChartColor = item.ChartColor || themeOpt.colorsOptions[index];
|
|
|
|
+ item.PredictChartColor = item.PredictChartColor || themeOpt.colorsOptions[index];
|
|
|
|
+ item.ChartStyle = item.ChartStyle || (themeOpt.lineOptions.isSpline?'spline':'line');
|
|
|
|
+ this.tableData[index].ChartWidth = this.tableData[index].ChartWidth || themeOpt.lineOptions.lineWidth;
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
@@ -711,26 +711,40 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
- /* 重置指标相关样式 */
|
|
|
|
|
|
+ /* 重置指标相关样式 颜色 粗细 */
|
|
resetChartEdbDefault() {
|
|
resetChartEdbDefault() {
|
|
if(!this.tableData.length) return
|
|
if(!this.tableData.length) return
|
|
|
|
+
|
|
|
|
+ let themeOpt = JSON.parse(this.chartInfo.ChartThemeStyle);
|
|
this.tableData.forEach((item,index) => {
|
|
this.tableData.forEach((item,index) => {
|
|
- item.ChartColor = defaultOpts.colors[index];
|
|
|
|
- item.PredictChartColor = defaultOpts.colors[index];
|
|
|
|
- item.ChartStyle = item.ChartStyle || 'spline';
|
|
|
|
|
|
+ item.ChartColor = themeOpt.colorsOptions[index];
|
|
|
|
+ item.PredictChartColor = themeOpt.colorsOptions[index];
|
|
|
|
+ item.ChartStyle = themeOpt.lineOptions.isSpline?'spline':'line';
|
|
item.isAxis = item.isAxis||1;
|
|
item.isAxis = item.isAxis||1;
|
|
|
|
|
|
- this.tableData[index].ChartWidth = index === 0 ? 3 : 1;
|
|
|
|
|
|
+ this.tableData[index].ChartWidth = themeOpt.lineOptions.lineWidth;
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
/* 获取主题列表 */
|
|
/* 获取主题列表 */
|
|
async getThemeList() {
|
|
async getThemeList() {
|
|
- let res = await chartThemeInterface.getThemeByType({ChartThemeTypeId: this.formData.chartType})
|
|
|
|
|
|
+ let res = await chartThemeInterface.getThemeBySource({ChartType: this.chartInfo.ChartType,Source:1})
|
|
|
|
|
|
if(res.Ret !== 200) return
|
|
if(res.Ret !== 200) return
|
|
this.chartThemeArr = res.Data || []
|
|
this.chartThemeArr = res.Data || []
|
|
- this.chartInfo.ThemeId = res.Data[0].DefaultChartThemeId
|
|
|
|
|
|
+ this.chartInfo.ThemeId = res.Data[0].DefaultChartThemeId;
|
|
|
|
+
|
|
|
|
+ if(!this.chartInfo.ChartThemeStyle) {
|
|
|
|
+ this.chartInfo.ChartThemeStyle = this.chartThemeArr.find(_ => _.ChartThemeId===this.chartInfo.ThemeId).Config
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /* 改变主题时 */
|
|
|
|
+ changeThemeHandle() {
|
|
|
|
+ this.chartInfo.ChartThemeStyle = this.chartThemeArr.find(_ => _.ChartThemeId===this.chartInfo.ThemeId).Config;
|
|
|
|
+ this.resetChartEdbDefault()
|
|
|
|
+
|
|
|
|
+ this.setChartOptionHandle(this.tableData)
|
|
},
|
|
},
|
|
|
|
|
|
/* 更新图表标识区,标识线,图表说明 */
|
|
/* 更新图表标识区,标识线,图表说明 */
|