dtable-statistic 5.0.42-alpha.21 → 5.0.42-alpha.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/utils/export-table-utils.js +18 -14
- package/package.json +1 -1
|
@@ -48,7 +48,6 @@ const exportOneDimensionToTable = _ref => {
|
|
|
48
48
|
let {
|
|
49
49
|
statisticalResult
|
|
50
50
|
} = _ref;
|
|
51
|
-
console.log('exportOneDimensionToTable');
|
|
52
51
|
const {
|
|
53
52
|
pivotResult,
|
|
54
53
|
groupbyColumn,
|
|
@@ -127,6 +126,7 @@ const exportOneDimensionToTable = _ref => {
|
|
|
127
126
|
name: _reactIntlUniversal.default.get('Total'),
|
|
128
127
|
data: columnData
|
|
129
128
|
};
|
|
129
|
+
console.log('totalColumn', totalColumn);
|
|
130
130
|
columns.push(totalColumn);
|
|
131
131
|
|
|
132
132
|
// generator rows
|
|
@@ -163,6 +163,7 @@ const exportOneDimensionToTable = _ref => {
|
|
|
163
163
|
} = item;
|
|
164
164
|
const column = statisticTableColumns.find(column => column.key === key);
|
|
165
165
|
if (column) {
|
|
166
|
+
console.log('column', column);
|
|
166
167
|
const columnName = column.name;
|
|
167
168
|
let columnData;
|
|
168
169
|
let columnType = _dtableUtils.CellType.NUMBER;
|
|
@@ -205,6 +206,18 @@ const exportOneDimensionToTable = _ref => {
|
|
|
205
206
|
}
|
|
206
207
|
});
|
|
207
208
|
|
|
209
|
+
// total column
|
|
210
|
+
const totalColumn = {
|
|
211
|
+
type: _isDateSummaryColumn ? _dtableUtils.CellType.DATE : _dtableUtils.CellType.NUMBER,
|
|
212
|
+
name: _reactIntlUniversal.default.get('Total'),
|
|
213
|
+
// data: columnData,
|
|
214
|
+
data: {
|
|
215
|
+
format: 'number'
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
columnMap[key] = totalColumn;
|
|
219
|
+
columns.push(totalColumn);
|
|
220
|
+
|
|
208
221
|
// generator rows
|
|
209
222
|
pivot_rows.forEach(item => {
|
|
210
223
|
const {
|
|
@@ -236,6 +249,10 @@ const exportOneDimensionToTable = _ref => {
|
|
|
236
249
|
});
|
|
237
250
|
rows.push(newRow);
|
|
238
251
|
});
|
|
252
|
+
console.log(11, {
|
|
253
|
+
columns,
|
|
254
|
+
rows
|
|
255
|
+
});
|
|
239
256
|
return {
|
|
240
257
|
columns,
|
|
241
258
|
rows
|
|
@@ -245,7 +262,6 @@ const exportTwoDimensionToTable = _ref2 => {
|
|
|
245
262
|
let {
|
|
246
263
|
statisticalResult
|
|
247
264
|
} = _ref2;
|
|
248
|
-
console.log('exportTwoDimensionToTable');
|
|
249
265
|
const {
|
|
250
266
|
pivotResult,
|
|
251
267
|
groupbyColumn,
|
|
@@ -469,7 +485,6 @@ const exportTwoDimensionWithSummaryColumnsToTable = _ref4 => {
|
|
|
469
485
|
let {
|
|
470
486
|
statisticalResult
|
|
471
487
|
} = _ref4;
|
|
472
|
-
console.log('exportTwoDimensionWithSummaryColumnsToTable');
|
|
473
488
|
return getTwoDimensionWithSummaryColumns({
|
|
474
489
|
statisticalResult
|
|
475
490
|
});
|
|
@@ -479,8 +494,6 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
479
494
|
updateTable,
|
|
480
495
|
statisticalResult
|
|
481
496
|
} = _ref5;
|
|
482
|
-
console.log('statisticalResult', statisticalResult);
|
|
483
|
-
console.log('updateTable', updateTable);
|
|
484
497
|
const {
|
|
485
498
|
pivotResult,
|
|
486
499
|
groupbyColumn,
|
|
@@ -521,8 +534,6 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
521
534
|
const row = tableRows.find(row => row[nameColumn.key] === groupName);
|
|
522
535
|
const totalColumn = columnMap['total'];
|
|
523
536
|
const sumary_column = columnMap['sumary_column'];
|
|
524
|
-
console.log('totalColumn', totalColumn);
|
|
525
|
-
console.log('sumary_column', sumary_column);
|
|
526
537
|
if (row) {
|
|
527
538
|
// update old row
|
|
528
539
|
let updateRow = {};
|
|
@@ -545,7 +556,6 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
545
556
|
}
|
|
546
557
|
} else {
|
|
547
558
|
// insert new row
|
|
548
|
-
console.log('insertrow');
|
|
549
559
|
let newRow = {};
|
|
550
560
|
newRow[nameColumn.key] = groupName;
|
|
551
561
|
if (totalColumn) {
|
|
@@ -557,12 +567,6 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
557
567
|
newRows.push(newRow);
|
|
558
568
|
}
|
|
559
569
|
});
|
|
560
|
-
console.log(77, {
|
|
561
|
-
newRows,
|
|
562
|
-
updatedRows,
|
|
563
|
-
rowIds,
|
|
564
|
-
oldRows
|
|
565
|
-
});
|
|
566
570
|
return {
|
|
567
571
|
newRows,
|
|
568
572
|
updatedRows,
|