|
|
@@ -121,6 +121,7 @@ export default {
|
|
|
console.log('请求图表列表', res);
|
|
|
if(!res.err && res.data.code > 0) {
|
|
|
let list = res.data.data.map(d => {
|
|
|
+ let chartOption = d.chartOption ? JSON.parse(d.chartOption) : {};
|
|
|
return {
|
|
|
code: d.chartId+'',
|
|
|
name: d.chartName,
|
|
|
@@ -128,7 +129,8 @@ export default {
|
|
|
creator: d.createBy,
|
|
|
createTime: d.createDate,
|
|
|
description: d.describes || '',
|
|
|
- groupCode: d.chartsGroup + ''
|
|
|
+ groupCode: d.chartsGroup + '',
|
|
|
+ chartOption: chartOption
|
|
|
}
|
|
|
})
|
|
|
yield put({ type: 'list', list: list });
|
|
|
@@ -176,6 +178,7 @@ export default {
|
|
|
let otherConfig = JSON.parse(resData.otherConfig || '{}');
|
|
|
let viewType = getViewType(resData.chartType);
|
|
|
let filters = JSON.parse(resData.filters || '[]');
|
|
|
+ let chartOption = JSON.parse(resData.chartOption || '{}');
|
|
|
|
|
|
let data = {
|
|
|
code: resData.chartId,
|
|
|
@@ -190,6 +193,7 @@ export default {
|
|
|
description: resData.describes,
|
|
|
group: resData.chartsGroup+'',
|
|
|
filters: filters,
|
|
|
+ chartOption: chartOption
|
|
|
}
|
|
|
|
|
|
if(viewType === 'bar') {
|
|
|
@@ -252,7 +256,7 @@ export default {
|
|
|
try{
|
|
|
const chartDesigner = yield select(state => state.present.chartDesigner);
|
|
|
const { header, baseConfig, pieConfig, lineConfig, aggregateTableConfig, dataViewConfig,
|
|
|
- barConfig, scatterConfig, otherConfig, description, group } = chartDesigner;
|
|
|
+ barConfig, scatterConfig, otherConfig, description, group, filters, chartOption } = chartDesigner;
|
|
|
let body = {
|
|
|
chartName: header.label,
|
|
|
dataId: baseConfig.dataSource,
|
|
|
@@ -260,7 +264,9 @@ export default {
|
|
|
describes: description,
|
|
|
style: '',
|
|
|
otherConfig: JSON.stringify(otherConfig),
|
|
|
- chartsGroup: group ? group : '-1'
|
|
|
+ chartsGroup: group ? group : '-1',
|
|
|
+ filters: JSON.stringify(filters),
|
|
|
+ chartOption: JSON.stringify(chartOption),
|
|
|
}; // 基本属性
|
|
|
if(baseConfig.viewType === 'bar') {
|
|
|
body.chartType = 'Histogram';
|
|
|
@@ -322,17 +328,18 @@ export default {
|
|
|
try{
|
|
|
const chartDesigner = yield select(state => state.present.chartDesigner);
|
|
|
const { filters, code, header, baseConfig, pieConfig, lineConfig, aggregateTableConfig, dataViewConfig,
|
|
|
- barConfig, scatterConfig, otherConfig, description, group } = chartDesigner;
|
|
|
+ barConfig, scatterConfig, otherConfig, description, group, chartOption } = chartDesigner;
|
|
|
let body = {
|
|
|
chartId: code,
|
|
|
filters: JSON.stringify(filters),
|
|
|
chartName: header.label,
|
|
|
dataId: baseConfig.dataSource,
|
|
|
createBy: 'zhuth',
|
|
|
- describes: description,
|
|
|
+ describes: description || '',
|
|
|
style: '',
|
|
|
otherConfig: JSON.stringify(otherConfig),
|
|
|
- chartsGroup: group ? group : '-1'
|
|
|
+ chartsGroup: group+'' ? group : '-1',
|
|
|
+ chartOption: JSON.stringify(chartOption)
|
|
|
}; // 基本属性
|
|
|
if(baseConfig.viewType === 'bar') {
|
|
|
body.chartType = 'Histogram';
|