|
|
@@ -105,89 +105,6 @@ export default {
|
|
|
obj[name] = value;
|
|
|
let newState = Object.assign({}, state, obj);
|
|
|
return newState;
|
|
|
- },
|
|
|
- /**
|
|
|
- * 个体统计数据表选项-分析目标
|
|
|
- */
|
|
|
- 'dataView/setTargetColumn'(state, action) {
|
|
|
- const dataView = state.dataView;
|
|
|
- let newDataView = Object.assign({}, dataView, {
|
|
|
- targetColumn: action.targetColumn
|
|
|
- });
|
|
|
- let newState = Object.assign({}, state, {
|
|
|
- dataView: newDataView
|
|
|
- });
|
|
|
- return newState;
|
|
|
- },
|
|
|
- /**
|
|
|
- * 柱状图设置-设置横轴
|
|
|
- */
|
|
|
- 'barConfig/setXAxis'(state, action) {
|
|
|
- const barConfig = state.barConfig;
|
|
|
- let newBarConfig = Object.assign({}, barConfig, {
|
|
|
- xAxis: action.xAxis
|
|
|
- });
|
|
|
- let newState = Object.assign({}, state, {
|
|
|
- barConfig: newBarConfig
|
|
|
- });
|
|
|
- return newState;
|
|
|
- },
|
|
|
- /**
|
|
|
- * 柱状图设置-设置纵轴
|
|
|
- */
|
|
|
- 'barConfig/setYAxis'(state, action) {
|
|
|
- const barConfig = state.barConfig;
|
|
|
- let newBarConfig = Object.assign({}, barConfig, {
|
|
|
- yAxis: action.yAxis
|
|
|
- });
|
|
|
- let newState = Object.assign({}, state, {
|
|
|
- barConfig: newBarConfig
|
|
|
- });
|
|
|
- return newState;
|
|
|
- },
|
|
|
- /**
|
|
|
- * 个体统计数据表选项-分析目标
|
|
|
- */
|
|
|
- 'dataView/setTargetColumn'(state, action) {
|
|
|
- const dataView = state.dataView;
|
|
|
- let newDataView = Object.assign({}, dataView, {
|
|
|
- targetColumn: action.targetColumn
|
|
|
- });
|
|
|
- let newState = Object.assign({}, state, {
|
|
|
- dataView: newDataView
|
|
|
- });
|
|
|
- return newState;
|
|
|
- },
|
|
|
- /**
|
|
|
- * 数据预处理-分组
|
|
|
- */
|
|
|
- 'preparing/setGroupBy'(state, action) {
|
|
|
- let newState = Object.assign({}, state, {
|
|
|
- preparing: {
|
|
|
- groupBy: action.groupBy
|
|
|
- }
|
|
|
- });
|
|
|
- return newState;
|
|
|
- },
|
|
|
- /**
|
|
|
- * 过滤规则-生成过滤规则
|
|
|
- */
|
|
|
- 'filters/createFilters'(state, action) {
|
|
|
- return { ...state, filters: action.filters};
|
|
|
- },
|
|
|
- /**
|
|
|
- * 过滤规则-启用/反启用
|
|
|
- */
|
|
|
- 'filters/setUsing'(state, action) {
|
|
|
- return { ...state, ...{ filters: state.filters.map( f => {
|
|
|
- if(f.key == action.key) {
|
|
|
- f = Object.assign({}, f, { using: !f.using });
|
|
|
- }
|
|
|
- return f;
|
|
|
- }) } };
|
|
|
- },
|
|
|
- setOption(state, action) {
|
|
|
- return { ...state, ...{ chartOption: action.chartOption } };
|
|
|
}
|
|
|
},
|
|
|
effects: {
|
|
|
@@ -199,7 +116,7 @@ export default {
|
|
|
body: {
|
|
|
"tableName": "TEST_BI_DATA",
|
|
|
"groups": preparing.groupBy.map(g => g.key),
|
|
|
- "xAxis": barConfig.xAxis.key,
|
|
|
+ "xAxis": barConfig.xAxis.column.value,
|
|
|
"yAxis": barConfig.yAxis.column.value,
|
|
|
"dataType": barConfig.yAxis.gauge.value
|
|
|
}
|
|
|
@@ -210,13 +127,13 @@ export default {
|
|
|
body: {
|
|
|
"tableName": "TEST_BI_DATA",
|
|
|
"groups": preparing.groupBy.map(g => g.key),
|
|
|
- "xAxis": barConfig.xAxis.key,
|
|
|
+ "xAxis": barConfig.xAxis.column.value,
|
|
|
"yAxis": barConfig.yAxis.column.value,
|
|
|
"dataType": barConfig.yAxis.gauge.value
|
|
|
}
|
|
|
})
|
|
|
res.viewType = 'bar';
|
|
|
- res.data.data.xTitle = barConfig.xAxis?barConfig.xAxis.label:null
|
|
|
+ res.data.data.xTitle = barConfig.xAxis?barConfig.xAxis.column.label:null
|
|
|
res.data.data.yTitle = barConfig.yAxis?barConfig.yAxis.column.label:null;
|
|
|
res.data.data.gauge = barConfig.yAxis?barConfig.yAxis.gauge.label:null;
|
|
|
console.log(res);
|