dtable-statistic 5.0.42-alpha.26 → 5.0.42-alpha.28

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.
@@ -252,14 +252,10 @@ const exportOneDimensionToTable = _ref => {
252
252
  newRow[name] = cellValue;
253
253
  rowTotal = rowTotal + Number(cellValue);
254
254
  });
255
- console.log('rowTotal', rowTotal);
256
- console.log('newRow', newRow);
255
+ // total row
257
256
  newRow[_reactIntlUniversal.default.get('Total')] = rowTotal;
258
257
  rows.push(newRow);
259
258
  });
260
-
261
- // total row
262
-
263
259
  console.log(11, {
264
260
  columns,
265
261
  rows
@@ -612,10 +608,10 @@ const updatedOneDimensionToTable = _ref5 => {
612
608
  if (row) {
613
609
  let updateRow = {};
614
610
  let oldRow = {};
611
+ let rowTotal = 0;
615
612
  Array.isArray(pivot_columns) && pivot_columns.forEach(item => {
616
613
  const {
617
- key,
618
- method
614
+ key
619
615
  } = item;
620
616
  const column = columnMap[key];
621
617
  const cellValueKey = key;
@@ -623,9 +619,18 @@ const updatedOneDimensionToTable = _ref5 => {
623
619
  if (column && (0, _cellValue.isCellValueChanged)(row[column.key], totalCellValue, column.type)) {
624
620
  updateRow[column.key] = totalCellValue;
625
621
  oldRow[column.key] = row[column.key];
622
+ rowTotal = rowTotal + Number(totalCellValue);
626
623
  }
627
624
  });
625
+
626
+ // total column
627
+ console.log('rowTotal', rowTotal);
628
+ const column = columnMap[_reactIntlUniversal.default.get('Total')];
629
+ console.log('column', column);
630
+ updateRow[_reactIntlUniversal.default.get('Total')] = totalCellValue;
631
+ oldRow[_reactIntlUniversal.default.get('Total')] = row[column.key];
628
632
  if (Object.keys(updateRow).length > 0) {
633
+ console.log(222);
629
634
  const rowId = row._id;
630
635
  rowIds.push(rowId);
631
636
  updatedRows[rowId] = updateRow;
@@ -650,6 +655,12 @@ const updatedOneDimensionToTable = _ref5 => {
650
655
  newRows.push(newRow);
651
656
  }
652
657
  });
658
+ console.log('update', {
659
+ newRows,
660
+ updatedRows,
661
+ rowIds,
662
+ oldRows
663
+ });
653
664
  return {
654
665
  newRows,
655
666
  updatedRows,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-statistic",
3
- "version": "5.0.42-alpha.26",
3
+ "version": "5.0.42-alpha.28",
4
4
  "description": "statistics",
5
5
  "main": "dist/dtable-statistic.js",
6
6
  "author": "seafile",