fix(rotas): cadastrar alias /ordens-fabricacao e corrigir botao voltar no cadastro de pecas
This commit is contained in:
@@ -118,6 +118,12 @@ export const routeConfig: RouteDefinition[] = [
|
|||||||
guard: 'resource',
|
guard: 'resource',
|
||||||
resourceKey: 'ofs-lista',
|
resourceKey: 'ofs-lista',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/ordens-fabricacao',
|
||||||
|
component: () => import('@/pages/OrdensFabricacao'),
|
||||||
|
guard: 'resource',
|
||||||
|
resourceKey: 'ofs-lista',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/ofs/cronograma',
|
path: '/ofs/cronograma',
|
||||||
component: () => import('@/pages/CronogramaOF'),
|
component: () => import('@/pages/CronogramaOF'),
|
||||||
|
|||||||
@@ -193,6 +193,14 @@ export default function CadastroPecasFiltrado() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleVoltar = () => {
|
||||||
|
if (window.history.state && window.history.state.idx > 0) {
|
||||||
|
navigate(-1);
|
||||||
|
} else {
|
||||||
|
navigate('/seletor-of');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (!ofSelecionada) {
|
if (!ofSelecionada) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -206,7 +214,7 @@ export default function CadastroPecasFiltrado() {
|
|||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={() => navigate('/ordens-fabricacao')}
|
onClick={handleVoltar}
|
||||||
className="flex items-center gap-2"
|
className="flex items-center gap-2"
|
||||||
>
|
>
|
||||||
<ArrowLeft className="h-4 w-4" />
|
<ArrowLeft className="h-4 w-4" />
|
||||||
|
|||||||
Reference in New Issue
Block a user