Browse Source

报表导出统计方式名称

zhuth 6 years ago
parent
commit
596ec868f6
1 changed files with 6 additions and 7 deletions
  1. 6 7
      src/models/dashboardDesigner.js

+ 6 - 7
src/models/dashboardDesigner.js

@@ -765,11 +765,11 @@ export default {
                     if(viewType === 'chart') {
                         if(chartType === 'bar' || chartType === 'line') {
                             columns = [{
-                                name: oxAxis.column.label,
+                                name: `${oxAxis.column.label}${oxAxis.granularity.value ? `(${oxAxis.granularity.label})` : ''}`,
                                 width: 150,
                                 type: 'String'
                             }, {
-                                name: oyAxis.column.label,
+                                name: `${oyAxis.column.label}${oyAxis.gauge.value ? `(${oyAxis.gauge.label})` : ''}`,
                                 width: 100,
                                 type: 'Number'
                             }];
@@ -791,11 +791,11 @@ export default {
                             })
                         }else if(chartType === 'pie') {
                             columns = [{
-                                name: oxAxis.column.label,
+                                name: `${oxAxis.column.label}${oxAxis.granularity.value ? `(${oxAxis.granularity.label})` : ''}`,
                                 width: 150,
                                 type: 'String'
                             }, {
-                                name: oyAxis.column.label,
+                                name: `${oyAxis.column.label}${oyAxis.gauge.value ? `(${oyAxis.gauge.label})` : ''}`,
                                 width: 100,
                                 type: 'Number'
                             }];
@@ -806,7 +806,7 @@ export default {
                                 width: 80,
                                 type: 'Number'
                             }, {
-                                name: oyAxis.column.label,
+                                name: `${oyAxis.column.label}${oyAxis.gauge.value ? `(${oyAxis.gauge.label})` : ''}`,
                                 width: 80,
                                 type: 'Number'
                             }];
@@ -887,7 +887,7 @@ export default {
                                 width: 100,
                                 type: 'String'
                             }, {
-                                name: yAxis.column.label,
+                                name: `${yAxis.column.label}${yAxis.gauge.value ? `(${yAxis.gauge.label})` : ''}`,
                                 width: 100,
                                 type: 'Number'
                             }].concat(otherColumn.map(c => ({
@@ -914,7 +914,6 @@ export default {
                         rows
                     });
                 }
-                console.log(sheets)
                 let e = new Exportor({ sheets }, `${name}.xls`);
                 e.export();
             }catch(e) {