dtable-statistic 5.0.42-alpha.15 → 5.0.42-alpha.17
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 +16 -10
- package/package.json +1 -1
|
@@ -504,6 +504,10 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
504
504
|
// one dimension table no summary columns
|
|
505
505
|
if (pivot_columns.length < 2) {
|
|
506
506
|
columnMap['total'] = (0, _dtableUtils.getTableColumnByName)(updateTable, _reactIntlUniversal.default.get('Total'));
|
|
507
|
+
if (summaryColumn) {
|
|
508
|
+
columnMap['sumary_column'] = (0, _dtableUtils.getTableColumnByName)(updateTable, summaryColumn.name);
|
|
509
|
+
}
|
|
510
|
+
console.log('columnMap', columnMap);
|
|
507
511
|
|
|
508
512
|
// updated rows
|
|
509
513
|
pivot_rows.forEach(item => {
|
|
@@ -515,6 +519,7 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
515
519
|
const groupName = isEmptyName(original_name) ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name;
|
|
516
520
|
const row = tableRows.find(row => row[nameColumn.key] === groupName);
|
|
517
521
|
const totalColumn = columnMap['total'];
|
|
522
|
+
const sumary_column = columnMap['sumary_column'];
|
|
518
523
|
if (row) {
|
|
519
524
|
// update old row
|
|
520
525
|
let updateRow = {};
|
|
@@ -524,14 +529,15 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
524
529
|
updateRow[totalColumn.key] = validTotalCellValue;
|
|
525
530
|
oldRow[totalColumn.key] = row[totalColumn.key];
|
|
526
531
|
}
|
|
527
|
-
const validSummaryCellValue = getValidValueForColumn(
|
|
532
|
+
const validSummaryCellValue = getValidValueForColumn(sumary_column, total.total);
|
|
533
|
+
console.log(22, row);
|
|
528
534
|
console.log(33, validSummaryCellValue);
|
|
529
|
-
console.log(44,
|
|
530
|
-
console.log(55, (0, _cellValue.isCellValueChanged)(row[
|
|
531
|
-
if (
|
|
532
|
-
updateRow[
|
|
533
|
-
oldRow[
|
|
534
|
-
console.log(66, row[
|
|
535
|
+
console.log(44, sumary_column);
|
|
536
|
+
console.log(55, (0, _cellValue.isCellValueChanged)(row[sumary_column.key]));
|
|
537
|
+
if (sumary_column && (0, _cellValue.isCellValueChanged)(row[sumary_column.key], validSummaryCellValue, sumary_column.type)) {
|
|
538
|
+
updateRow[sumary_column.key] = validSummaryCellValue;
|
|
539
|
+
oldRow[sumary_column.key] = row[sumary_column.key];
|
|
540
|
+
console.log(66, row[sumary_column.key]);
|
|
535
541
|
}
|
|
536
542
|
if (Object.keys(updateRow).length > 0) {
|
|
537
543
|
const rowId = row._id;
|
|
@@ -546,13 +552,13 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
546
552
|
if (totalColumn) {
|
|
547
553
|
newRow[totalColumn.key] = getValidValueForColumn(totalColumn, total.total);
|
|
548
554
|
}
|
|
549
|
-
if (
|
|
550
|
-
newRow[
|
|
555
|
+
if (sumary_column) {
|
|
556
|
+
newRow[sumary_column.key] = getValidValueForColumn(sumary_column, total.total);
|
|
551
557
|
}
|
|
552
558
|
newRows.push(newRow);
|
|
553
559
|
}
|
|
554
560
|
});
|
|
555
|
-
console.log(
|
|
561
|
+
console.log(77, {
|
|
556
562
|
newRows,
|
|
557
563
|
updatedRows,
|
|
558
564
|
rowIds,
|