Просмотр исходного кода

图表数据视图分页切换页码错误问题/钻取查看列以及导出问题

zhuth 6 лет назад
Родитель
Сommit
eb84881e50
2 измененных файлов с 14 добавлено и 4 удалено
  1. 1 0
      src/components/chartDesigner/content.jsx
  2. 13 4
      src/models/chartDesigner.js

+ 1 - 0
src/components/chartDesigner/content.jsx

@@ -86,6 +86,7 @@ class ChartDesignerContent extends React.Component {
                 styleConfig={styleConfig.dataView}
                 pagination={{
                     simple: false,
+                    current: chartOption.page,
                     pageSize: chartOption.pageSize || 25,
                     total: chartOption.total,
                     showTotal: (total, range) => {

+ 13 - 4
src/models/chartDesigner.js

@@ -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'
                         }, {