dtable-statistic 5.2.5 → 5.2.6-alpha.1

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.
@@ -54,7 +54,7 @@
54
54
  width: 100%;
55
55
  height: 100%;
56
56
  position: relative;
57
- overflow: scroll;
57
+ overflow: auto;
58
58
  }
59
59
 
60
60
  .statistic-chart-addition-dialog .statistic-modal-body .statistic-chart-render-container .statistic-chart-render .sea-chart-editor {
@@ -59,6 +59,7 @@ class ChartPreview extends _react.Component {
59
59
  };
60
60
  this.onNewTableDialogToggle = () => {
61
61
  const statisticalResult = this.chartView && this.chartView.getStatData();
62
+ console.log(statisticalResult);
62
63
  statisticalResult && this.props.showNewTableDialog({
63
64
  statisticalResult
64
65
  });
@@ -131,7 +131,6 @@ class StatList extends _react.Component {
131
131
  rowIds,
132
132
  oldRows
133
133
  });
134
-
135
134
  // refresh charts if has updates
136
135
  if (Array.isArray(rowIds) && rowIds.length > 0 || Array.isArray(newRows) && newRows.length > 0) {
137
136
  _seaChart.EventBus.dispatch(_constants.CommonEventTypes.REFRESH_CHARTS);
@@ -535,6 +535,7 @@ const updatedOneDimensionToTable = _ref5 => {
535
535
  // one dimension table no summary columns
536
536
  if (pivot_columns.length < 2) {
537
537
  columnMap['total'] = (0, _dtableUtils.getTableColumnByName)(updateTable, _reactIntlUniversal.default.get('Total'));
538
+ columnMap['Amount'] = (0, _dtableUtils.getTableColumnByName)(updateTable, _reactIntlUniversal.default.get('Amount'));
538
539
  if (summaryColumn) {
539
540
  columnMap['sumary_column'] = (0, _dtableUtils.getTableColumnByName)(updateTable, summaryColumn.name);
540
541
  }
@@ -549,6 +550,7 @@ const updatedOneDimensionToTable = _ref5 => {
549
550
  const groupName = isEmptyName(original_name) ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name;
550
551
  const row = tableRows.find(row => row[nameColumn.key] === groupName);
551
552
  const totalColumn = columnMap['total'];
553
+ const amountColumn = columnMap['Amount'];
552
554
  const sumary_column = columnMap['sumary_column'];
553
555
  if (row) {
554
556
  // update old row
@@ -559,6 +561,10 @@ const updatedOneDimensionToTable = _ref5 => {
559
561
  updateRow[totalColumn.key] = validTotalCellValue;
560
562
  oldRow[totalColumn.key] = row[totalColumn.key];
561
563
  }
564
+ if (amountColumn && (0, _cellValue.isCellValueChanged)(row[amountColumn.key], validTotalCellValue, amountColumn.type)) {
565
+ updateRow[amountColumn.key] = validTotalCellValue;
566
+ oldRow[amountColumn.key] = row[amountColumn.key];
567
+ }
562
568
  const validSummaryCellValue = getValidValueForColumn(sumary_column, total.total);
563
569
  if (sumary_column && (0, _cellValue.isCellValueChanged)(row[sumary_column.key], validSummaryCellValue, sumary_column.type)) {
564
570
  updateRow[sumary_column.key] = validSummaryCellValue;
@@ -577,6 +583,9 @@ const updatedOneDimensionToTable = _ref5 => {
577
583
  if (totalColumn) {
578
584
  newRow[totalColumn.key] = getValidValueForColumn(totalColumn, total.total);
579
585
  }
586
+ if (amountColumn) {
587
+ newRow[amountColumn.key] = getValidValueForColumn(amountColumn, total.total);
588
+ }
580
589
  if (sumary_column) {
581
590
  newRow[sumary_column.key] = getValidValueForColumn(sumary_column, total.total);
582
591
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-statistic",
3
- "version": "5.2.5",
3
+ "version": "5.2.6-alpha.1",
4
4
  "description": "statistics",
5
5
  "main": "dist/dtable-statistic.js",
6
6
  "author": "seafile",