dtable-statistic 5.0.43-alpha.1 → 5.0.43-alpha.2

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.
@@ -114,15 +114,25 @@ const exportOneDimensionToTable = _ref => {
114
114
  }
115
115
 
116
116
  // count column
117
- if (summaryColumn) {
117
+ if (pivot_columns.length === 0) {
118
118
  const countColumn = {
119
119
  type: _isDateSummaryColumn ? _dtableUtils.CellType.DATE : _dtableUtils.CellType.NUMBER,
120
- name: summaryColumn === null || summaryColumn === void 0 ? void 0 : summaryColumn.name,
120
+ name: _reactIntlUniversal.default.get('Amount'),
121
121
  data: columnData
122
122
  };
123
123
  columns.push(countColumn);
124
124
  }
125
125
 
126
+ // single field
127
+ if (summaryColumn) {
128
+ const singleColumn = {
129
+ type: _isDateSummaryColumn ? _dtableUtils.CellType.DATE : _dtableUtils.CellType.NUMBER,
130
+ name: summaryColumn === null || summaryColumn === void 0 ? void 0 : summaryColumn.name,
131
+ data: columnData
132
+ };
133
+ columns.push(singleColumn);
134
+ }
135
+
126
136
  // total column
127
137
  const totalColumn = {
128
138
  type: _isDateSummaryColumn ? _dtableUtils.CellType.DATE : _dtableUtils.CellType.NUMBER,
@@ -147,9 +157,14 @@ const exportOneDimensionToTable = _ref => {
147
157
  [groupbyColumn.name]: groupName,
148
158
  [_reactIntlUniversal.default.get('Total')]: cellValue
149
159
  };
160
+ // single column
150
161
  if (summaryColumn) {
151
162
  newRow[summaryColumn.name] = cellValue;
152
163
  }
164
+ // count column
165
+ if (pivot_columns.length === 0) {
166
+ newRow[_reactIntlUniversal.default.get('Amount')] = cellValue;
167
+ }
153
168
  rows.push(newRow);
154
169
  });
155
170
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-statistic",
3
- "version": "5.0.43-alpha.1",
3
+ "version": "5.0.43-alpha.2",
4
4
  "description": "statistics",
5
5
  "main": "dist/dtable-statistic.js",
6
6
  "author": "seafile",