|
|
@@ -949,14 +949,22 @@ export default {
|
|
|
const { chartCode, chartType, chartOption, filters } = action;
|
|
|
let columns = [];
|
|
|
let dataSource = [];
|
|
|
+ const TimeType = {
|
|
|
+ year: '年',
|
|
|
+ halfYear: '半年',
|
|
|
+ quarter: '季度',
|
|
|
+ month: '月',
|
|
|
+ week: '周',
|
|
|
+ day: '日',
|
|
|
+ };
|
|
|
switch(chartType) {
|
|
|
case 'bar':
|
|
|
case 'line': {
|
|
|
- const { baseOption } = chartOption;
|
|
|
+ const { baseOption, drillDown } = chartOption;
|
|
|
const { originConfig, xAxis, series } = baseOption;
|
|
|
const { xAxis: oxAxis, yAxis: oyAxis, groupBy: ogroupBy } = originConfig;
|
|
|
columns = [{
|
|
|
- title: `${oxAxis.column.label}${oxAxis.granularity.value ? `(${oxAxis.granularity.label})` : ''}`,
|
|
|
+ title: drillDown && drillDown.length > 0 ? `${drillDown[drillDown.length - 1].label}${drillDown[drillDown.length - 1].type === 'time' && drillDown[drillDown.length - 1].showDataType !== 'day' ? `(${TimeType[drillDown[drillDown.length - 1].showDataType]})` : ''}` : `${oxAxis.column.label}${oxAxis.granularity.value && oxAxis.granularity.value !== 'day' ? `(${oxAxis.granularity.label})` : ''}`,
|
|
|
dataIndex: 'xAxis',
|
|
|
type: 'string'
|
|
|
}, {
|
|
|
@@ -990,11 +998,12 @@ export default {
|
|
|
break;
|
|
|
}
|
|
|
case 'pie': {
|
|
|
- const { baseOption } = chartOption;
|
|
|
+ const { baseOption, drillDown } = chartOption;
|
|
|
const { originConfig, series } = baseOption;
|
|
|
const { xAxis: oxAxis, yAxis: oyAxis } = originConfig;
|
|
|
columns = [{
|
|
|
- title: `${oxAxis.column.label}${oxAxis.granularity.value ? `(${oxAxis.granularity.label})` : ''}`,
|
|
|
+ // title: `${oxAxis.column.label}${oxAxis.granularity.value ? `(${oxAxis.granularity.label})` : ''}`,
|
|
|
+ title: drillDown && drillDown.length > 0 ? `${drillDown[drillDown.length - 1].label}${drillDown[drillDown.length - 1].type === 'time' && drillDown[drillDown.length - 1].showDataType !== 'day' ? `(${TimeType[drillDown[drillDown.length - 1].showDataType]})` : ''}` : `${oxAxis.column.label}${oxAxis.granularity.value && oxAxis.granularity.value !== 'day' ? `(${oxAxis.granularity.label})` : ''}`,
|
|
|
dataIndex: 'xAxis',
|
|
|
type: 'string'
|
|
|
}, {
|