feat: Alto contraste no modo claro e criacao de templates customizados no Modo Smart

This commit is contained in:
2026-09-25 12:06:27 -03:00
parent 246e8d08f2
commit 6f595d6839
4 changed files with 518 additions and 116 deletions
+113
View File
@@ -83,6 +83,119 @@ export const SMART_SUBMODULES: SmartSubmodule[] = [
},
];
export interface SmartCustomTemplate {
id: string;
nome: string;
descricao: string;
icone: string;
badge?: string;
isCustom?: boolean;
permissions: Record<string, { can_view: boolean; can_edit: boolean; can_delete: boolean }>;
}
export const SMART_DEFAULT_TEMPLATES: SmartCustomTemplate[] = [
{
id: 'operador_padrao',
nome: 'Padrão Operador',
descricao: 'Focado em apontamento de peças, montagem e relatórios básicos.',
icone: 'Factory',
badge: 'Chão de Fábrica',
isCustom: false,
permissions: {
smart_of: { can_view: true, can_edit: false, can_delete: false },
smart_fases: { can_view: true, can_edit: false, can_delete: false },
smart_processos: { can_view: true, can_edit: false, can_delete: false },
smart_apontamento: { can_view: true, can_edit: true, can_delete: false },
smart_forcar_apontamento: { can_view: false, can_edit: false, can_delete: false },
smart_3d: { can_view: true, can_edit: false, can_delete: false },
smart_modo_completo: { can_view: false, can_edit: false, can_delete: false },
smart_romaneios: { can_view: true, can_edit: false, can_delete: false },
smart_montagem: { can_view: true, can_edit: true, can_delete: false },
smart_relatorios: { can_view: true, can_edit: true, can_delete: false },
},
},
{
id: 'lider_producao',
nome: 'Líder de Produção',
descricao: 'Permite forçar apontamentos com pendências e gerar todos os relatórios.',
icone: 'Zap',
badge: 'Liderança',
isCustom: false,
permissions: {
smart_of: { can_view: true, can_edit: true, can_delete: false },
smart_fases: { can_view: true, can_edit: true, can_delete: false },
smart_processos: { can_view: true, can_edit: true, can_delete: false },
smart_apontamento: { can_view: true, can_edit: true, can_delete: true },
smart_forcar_apontamento: { can_view: true, can_edit: true, can_delete: false },
smart_3d: { can_view: true, can_edit: false, can_delete: false },
smart_modo_completo: { can_view: true, can_edit: false, can_delete: false },
smart_romaneios: { can_view: true, can_edit: true, can_delete: false },
smart_montagem: { can_view: true, can_edit: true, can_delete: false },
smart_relatorios: { can_view: true, can_edit: true, can_delete: false },
},
},
{
id: 'inspetor_qualidade',
nome: 'Inspetor de Qualidade',
descricao: 'Acesso ao 3D, relatórios, romaneios e visualização completa de processos.',
icone: 'CheckCircle2',
badge: 'Qualidade',
isCustom: false,
permissions: {
smart_of: { can_view: true, can_edit: false, can_delete: false },
smart_fases: { can_view: true, can_edit: false, can_delete: false },
smart_processos: { can_view: true, can_edit: false, can_delete: false },
smart_apontamento: { can_view: true, can_edit: false, can_delete: false },
smart_forcar_apontamento: { can_view: false, can_edit: false, can_delete: false },
smart_3d: { can_view: true, can_edit: false, can_delete: false },
smart_modo_completo: { can_view: false, can_edit: false, can_delete: false },
smart_romaneios: { can_view: true, can_edit: false, can_delete: false },
smart_montagem: { can_view: true, can_edit: false, can_delete: false },
smart_relatorios: { can_view: true, can_edit: true, can_delete: false },
},
},
{
id: 'total_admin',
nome: 'Total Admin',
descricao: 'Acesso irrestrito a todos os submódulos, forçar apontamentos e modo completo.',
icone: 'Shield',
badge: 'Administrador',
isCustom: false,
permissions: {
smart_of: { can_view: true, can_edit: true, can_delete: true },
smart_fases: { can_view: true, can_edit: true, can_delete: true },
smart_processos: { can_view: true, can_edit: true, can_delete: true },
smart_apontamento: { can_view: true, can_edit: true, can_delete: true },
smart_forcar_apontamento: { can_view: true, can_edit: true, can_delete: true },
smart_3d: { can_view: true, can_edit: true, can_delete: true },
smart_modo_completo: { can_view: true, can_edit: true, can_delete: true },
smart_romaneios: { can_view: true, can_edit: true, can_delete: true },
smart_montagem: { can_view: true, can_edit: true, can_delete: true },
smart_relatorios: { can_view: true, can_edit: true, can_delete: true },
},
},
{
id: 'apenas_leitura',
nome: 'Apenas Leitura',
descricao: 'Somente visualização de OFs, peças, 3D e status sem permissão de apontamento.',
icone: 'Eye',
badge: 'Consulta',
isCustom: false,
permissions: {
smart_of: { can_view: true, can_edit: false, can_delete: false },
smart_fases: { can_view: true, can_edit: false, can_delete: false },
smart_processos: { can_view: true, can_edit: false, can_delete: false },
smart_apontamento: { can_view: false, can_edit: false, can_delete: false },
smart_forcar_apontamento: { can_view: false, can_edit: false, can_delete: false },
smart_3d: { can_view: true, can_edit: false, can_delete: false },
smart_modo_completo: { can_view: false, can_edit: false, can_delete: false },
smart_romaneios: { can_view: true, can_edit: false, can_delete: false },
smart_montagem: { can_view: true, can_edit: false, can_delete: false },
smart_relatorios: { can_view: true, can_edit: false, can_delete: false },
},
},
];
export interface SmartUserPermission {
id?: string;
user_id: string;