fix(viewer3d): reposicionar botao montagem apos expedicao e corrigir realce de apontamento
This commit is contained in:
@@ -348,15 +348,20 @@ export const ModelViewer3D: React.FC<ModelViewer3DProps> = ({
|
|||||||
// Se o elemento não estiver visível na fase atual, pula estilização detalhada
|
// Se o elemento não estiver visível na fase atual, pula estilização detalhada
|
||||||
if (!isVisibleByPhase) return;
|
if (!isVisibleByPhase) return;
|
||||||
|
|
||||||
// 4. Mapeamento de Processos Industriais para Inovação Híbrida
|
// 4. Mapeamento de Processos Industriais para Inovação Híbrida (Corte -> Solda -> Pintura -> Expedição -> Montagem)
|
||||||
const PROCESS_ORDER_MAP: Record<string, number> = {
|
const PROCESS_ORDER_MAP: Record<string, number> = {
|
||||||
'corte': 1,
|
'corte': 1,
|
||||||
'montagem': 2,
|
'solda': 2,
|
||||||
'solda': 3,
|
'pintura': 3,
|
||||||
'pintura': 4,
|
'pintura/galv': 3,
|
||||||
'pintura/galv': 4,
|
'pintura/galvanizacao': 3,
|
||||||
'expedicao': 5,
|
'pintura / galvanizacao': 3,
|
||||||
'expedição': 5,
|
'galvanizacao': 3,
|
||||||
|
'expedicao': 4,
|
||||||
|
'expedição': 4,
|
||||||
|
'montagem': 5,
|
||||||
|
'montagem obra': 5,
|
||||||
|
'montagem de obra': 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
const targetProcKey = String(selectedProcess || 'all').toLowerCase();
|
const targetProcKey = String(selectedProcess || 'all').toLowerCase();
|
||||||
@@ -368,9 +373,15 @@ export const ModelViewer3D: React.FC<ModelViewer3DProps> = ({
|
|||||||
const pieceProcName = String(prod.currentProcessName || '').toLowerCase();
|
const pieceProcName = String(prod.currentProcessName || '').toLowerCase();
|
||||||
const procsDone: string[] = Array.isArray(prod.processesCompleted) ? prod.processesCompleted : [];
|
const procsDone: string[] = Array.isArray(prod.processesCompleted) ? prod.processesCompleted : [];
|
||||||
|
|
||||||
|
const normalizeStr = (s: string) => s.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase();
|
||||||
|
const normTarget = normalizeStr(targetProcKey);
|
||||||
|
|
||||||
|
const hasDirectProcess =
|
||||||
|
procsDone.some((p: string) => normalizeStr(p).includes(normTarget)) ||
|
||||||
|
normalizeStr(pieceProcName).includes(normTarget);
|
||||||
|
|
||||||
isPointedInTargetProcess =
|
isPointedInTargetProcess =
|
||||||
procsDone.some((p: string) => p.includes(targetProcKey)) ||
|
hasDirectProcess ||
|
||||||
pieceProcName.includes(targetProcKey) ||
|
|
||||||
(targetOrder > 0 && pieceProcOrder >= targetOrder);
|
(targetOrder > 0 && pieceProcOrder >= targetOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ interface Viewer3DSidebarProps {
|
|||||||
const FABRICATION_PROCESSES = [
|
const FABRICATION_PROCESSES = [
|
||||||
{ id: 'all', label: 'Todos', icon: Layers },
|
{ id: 'all', label: 'Todos', icon: Layers },
|
||||||
{ id: 'Corte', label: 'Corte', icon: Scissors },
|
{ id: 'Corte', label: 'Corte', icon: Scissors },
|
||||||
{ id: 'Montagem', label: 'Montagem', icon: Wrench },
|
|
||||||
{ id: 'Solda', label: 'Solda', icon: Flame },
|
{ id: 'Solda', label: 'Solda', icon: Flame },
|
||||||
{ id: 'Pintura', label: 'Pintura', icon: Paintbrush },
|
{ id: 'Pintura', label: 'Pintura', icon: Paintbrush },
|
||||||
{ id: 'Expedicao', label: 'Expedição', icon: Truck },
|
{ id: 'Expedicao', label: 'Expedição', icon: Truck },
|
||||||
|
{ id: 'Montagem', label: 'Montagem', icon: Wrench },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const Viewer3DSidebar: React.FC<Viewer3DSidebarProps> = ({
|
export const Viewer3DSidebar: React.FC<Viewer3DSidebarProps> = ({
|
||||||
|
|||||||
Reference in New Issue
Block a user