@nokecy/qc-ui 1.0.22 → 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,7 +314,7 @@ 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).toFixed(i.transactionAmount);
|
|
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
320
|
calculateData[i.field] = avgFun(i.field, displayedData).toFixed(i.transactionAmount);
|
|
@@ -414,7 +420,8 @@ function AgGridPlus(props) {
|
|
|
414
420
|
return {
|
|
415
421
|
field: col.field,
|
|
416
422
|
calculateType: col.calculateType,
|
|
417
|
-
transactionAmount: col.transactionAmount || 2
|
|
423
|
+
transactionAmount: col.transactionAmount || 2,
|
|
424
|
+
formatWithCommas: col.formatWithCommas
|
|
418
425
|
};
|
|
419
426
|
});
|
|
420
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,7 +305,7 @@ 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).toFixed(i.transactionAmount);
|
|
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
311
|
calculateData[i.field] = avgFun(i.field, displayedData).toFixed(i.transactionAmount);
|
|
@@ -405,7 +411,8 @@ function AgGridPlus(props) {
|
|
|
405
411
|
return {
|
|
406
412
|
field: col.field,
|
|
407
413
|
calculateType: col.calculateType,
|
|
408
|
-
transactionAmount: col.transactionAmount || 2
|
|
414
|
+
transactionAmount: col.transactionAmount || 2,
|
|
415
|
+
formatWithCommas: col.formatWithCommas
|
|
409
416
|
};
|
|
410
417
|
});
|
|
411
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({
|