|
|
@@ -57,7 +57,8 @@ export default {
|
|
|
lineConfig: { xAxis: { column: {}, granularity: {} }, yAxis: { column: {}, gauge: {} }, groupBy: {key:''}, threshold: 1000 },
|
|
|
pieConfig: { xAxis: { column: {}, granularity: {} }, yAxis: { column: {}, gauge: {} }, threshold: 20 },
|
|
|
scatterConfig: { xAxis: { column: {}, granularity: {} }, yAxis: { column: {}, gauge: {} }, groupBy: {key:''}, threshold: 1000 },
|
|
|
- styleConfig: { bar: { backgroundColor: '#ffffff' } },
|
|
|
+ theme: 'default',
|
|
|
+ styleConfig: { bar: {}, line: {}, pie: {}, scatter: {} },
|
|
|
otherConfig:{},
|
|
|
description: '',
|
|
|
filters: [],
|
|
|
@@ -337,7 +338,7 @@ export default {
|
|
|
*fetchBarData(action, { select, call, put }) {
|
|
|
try {
|
|
|
const chartDesigner = yield select(state => state.present.chartDesigner);
|
|
|
- const { code, barConfig, filters } = chartDesigner;
|
|
|
+ const { code, barConfig, filters, theme, styleConfig } = chartDesigner;
|
|
|
const body = {
|
|
|
id: code,
|
|
|
groups: barConfig.groupBy && barConfig.groupBy.key ? [barConfig.groupBy.key] : [],
|
|
|
@@ -360,7 +361,7 @@ export default {
|
|
|
timeout: 30000
|
|
|
});
|
|
|
if(!res.err && res.data.code > 0) {
|
|
|
- let option = parseChartOption('bar', res.data.data, barConfig);
|
|
|
+ let option = parseChartOption('bar', res.data.data, barConfig, theme, styleConfig.bar);
|
|
|
yield put({ type: 'silentSetField', name: 'chartOption', value: option });
|
|
|
}else {
|
|
|
message.error('请求柱状图数据失败: ' + (res.err || res.data.msg));
|
|
|
@@ -375,7 +376,7 @@ export default {
|
|
|
*fetchPieData(action, { select, call, put }) {
|
|
|
try {
|
|
|
const chartDesigner = yield select(state => state.present.chartDesigner);
|
|
|
- const { code, pieConfig, filters } = chartDesigner;
|
|
|
+ const { code, pieConfig, filters, theme, styleConfig } = chartDesigner;
|
|
|
const body = {
|
|
|
id: code,
|
|
|
legendData: {
|
|
|
@@ -398,7 +399,7 @@ export default {
|
|
|
timeout: 30000
|
|
|
});
|
|
|
if(!res.err && res.data.code > 0) {
|
|
|
- let option = parseChartOption('pie', res.data.data, pieConfig);
|
|
|
+ let option = parseChartOption('pie', res.data.data, pieConfig, theme, styleConfig.pie);
|
|
|
yield put({ type: 'silentSetField', name: 'chartOption', value: option });
|
|
|
}else {
|
|
|
message.error('请求饼图数据失败: ' + (res.err || res.data.msg));
|
|
|
@@ -413,7 +414,7 @@ export default {
|
|
|
*fetchLineData(action, { select, call, put }) {
|
|
|
try {
|
|
|
const chartDesigner = yield select(state => state.present.chartDesigner);
|
|
|
- const { code, lineConfig, filters } = chartDesigner;
|
|
|
+ const { code, lineConfig, filters, theme, styleConfig } = chartDesigner;
|
|
|
const body = {
|
|
|
id: code,
|
|
|
xAxis: {
|
|
|
@@ -435,7 +436,7 @@ export default {
|
|
|
timeout: 30000
|
|
|
});
|
|
|
if(!res.err && res.data.code > 0) {
|
|
|
- let option = parseChartOption('line', res.data.data, lineConfig);
|
|
|
+ let option = parseChartOption('line', res.data.data, lineConfig, theme, styleConfig.line);
|
|
|
yield put({ type: 'silentSetField', name: 'chartOption', value: option });
|
|
|
}else {
|
|
|
message.error('请求折线图数据失败: ' + (res.err || res.data.msg));
|
|
|
@@ -450,7 +451,7 @@ export default {
|
|
|
*fetchScatterData(action, { select, call, put }) {
|
|
|
try {
|
|
|
const chartDesigner = yield select(state => state.present.chartDesigner);
|
|
|
- const { code, scatterConfig, filters } = chartDesigner;
|
|
|
+ const { code, scatterConfig, filters, theme, styleConfig } = chartDesigner;
|
|
|
const body = {
|
|
|
id: code,
|
|
|
xAxis: {
|
|
|
@@ -472,7 +473,7 @@ export default {
|
|
|
timeout: 30000
|
|
|
});
|
|
|
if(!res.err && res.data.code > 0) {
|
|
|
- let option = parseChartOption('scatter', res.data.data, scatterConfig);
|
|
|
+ let option = parseChartOption('scatter', res.data.data, scatterConfig, theme, styleConfig.scatter);
|
|
|
yield put({ type: 'silentSetField', name: 'chartOption', value: option });
|
|
|
}else {
|
|
|
message.error('请求散点图数据失败: ' + (res.err || res.data.msg));
|
|
|
@@ -487,7 +488,7 @@ export default {
|
|
|
*fetchDataViewData(action, { select, call, put }) {
|
|
|
try {
|
|
|
const chartDesigner = yield select(state => state.present.chartDesigner);
|
|
|
- const { code, dataViewConfig, filters } = chartDesigner;
|
|
|
+ const { code, dataViewConfig, filters, theme, styleConfig } = chartDesigner;
|
|
|
const { page, pageSize } = action;
|
|
|
const body = {
|
|
|
id: code,
|
|
|
@@ -507,7 +508,7 @@ export default {
|
|
|
timeout: 30000
|
|
|
});
|
|
|
if(!res.err && res.data.code > 0) {
|
|
|
- let option = parseChartOption('dataView', res.data.data, dataViewConfig);
|
|
|
+ let option = parseChartOption('dataView', res.data.data, dataViewConfig, theme, styleConfig.dataView);
|
|
|
yield put({ type: 'silentSetField', name: 'chartOption', value: option });
|
|
|
}else {
|
|
|
message.error('请求列表数据失败: ' + (res.err || res.data.msg));
|
|
|
@@ -522,7 +523,7 @@ export default {
|
|
|
*fetchAggregateTableData(action, { select, call, put }) {
|
|
|
try {
|
|
|
const chartDesigner = yield select(state => state.present.chartDesigner);
|
|
|
- const { code, aggregateTableConfig, filters } = chartDesigner;
|
|
|
+ const { code, aggregateTableConfig, filters, theme, styleConfig } = chartDesigner;
|
|
|
const { targetColumn, statistics } = aggregateTableConfig;
|
|
|
|
|
|
const body = {
|
|
|
@@ -543,7 +544,7 @@ export default {
|
|
|
timeout: 30000
|
|
|
});
|
|
|
if(!res.err && res.data.code > 0) {
|
|
|
- let option = parseChartOption('aggregateTable', res.data.data, aggregateTableConfig);
|
|
|
+ let option = parseChartOption('aggregateTable', res.data.data, aggregateTableConfig, theme, styleConfig.aggregateTable);
|
|
|
yield put({ type: 'silentSetField', name: 'chartOption', value: option });
|
|
|
}else {
|
|
|
message.error('请求统计数据失败: ' + (res.err || res.data.msg));
|