|
@@ -206,6 +206,10 @@ function getMetricSummaryValue(field: keyof QhseMonthReportItem) {
|
|
|
|
|
|
|
|
const numericValues = values.map((value) => Number(value))
|
|
const numericValues = values.map((value) => Number(value))
|
|
|
if (numericValues.every((value) => !Number.isNaN(value))) {
|
|
if (numericValues.every((value) => !Number.isNaN(value))) {
|
|
|
|
|
+ if (field === 'withoutAccident') {
|
|
|
|
|
+ return String(Math.min(...numericValues))
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const total = numericValues.reduce((sum, value) => sum + value, 0)
|
|
const total = numericValues.reduce((sum, value) => sum + value, 0)
|
|
|
return Number.isInteger(total) ? String(total) : total.toFixed(2)
|
|
return Number.isInteger(total) ? String(total) : total.toFixed(2)
|
|
|
}
|
|
}
|