dtable-statistic 5.3.49 → 5.3.51
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 +36 -12
- package/package.json +3 -3
|
@@ -223,11 +223,7 @@ const exportOneDimensionToTable = _ref => {
|
|
|
223
223
|
type: _dtableUtils.CellType.NUMBER,
|
|
224
224
|
name: _reactIntlUniversal.default.get('Total'),
|
|
225
225
|
data: {
|
|
226
|
-
|
|
227
|
-
enable_precision: false,
|
|
228
|
-
format: 'yuan',
|
|
229
|
-
precision: 2,
|
|
230
|
-
thousands: 'no'
|
|
226
|
+
format: 'number'
|
|
231
227
|
}
|
|
232
228
|
};
|
|
233
229
|
columnMap['total'] = totalColumn;
|
|
@@ -650,18 +646,24 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
650
646
|
let newRow = {
|
|
651
647
|
[nameColumn.key]: groupName
|
|
652
648
|
};
|
|
649
|
+
let rowTotal = 0;
|
|
653
650
|
Array.isArray(pivot_columns) && pivot_columns.forEach(item => {
|
|
654
651
|
const {
|
|
655
|
-
key
|
|
656
|
-
method
|
|
652
|
+
key
|
|
657
653
|
} = item;
|
|
658
|
-
const cellValueKey = key
|
|
654
|
+
const cellValueKey = key;
|
|
659
655
|
const column = columnMap[key];
|
|
660
656
|
if (column) {
|
|
661
657
|
const totalCellValue = getValidValueForColumn(column, total[cellValueKey]);
|
|
662
658
|
newRow[column.key] = totalCellValue;
|
|
659
|
+
rowTotal = rowTotal + Number(totalCellValue);
|
|
663
660
|
}
|
|
664
661
|
});
|
|
662
|
+
// total column
|
|
663
|
+
const totalColumn = columnMap['total'];
|
|
664
|
+
if (totalColumn) {
|
|
665
|
+
newRow[totalColumn.key] = rowTotal;
|
|
666
|
+
}
|
|
665
667
|
newRows.push(newRow);
|
|
666
668
|
}
|
|
667
669
|
});
|
|
@@ -773,7 +775,7 @@ const updateTwoDimensionToTable = _ref6 => {
|
|
|
773
775
|
let newRow = {};
|
|
774
776
|
newRow[nameColumnKey] = name;
|
|
775
777
|
if (totalColumn) {
|
|
776
|
-
newRow[totalColumn.key] = getValidValueForColumn(totalColumn,
|
|
778
|
+
newRow[totalColumn.key] = getValidValueForColumn(totalColumn, total);
|
|
777
779
|
}
|
|
778
780
|
Object.keys(cells).forEach(key => {
|
|
779
781
|
const columnName = isEmptyName(key) ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : key;
|
|
@@ -846,7 +848,13 @@ const updateTwoDimensionWithSummaryColumnsToTable = _ref7 => {
|
|
|
846
848
|
name: tableColumnName
|
|
847
849
|
} = tableColumn;
|
|
848
850
|
const existCellValue = existRow[tableColumnKey];
|
|
849
|
-
|
|
851
|
+
let exportingCellValue = exportingRow[tableColumnName];
|
|
852
|
+
if (exportingCellValue === undefined) {
|
|
853
|
+
const matchedKey = Object.keys(exportingRow).find(key => key.includes(`(${tableColumnName})`));
|
|
854
|
+
if (matchedKey !== undefined) {
|
|
855
|
+
exportingCellValue = exportingRow[matchedKey];
|
|
856
|
+
}
|
|
857
|
+
}
|
|
850
858
|
if (tableColumn && (0, _cellValue.isCellValueChanged)(existCellValue, exportingCellValue, tableColumnType)) {
|
|
851
859
|
exportingRowData[tableColumnKey] = exportingCellValue;
|
|
852
860
|
existRowData[tableColumnKey] = existCellValue;
|
|
@@ -859,8 +867,24 @@ const updateTwoDimensionWithSummaryColumnsToTable = _ref7 => {
|
|
|
859
867
|
oldRows[rowId] = existRowData;
|
|
860
868
|
}
|
|
861
869
|
} else {
|
|
862
|
-
|
|
863
|
-
|
|
870
|
+
let newRowData = {};
|
|
871
|
+
tableColumns.forEach(tableColumn => {
|
|
872
|
+
const {
|
|
873
|
+
key: tableColumnKey,
|
|
874
|
+
name: tableColumnName
|
|
875
|
+
} = tableColumn;
|
|
876
|
+
let exportingCellValue = exportingRow[tableColumnName];
|
|
877
|
+
if (exportingCellValue === undefined) {
|
|
878
|
+
const matchedKey = Object.keys(exportingRow).find(key => key.includes(`(${tableColumnName})`));
|
|
879
|
+
if (matchedKey !== undefined) {
|
|
880
|
+
exportingCellValue = exportingRow[matchedKey];
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
if (exportingCellValue !== undefined && exportingCellValue !== null) {
|
|
884
|
+
newRowData[tableColumnKey] = exportingCellValue;
|
|
885
|
+
}
|
|
886
|
+
});
|
|
887
|
+
newRows.push(newRowData);
|
|
864
888
|
}
|
|
865
889
|
});
|
|
866
890
|
return {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.3.
|
|
2
|
+
"version": "5.3.51",
|
|
3
3
|
"name": "dtable-statistic",
|
|
4
4
|
"description": "statistics",
|
|
5
5
|
"main": "dist/dtable-statistic.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"react-grid-layout": "^1.2.5",
|
|
17
17
|
"react-intl-universal": "^2.4.8",
|
|
18
18
|
"reactstrap": "9.2.3",
|
|
19
|
-
"sea-chart": "^1.1.
|
|
19
|
+
"sea-chart": "^1.1.134"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"dtable-ui-component": "~6.0.*",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"dotenv": "^10.0.0",
|
|
51
51
|
"dotenv-expand": "^5.1.0",
|
|
52
52
|
"dtable-store": "^6.2.7",
|
|
53
|
-
"dtable-ui-component": "^6.0.
|
|
53
|
+
"dtable-ui-component": "^6.0.123",
|
|
54
54
|
"dtable-utils": "^5.0.23",
|
|
55
55
|
"eslint": "^8.3.0",
|
|
56
56
|
"eslint-config-react-app": "^7.0.1",
|