Atualização automática - 2026-06-24 13:47:42
This commit is contained in:
@@ -198,19 +198,29 @@ export function validateCertificateAgainstStandard(extractedReport: ReportData,
|
||||
let status: 'OK' | 'FALHA' = 'OK';
|
||||
let normStr = [];
|
||||
|
||||
if (minLimit !== null) {
|
||||
if (minLimit !== null && maxLimit !== null) {
|
||||
normStr.push(`Min: ${minLimit} - Max: ${maxLimit}`);
|
||||
if (val < minLimit) {
|
||||
status = 'FALHA';
|
||||
item.differencePercentage = `${(((val - minLimit) / minLimit) * 100).toFixed(1)}%`;
|
||||
} else if (val > maxLimit) {
|
||||
status = 'FALHA';
|
||||
item.differencePercentage = `+${(((val - maxLimit) / maxLimit) * 100).toFixed(1)}%`;
|
||||
} else {
|
||||
item.differencePercentage = `+${(((val - minLimit) / minLimit) * 100).toFixed(1)}%`;
|
||||
}
|
||||
} else if (minLimit !== null) {
|
||||
normStr.push(`Min: ${minLimit}`);
|
||||
if (val < minLimit) status = 'FALHA';
|
||||
item.differencePercentage = `${val >= minLimit ? '+' : ''}${(((val - minLimit) / minLimit) * 100).toFixed(1)}%`;
|
||||
}
|
||||
|
||||
if (maxLimit !== null) {
|
||||
} else if (maxLimit !== null) {
|
||||
normStr.push(`Max: ${maxLimit}`);
|
||||
if (val > maxLimit) status = 'FALHA';
|
||||
item.differencePercentage = `${val <= maxLimit ? '-' : '+'}${Math.abs(((val - maxLimit) / maxLimit) * 100).toFixed(1)}%`;
|
||||
}
|
||||
|
||||
if (normStr.length > 0) {
|
||||
item.norm = normStr.join(' - ');
|
||||
item.norm = normStr.join(' | ');
|
||||
} else {
|
||||
item.norm = '-';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user