Atualização automática - 2026-06-24 13:47:42

This commit is contained in:
2026-06-24 13:47:42 +00:00
parent f75e25e799
commit 4c86721c75
4 changed files with 51 additions and 5 deletions
+15 -5
View File
@@ -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 = '-';
}