dtable-statistic 5.0.42-alpha.11 → 5.0.42-alpha.13
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.
|
@@ -482,7 +482,8 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
482
482
|
const {
|
|
483
483
|
pivotResult,
|
|
484
484
|
groupbyColumn,
|
|
485
|
-
statisticTableColumns
|
|
485
|
+
statisticTableColumns,
|
|
486
|
+
summaryColumn
|
|
486
487
|
} = statisticalResult;
|
|
487
488
|
if (!groupbyColumn) return {};
|
|
488
489
|
const nameColumn = (0, _dtableUtils.getTableColumnByName)(updateTable, groupbyColumn.name);
|
|
@@ -516,6 +517,7 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
516
517
|
const totalColumn = columnMap['total'];
|
|
517
518
|
console.log('updateTable', updateTable);
|
|
518
519
|
console.log('row', row);
|
|
520
|
+
console.log('totalColumn', totalColumn);
|
|
519
521
|
if (row) {
|
|
520
522
|
// update old row
|
|
521
523
|
let updateRow = {};
|
|
@@ -525,9 +527,10 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
525
527
|
updateRow[totalColumn.key] = validTotalCellValue;
|
|
526
528
|
oldRow[totalColumn.key] = row[totalColumn.key];
|
|
527
529
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
530
|
+
const validSummaryCellValue = getValidValueForColumn(summaryColumn, total.total);
|
|
531
|
+
if (summaryColumn && (0, _cellValue.isCellValueChanged)(row[summaryColumn.key], validSummaryCellValue, summaryColumn.type)) {
|
|
532
|
+
updateRow[summaryColumn.key] = validSummaryCellValue;
|
|
533
|
+
oldRow[summaryColumn.key] = row[summaryColumn.key];
|
|
531
534
|
}
|
|
532
535
|
if (Object.keys(updateRow).length > 0) {
|
|
533
536
|
const rowId = row._id;
|
|
@@ -542,6 +545,9 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
542
545
|
if (totalColumn) {
|
|
543
546
|
newRow[totalColumn.key] = getValidValueForColumn(totalColumn, total.total);
|
|
544
547
|
}
|
|
548
|
+
if (summaryColumn) {
|
|
549
|
+
newRow[summaryColumn.key] = getValidValueForColumn(summaryColumn, total.total);
|
|
550
|
+
}
|
|
545
551
|
newRows.push(newRow);
|
|
546
552
|
}
|
|
547
553
|
});
|