dtable-statistic 5.0.42-alpha.25 → 5.0.42-alpha.26
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.
|
@@ -210,12 +210,15 @@ const exportOneDimensionToTable = _ref => {
|
|
|
210
210
|
const totalColumn = {
|
|
211
211
|
type: _dtableUtils.CellType.NUMBER,
|
|
212
212
|
name: _reactIntlUniversal.default.get('Total'),
|
|
213
|
-
// data: columnData,
|
|
214
213
|
data: {
|
|
215
|
-
|
|
214
|
+
decimal: "dot",
|
|
215
|
+
enable_precision: false,
|
|
216
|
+
format: "yuan",
|
|
217
|
+
precision: 2,
|
|
218
|
+
thousands: "no"
|
|
216
219
|
}
|
|
217
220
|
};
|
|
218
|
-
columnMap['
|
|
221
|
+
columnMap['total'] = totalColumn;
|
|
219
222
|
columns.push(totalColumn);
|
|
220
223
|
|
|
221
224
|
// generator rows
|
|
@@ -225,6 +228,7 @@ const exportOneDimensionToTable = _ref => {
|
|
|
225
228
|
original_name,
|
|
226
229
|
total
|
|
227
230
|
} = item;
|
|
231
|
+
let rowTotal = 0;
|
|
228
232
|
const groupName = isEmptyName(original_name) ? _reactIntlUniversal.default.get(_constants.EMPTY_NAME) : name;
|
|
229
233
|
let newRow = {
|
|
230
234
|
[groupbyColumn.name]: groupName
|
|
@@ -246,9 +250,16 @@ const exportOneDimensionToTable = _ref => {
|
|
|
246
250
|
cellValue = (0, _dayjs.default)(cellValue).format(dateFormat);
|
|
247
251
|
}
|
|
248
252
|
newRow[name] = cellValue;
|
|
253
|
+
rowTotal = rowTotal + Number(cellValue);
|
|
249
254
|
});
|
|
255
|
+
console.log('rowTotal', rowTotal);
|
|
256
|
+
console.log('newRow', newRow);
|
|
257
|
+
newRow[_reactIntlUniversal.default.get('Total')] = rowTotal;
|
|
250
258
|
rows.push(newRow);
|
|
251
259
|
});
|
|
260
|
+
|
|
261
|
+
// total row
|
|
262
|
+
|
|
252
263
|
console.log(11, {
|
|
253
264
|
columns,
|
|
254
265
|
rows
|