From c869cc2e3d0e051daef9637306f7c0b086c2c458 Mon Sep 17 00:00:00 2001 From: Marcos Reifonas Date: Fri, 21 Aug 2026 16:40:01 +0000 Subject: [PATCH] fix: migrar checkboxes e tick-boxes para SVG vetorial puro no checklist PDF --- .../prioridades/PrioridadesPDFTemplate.tsx | 200 +++++++----------- src/pages/PrioridadesFabricacao.tsx | 198 ++++++----------- 2 files changed, 140 insertions(+), 258 deletions(-) diff --git a/src/components/prioridades/PrioridadesPDFTemplate.tsx b/src/components/prioridades/PrioridadesPDFTemplate.tsx index 6a2fa62..37c1e24 100644 --- a/src/components/prioridades/PrioridadesPDFTemplate.tsx +++ b/src/components/prioridades/PrioridadesPDFTemplate.tsx @@ -57,24 +57,51 @@ export const PrioridadesPDFTemplate: React.FC = ({ // Quadrados com "5" for (let i = 0; i < numBigBoxes; i++) { boxes.push( -
- 5 -
+ + + 5 + ); } // Quadrados unitários restantes for (let i = 0; i < numSmallBoxes; i++) { - boxes.push(
); + boxes.push( + + + + ); } } else { // Apenas quadrados unitários for (let i = 0; i < quantity; i++) { - boxes.push(
); + boxes.push( + + + + ); } } - return
{boxes}
; + return {boxes}; }; return ( @@ -84,84 +111,6 @@ export const PrioridadesPDFTemplate: React.FC = ({ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #111827; } - .process-group { - display: flex; - align-items: center; - flex-wrap: wrap; - gap: 16px; - margin-top: 4px; - } - .process-item { - display: inline-flex; - align-items: center; - gap: 6px; - vertical-align: middle; - } - .process-checkbox { - width: 14px; - height: 14px; - min-width: 14px; - min-height: 14px; - border: 1.5px solid #4b5563; - border-radius: 2px; - display: inline-block; - vertical-align: middle; - box-sizing: border-box; - background-color: #ffffff; - } - .process-label { - font-size: 13px; - font-weight: 600; - color: #374151; - line-height: 14px; - display: inline-block; - vertical-align: middle; - } - .tick-boxes-wrapper { - display: inline-flex; - align-items: center; - flex-wrap: wrap; - gap: 3px; - vertical-align: middle; - } - .tick-box { - width: 13px; - height: 13px; - min-width: 13px; - min-height: 13px; - border: 1px solid #4b5563; - border-radius: 2px; - display: inline-block; - vertical-align: middle; - box-sizing: border-box; - background-color: #ffffff; - } - .tick-box-large { - width: 13px; - height: 13px; - min-width: 13px; - min-height: 13px; - border: 1px solid #4b5563; - border-radius: 2px; - display: inline-flex; - align-items: center; - justify-content: center; - vertical-align: middle; - box-sizing: border-box; - background-color: #f3f4f6; - text-align: center; - line-height: 1; - } - .tick-box-large span { - color: #6b7280; - font-size: 8.5px; - font-weight: 700; - line-height: 13px; - display: block; - width: 100%; - height: 100%; - text-align: center; - } .item-card { border: 1px solid #e5e7eb; padding: 8px 10px; @@ -169,31 +118,6 @@ export const PrioridadesPDFTemplate: React.FC = ({ background-color: #ffffff; box-sizing: border-box; } - .item-header { - display: flex; - align-items: center; - flex-wrap: wrap; - gap: 6px; - min-height: 18px; - } - .item-marca { - font-size: 13px; - font-weight: 700; - color: #111827; - line-height: 14px; - white-space: nowrap; - display: inline-block; - vertical-align: middle; - } - .item-tipo { - font-size: 11px; - font-weight: 600; - color: #6b7280; - line-height: 14px; - white-space: nowrap; - display: inline-block; - vertical-align: middle; - } .item-signature { margin-top: 6px; font-size: 11px; @@ -251,12 +175,29 @@ export const PrioridadesPDFTemplate: React.FC = ({ {/* Coluna Processo */}
-

PROCESSO

-
+

PROCESSO

+
{['Corte', 'Solda', 'Pintura', 'Expedição'].map((processo) => ( -
- - {processo} +
+ + + + + {processo} +
))}
@@ -265,14 +206,21 @@ export const PrioridadesPDFTemplate: React.FC = ({
{/* Legenda */} -
- Legenda: - Marca (Qtd) - (S/M) - = Sem Montagem, - (C/M) - = Com Montagem. Os quadrados - +
+ Legenda: + Marca (Qtd) + (S/M) + = Sem Montagem, + (C/M) + = Com Montagem. Os quadrados + + + indicam o controle de peças fabricadas.
@@ -303,11 +251,13 @@ export const PrioridadesPDFTemplate: React.FC = ({ return (
-
- +
+ {marca} ({quantidade}) - {infoType} + + {infoType} + {generateTickBoxes(quantidade)}
diff --git a/src/pages/PrioridadesFabricacao.tsx b/src/pages/PrioridadesFabricacao.tsx index 27791de..5a0ad5c 100644 --- a/src/pages/PrioridadesFabricacao.tsx +++ b/src/pages/PrioridadesFabricacao.tsx @@ -58,17 +58,30 @@ const PrioridadesFabricacao = () => { const numBigBoxes = Math.floor(quantity / 5); const numSmallBoxes = quantity % 5; for (let i = 0; i < numBigBoxes; i++) { - boxesHtml += `
5
`; + boxesHtml += ` + + + 5 + + `; } for (let i = 0; i < numSmallBoxes; i++) { - boxesHtml += `
`; + boxesHtml += ` + + + + `; } } else { for (let i = 0; i < quantity; i++) { - boxesHtml += `
`; + boxesHtml += ` + + + + `; } } - return `
${boxesHtml}
`; + return `${boxesHtml}`; }; const handleImprimirRelatorio = async () => { @@ -106,11 +119,11 @@ const PrioridadesFabricacao = () => { const getCoresPrioridade = (codigo: string) => { switch (codigo) { - case 'P1': return 'text-red-700 bg-red-100'; - case 'P2': return 'text-orange-700 bg-orange-100'; - case 'P3': return 'text-blue-700 bg-blue-100'; - case 'P4': return 'text-gray-700 bg-gray-200'; - default: return 'text-gray-700 bg-gray-200'; + case 'P1': return 'text-red-700 bg-red-100 border-red-300'; + case 'P2': return 'text-orange-700 bg-orange-100 border-orange-300'; + case 'P3': return 'text-blue-700 bg-blue-100 border-blue-300'; + case 'P4': return 'text-gray-700 bg-gray-200 border-gray-300'; + default: return 'text-gray-700 bg-gray-200 border-gray-300'; } }; @@ -119,15 +132,15 @@ const PrioridadesFabricacao = () => { itemsContent += `
-

+

${getPrioridadeNome(codigo)}

-
+
`; // Gerar linhas de itens (3 por linha) for (let i = 0; i < Math.ceil(itens.length / 3); i++) { - const bgColorClass = i % 2 !== 0 ? 'bg-gray-50' : 'bg-white'; + const bgColorClass = i % 2 !== 0 ? 'bg-gray-50/70' : 'bg-white'; const rowItems = itens.slice(i * 3, (i + 1) * 3); itemsContent += `
`; @@ -141,9 +154,9 @@ const PrioridadesFabricacao = () => { itemsContent += `
-
- ${marca} (${quantidade}) - ${infoType} +
+ ${marca} (${quantidade}) + ${infoType} ${tickBoxes}
@@ -179,88 +192,10 @@ const PrioridadesFabricacao = () => {