dtable-statistic 5.0.42-alpha.10 → 5.0.42-alpha.11
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.
|
@@ -113,7 +113,6 @@ const exportOneDimensionToTable = _ref => {
|
|
|
113
113
|
|
|
114
114
|
// count column
|
|
115
115
|
if (summaryColumn) {
|
|
116
|
-
console.log('columnData', columnData);
|
|
117
116
|
const countColumn = {
|
|
118
117
|
type: _isDateSummaryColumn ? _dtableUtils.CellType.DATE : _dtableUtils.CellType.NUMBER,
|
|
119
118
|
name: summaryColumn === null || summaryColumn === void 0 ? void 0 : summaryColumn.name,
|
|
@@ -151,25 +150,18 @@ const exportOneDimensionToTable = _ref => {
|
|
|
151
150
|
}
|
|
152
151
|
rows.push(newRow);
|
|
153
152
|
});
|
|
154
|
-
console.log(11, {
|
|
155
|
-
columns,
|
|
156
|
-
rows
|
|
157
|
-
});
|
|
158
153
|
return {
|
|
159
154
|
columns,
|
|
160
155
|
rows
|
|
161
156
|
};
|
|
162
157
|
}
|
|
163
|
-
|
|
164
|
-
console.log('statisticTableColumns', statisticTableColumns);
|
|
158
|
+
|
|
165
159
|
// one dimension table with number columns
|
|
166
160
|
Array.isArray(pivot_columns) && pivot_columns.forEach(item => {
|
|
167
161
|
const {
|
|
168
162
|
key
|
|
169
163
|
} = item;
|
|
170
|
-
console.log('item', item);
|
|
171
164
|
const column = statisticTableColumns.find(column => column.key === key);
|
|
172
|
-
console.log('column', column);
|
|
173
165
|
if (column) {
|
|
174
166
|
const columnName = column.name;
|
|
175
167
|
let columnData;
|
|
@@ -212,7 +204,7 @@ const exportOneDimensionToTable = _ref => {
|
|
|
212
204
|
columns.push(newColumn);
|
|
213
205
|
}
|
|
214
206
|
});
|
|
215
|
-
|
|
207
|
+
|
|
216
208
|
// generator rows
|
|
217
209
|
pivot_rows.forEach(item => {
|
|
218
210
|
const {
|
|
@@ -242,10 +234,8 @@ const exportOneDimensionToTable = _ref => {
|
|
|
242
234
|
}
|
|
243
235
|
newRow[name] = cellValue;
|
|
244
236
|
});
|
|
245
|
-
console.log('newRow', newRow);
|
|
246
237
|
rows.push(newRow);
|
|
247
238
|
});
|
|
248
|
-
console.log('rows', rows);
|
|
249
239
|
return {
|
|
250
240
|
columns,
|
|
251
241
|
rows
|
|
@@ -524,6 +514,8 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
524
514
|
const groupName = isEmptyName(original_name) ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name;
|
|
525
515
|
const row = tableRows.find(row => row[nameColumn.key] === groupName);
|
|
526
516
|
const totalColumn = columnMap['total'];
|
|
517
|
+
console.log('updateTable', updateTable);
|
|
518
|
+
console.log('row', row);
|
|
527
519
|
if (row) {
|
|
528
520
|
// update old row
|
|
529
521
|
let updateRow = {};
|
|
@@ -533,6 +525,10 @@ const updatedOneDimensionToTable = _ref5 => {
|
|
|
533
525
|
updateRow[totalColumn.key] = validTotalCellValue;
|
|
534
526
|
oldRow[totalColumn.key] = row[totalColumn.key];
|
|
535
527
|
}
|
|
528
|
+
if (totalColumn && (0, _cellValue.isCellValueChanged)(row[totalColumn.key], validTotalCellValue, totalColumn.type)) {
|
|
529
|
+
updateRow[totalColumn.key] = validTotalCellValue;
|
|
530
|
+
oldRow[totalColumn.key] = row[totalColumn.key];
|
|
531
|
+
}
|
|
536
532
|
if (Object.keys(updateRow).length > 0) {
|
|
537
533
|
const rowId = row._id;
|
|
538
534
|
rowIds.push(rowId);
|