dtable-statistic 5.0.38-alpha.2 → 5.0.39
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.
|
@@ -22,8 +22,9 @@ const isSummaryDateColumn = summaryColumn => {
|
|
|
22
22
|
return type !== _dtableUtils.CellType.LINK && (0, _dtableUtils.isDateColumn)(summaryColumn);
|
|
23
23
|
};
|
|
24
24
|
const getValidValueForColumn = (column, value) => {
|
|
25
|
-
value = Array.isArray(value) && value.length !== 0 ? value[0][1] : value;
|
|
26
25
|
if (!column) return '';
|
|
26
|
+
// Summarize multiple columns
|
|
27
|
+
value = Array.isArray(value) && value.length !== 0 ? value[0][1] : value;
|
|
27
28
|
const {
|
|
28
29
|
type,
|
|
29
30
|
data
|
|
@@ -607,7 +608,6 @@ const updateTwoDimensionToTable = _ref6 => {
|
|
|
607
608
|
updateTable,
|
|
608
609
|
statisticalResult
|
|
609
610
|
} = _ref6;
|
|
610
|
-
console.log('updateTwoDimensionToTable');
|
|
611
611
|
const {
|
|
612
612
|
pivotResult,
|
|
613
613
|
groupbyColumn
|
|
@@ -662,20 +662,16 @@ const updateTwoDimensionToTable = _ref6 => {
|
|
|
662
662
|
const totalColumn = columnMap['total'];
|
|
663
663
|
if (row) {
|
|
664
664
|
// update old row
|
|
665
|
-
console.log(11);
|
|
666
665
|
const rowId = row._id;
|
|
667
666
|
let updatedRow = {};
|
|
668
667
|
let oldRow = {}; // op used
|
|
669
668
|
const validTotalCellValue = getValidValueForColumn(totalColumn, total);
|
|
670
|
-
console.log('22validTotalCellValue', validTotalCellValue);
|
|
671
669
|
if (totalColumn && (0, _cellValue.isCellValueChanged)(row[totalColumn.key], validTotalCellValue, totalColumn.type)) {
|
|
672
|
-
console.log('33', validTotalCellValue);
|
|
673
670
|
updatedRow[totalColumn.key] = validTotalCellValue;
|
|
674
671
|
oldRow[totalColumn.key] = row[totalColumn.key];
|
|
675
672
|
}
|
|
676
673
|
const keys = Object.keys(cells);
|
|
677
674
|
if (keys.length === 0) {
|
|
678
|
-
console.log('44', updateColumns);
|
|
679
675
|
updateColumns.forEach(column => {
|
|
680
676
|
const {
|
|
681
677
|
key,
|
|
@@ -688,12 +684,10 @@ const updateTwoDimensionToTable = _ref6 => {
|
|
|
688
684
|
}
|
|
689
685
|
});
|
|
690
686
|
} else {
|
|
691
|
-
console.log('55', cells);
|
|
692
687
|
keys.forEach(key => {
|
|
693
688
|
const columnName = isEmptyName(key) ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : key;
|
|
694
689
|
const column = columnMap[columnName];
|
|
695
690
|
let validCellValue = getValidValueForColumn(column, cells[key].total);
|
|
696
|
-
console.log('66', validCellValue);
|
|
697
691
|
if (column && (0, _cellValue.isCellValueChanged)(row[column.key], validCellValue, column.type)) {
|
|
698
692
|
updatedRow[column.key] = validCellValue;
|
|
699
693
|
oldRow[column.key] = row[column.key];
|
|
@@ -736,7 +730,6 @@ const updateTwoDimensionWithSummaryColumnsToTable = _ref7 => {
|
|
|
736
730
|
updateTable,
|
|
737
731
|
statisticalResult
|
|
738
732
|
} = _ref7;
|
|
739
|
-
console.log('updateTwoDimensionWithSummaryColumnsToTable');
|
|
740
733
|
const {
|
|
741
734
|
groupbyColumn
|
|
742
735
|
} = statisticalResult;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dtable-statistic",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.39",
|
|
4
4
|
"description": "statistics",
|
|
5
5
|
"main": "dist/dtable-statistic.js",
|
|
6
6
|
"author": "seafile",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"react-grid-layout": "^1.2.5",
|
|
19
19
|
"react-intl-universal": "^2.4.8",
|
|
20
20
|
"reactstrap": "8.9.0",
|
|
21
|
-
"sea-chart": "~0.0.
|
|
21
|
+
"sea-chart": "~0.0.85"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"dtable-ui-component": "~5.0.*",
|