@nokecy/qc-ui 1.0.21 → 1.0.23
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.
|
@@ -297,6 +297,12 @@ function AgGridPlus(props) {
|
|
|
297
297
|
}) / count;
|
|
298
298
|
return Math.sqrt(variance);
|
|
299
299
|
};
|
|
300
|
+
var handelNumber = function handelNumber(value) {
|
|
301
|
+
return (value / 1).toLocaleString(undefined, {
|
|
302
|
+
minimumFractionDigits: 2,
|
|
303
|
+
maximumFractionDigits: 2
|
|
304
|
+
});
|
|
305
|
+
};
|
|
300
306
|
|
|
301
307
|
// sum 求和 avg 平均值 standardDeviation 标准差
|
|
302
308
|
var calculatefun = function calculatefun(calcColFields, displayedData) {
|
|
@@ -308,13 +314,13 @@ function AgGridPlus(props) {
|
|
|
308
314
|
if (!i.cellRenderer) {
|
|
309
315
|
switch (i.calculateType) {
|
|
310
316
|
case "sum":
|
|
311
|
-
calculateData[i.field] = sumFun(i.field, displayedData);
|
|
317
|
+
calculateData[i.field] = i.formatWithCommas ? handelNumber(sumFun(i.field, displayedData).toFixed(i.transactionAmount)) : sumFun(i.field, displayedData).toFixed(i.transactionAmount);
|
|
312
318
|
break;
|
|
313
319
|
case "avg":
|
|
314
|
-
calculateData[i.field] = avgFun(i.field, displayedData);
|
|
320
|
+
calculateData[i.field] = avgFun(i.field, displayedData).toFixed(i.transactionAmount);
|
|
315
321
|
break;
|
|
316
322
|
case "standardDeviation":
|
|
317
|
-
calculateData[i.field] = standardDeviationFun(i.field, displayedData);
|
|
323
|
+
calculateData[i.field] = standardDeviationFun(i.field, displayedData).toFixed(i.transactionAmount);
|
|
318
324
|
break;
|
|
319
325
|
default:
|
|
320
326
|
break;
|
|
@@ -413,7 +419,9 @@ function AgGridPlus(props) {
|
|
|
413
419
|
}).map(function (col) {
|
|
414
420
|
return {
|
|
415
421
|
field: col.field,
|
|
416
|
-
calculateType: col.calculateType
|
|
422
|
+
calculateType: col.calculateType,
|
|
423
|
+
transactionAmount: col.transactionAmount || 2,
|
|
424
|
+
formatWithCommas: col.formatWithCommas
|
|
417
425
|
};
|
|
418
426
|
});
|
|
419
427
|
if (calcColFields.length > 0) {
|
|
@@ -110,7 +110,8 @@ var DialogSelect = function DialogSelect(props) {
|
|
|
110
110
|
marginRight: !props.hideBtn ? 5 : 0
|
|
111
111
|
})
|
|
112
112
|
})) : /*#__PURE__*/_react.default.createElement(_antdV.Select, _extends({
|
|
113
|
-
maxTagCount: 'responsive'
|
|
113
|
+
maxTagCount: 'responsive',
|
|
114
|
+
filterOption: false
|
|
114
115
|
}, rest, {
|
|
115
116
|
value: state,
|
|
116
117
|
style: _objectSpread({
|
|
@@ -288,6 +288,12 @@ function AgGridPlus(props) {
|
|
|
288
288
|
}) / count;
|
|
289
289
|
return Math.sqrt(variance);
|
|
290
290
|
};
|
|
291
|
+
var handelNumber = function handelNumber(value) {
|
|
292
|
+
return (value / 1).toLocaleString(undefined, {
|
|
293
|
+
minimumFractionDigits: 2,
|
|
294
|
+
maximumFractionDigits: 2
|
|
295
|
+
});
|
|
296
|
+
};
|
|
291
297
|
|
|
292
298
|
// sum 求和 avg 平均值 standardDeviation 标准差
|
|
293
299
|
var calculatefun = function calculatefun(calcColFields, displayedData) {
|
|
@@ -299,13 +305,13 @@ function AgGridPlus(props) {
|
|
|
299
305
|
if (!i.cellRenderer) {
|
|
300
306
|
switch (i.calculateType) {
|
|
301
307
|
case "sum":
|
|
302
|
-
calculateData[i.field] = sumFun(i.field, displayedData);
|
|
308
|
+
calculateData[i.field] = i.formatWithCommas ? handelNumber(sumFun(i.field, displayedData).toFixed(i.transactionAmount)) : sumFun(i.field, displayedData).toFixed(i.transactionAmount);
|
|
303
309
|
break;
|
|
304
310
|
case "avg":
|
|
305
|
-
calculateData[i.field] = avgFun(i.field, displayedData);
|
|
311
|
+
calculateData[i.field] = avgFun(i.field, displayedData).toFixed(i.transactionAmount);
|
|
306
312
|
break;
|
|
307
313
|
case "standardDeviation":
|
|
308
|
-
calculateData[i.field] = standardDeviationFun(i.field, displayedData);
|
|
314
|
+
calculateData[i.field] = standardDeviationFun(i.field, displayedData).toFixed(i.transactionAmount);
|
|
309
315
|
break;
|
|
310
316
|
default:
|
|
311
317
|
break;
|
|
@@ -404,7 +410,9 @@ function AgGridPlus(props) {
|
|
|
404
410
|
}).map(function (col) {
|
|
405
411
|
return {
|
|
406
412
|
field: col.field,
|
|
407
|
-
calculateType: col.calculateType
|
|
413
|
+
calculateType: col.calculateType,
|
|
414
|
+
transactionAmount: col.transactionAmount || 2,
|
|
415
|
+
formatWithCommas: col.formatWithCommas
|
|
408
416
|
};
|
|
409
417
|
});
|
|
410
418
|
if (calcColFields.length > 0) {
|
|
@@ -101,7 +101,8 @@ var DialogSelect = function DialogSelect(props) {
|
|
|
101
101
|
marginRight: !props.hideBtn ? 5 : 0
|
|
102
102
|
})
|
|
103
103
|
})) : /*#__PURE__*/React.createElement(Select, _extends({
|
|
104
|
-
maxTagCount: 'responsive'
|
|
104
|
+
maxTagCount: 'responsive',
|
|
105
|
+
filterOption: false
|
|
105
106
|
}, rest, {
|
|
106
107
|
value: state,
|
|
107
108
|
style: _objectSpread({
|