dtable-statistic 5.0.42-alpha.0 → 5.0.42-alpha.10

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.
@@ -48,6 +48,7 @@ const exportOneDimensionToTable = _ref => {
48
48
  let {
49
49
  statisticalResult
50
50
  } = _ref;
51
+ console.log('exportOneDimensionToTable');
51
52
  const {
52
53
  pivotResult,
53
54
  groupbyColumn,
@@ -110,6 +111,17 @@ const exportOneDimensionToTable = _ref => {
110
111
  }
111
112
  }
112
113
 
114
+ // count column
115
+ if (summaryColumn) {
116
+ console.log('columnData', columnData);
117
+ const countColumn = {
118
+ type: _isDateSummaryColumn ? _dtableUtils.CellType.DATE : _dtableUtils.CellType.NUMBER,
119
+ name: summaryColumn === null || summaryColumn === void 0 ? void 0 : summaryColumn.name,
120
+ data: columnData
121
+ };
122
+ columns.push(countColumn);
123
+ }
124
+
113
125
  // total column
114
126
  const totalColumn = {
115
127
  type: _isDateSummaryColumn ? _dtableUtils.CellType.DATE : _dtableUtils.CellType.NUMBER,
@@ -134,20 +146,30 @@ const exportOneDimensionToTable = _ref => {
134
146
  [groupbyColumn.name]: groupName,
135
147
  [_reactIntlUniversal.default.get('Total')]: cellValue
136
148
  };
149
+ if (summaryColumn) {
150
+ newRow[summaryColumn.name] = cellValue;
151
+ }
137
152
  rows.push(newRow);
138
153
  });
154
+ console.log(11, {
155
+ columns,
156
+ rows
157
+ });
139
158
  return {
140
159
  columns,
141
160
  rows
142
161
  };
143
162
  }
144
-
163
+ console.log('pivot_columns', pivot_columns);
164
+ console.log('statisticTableColumns', statisticTableColumns);
145
165
  // one dimension table with number columns
146
166
  Array.isArray(pivot_columns) && pivot_columns.forEach(item => {
147
167
  const {
148
168
  key
149
169
  } = item;
170
+ console.log('item', item);
150
171
  const column = statisticTableColumns.find(column => column.key === key);
172
+ console.log('column', column);
151
173
  if (column) {
152
174
  const columnName = column.name;
153
175
  let columnData;
@@ -190,7 +212,7 @@ const exportOneDimensionToTable = _ref => {
190
212
  columns.push(newColumn);
191
213
  }
192
214
  });
193
-
215
+ console.log('pivot_rows', pivot_rows);
194
216
  // generator rows
195
217
  pivot_rows.forEach(item => {
196
218
  const {
@@ -204,11 +226,10 @@ const exportOneDimensionToTable = _ref => {
204
226
  };
205
227
  Array.isArray(pivot_columns) && pivot_columns.forEach(item => {
206
228
  const {
207
- key,
208
- method
229
+ key
209
230
  } = item;
210
231
  const column = columnMap[key];
211
- const cellValueKey = key + method;
232
+ const cellValueKey = key;
212
233
  const {
213
234
  name,
214
235
  type,
@@ -221,8 +242,10 @@ const exportOneDimensionToTable = _ref => {
221
242
  }
222
243
  newRow[name] = cellValue;
223
244
  });
245
+ console.log('newRow', newRow);
224
246
  rows.push(newRow);
225
247
  });
248
+ console.log('rows', rows);
226
249
  return {
227
250
  columns,
228
251
  rows
@@ -232,6 +255,7 @@ const exportTwoDimensionToTable = _ref2 => {
232
255
  let {
233
256
  statisticalResult
234
257
  } = _ref2;
258
+ console.log('exportTwoDimensionToTable');
235
259
  const {
236
260
  pivotResult,
237
261
  groupbyColumn,
@@ -455,6 +479,7 @@ const exportTwoDimensionWithSummaryColumnsToTable = _ref4 => {
455
479
  let {
456
480
  statisticalResult
457
481
  } = _ref4;
482
+ console.log('exportTwoDimensionWithSummaryColumnsToTable');
458
483
  return getTwoDimensionWithSummaryColumns({
459
484
  statisticalResult
460
485
  });
@@ -564,7 +589,7 @@ const updatedOneDimensionToTable = _ref5 => {
564
589
  method
565
590
  } = item;
566
591
  const column = columnMap[key];
567
- const cellValueKey = key + method;
592
+ const cellValueKey = key;
568
593
  const totalCellValue = getValidValueForColumn(column, total[cellValueKey]);
569
594
  if (column && (0, _cellValue.isCellValueChanged)(row[column.key], totalCellValue, column.type)) {
570
595
  updateRow[column.key] = totalCellValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-statistic",
3
- "version": "5.0.42-alpha.0",
3
+ "version": "5.0.42-alpha.10",
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.88-alpha.3"
21
+ "sea-chart": "~0.0.88"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "dtable-ui-component": "~5.0.*",