|
|
@@ -1,6 +1,6 @@ |
|
|
|
import Divider from "@mui/material/Divider"; |
|
|
|
import Box from "@mui/material/Box"; |
|
|
|
import React from "react"; |
|
|
|
import React, { useEffect } from "react"; |
|
|
|
import List from "@mui/material/List"; |
|
|
|
import ListItemButton from "@mui/material/ListItemButton"; |
|
|
|
import ListItemText from "@mui/material/ListItemText"; |
|
|
@@ -29,243 +29,218 @@ interface NavigationItem { |
|
|
|
label: string; |
|
|
|
path: string; |
|
|
|
children?: NavigationItem[]; |
|
|
|
isHidden?: true | undefined |
|
|
|
} |
|
|
|
|
|
|
|
const navigationItems: NavigationItem[] = [ |
|
|
|
{ |
|
|
|
icon: <Dashboard />, |
|
|
|
label: "Dashboard", |
|
|
|
path: "", |
|
|
|
// children: [ |
|
|
|
// { |
|
|
|
// icon: <SummarizeIcon />, |
|
|
|
// label: "Project Financial Summary", |
|
|
|
// path: "/dashboard/ProjectFinancialSummary", |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// icon: <PaymentsIcon />, |
|
|
|
// label: "Company / Team Cash Flow", |
|
|
|
// path: "/dashboard/CompanyTeamCashFlow", |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// icon: <PaymentsIcon />, |
|
|
|
// label: "Project Cash Flow", |
|
|
|
// path: "/dashboard/ProjectCashFlow", |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// icon: <AccountTreeIcon />, |
|
|
|
// label: "Project Status by Client", |
|
|
|
// path: "/dashboard/ProjectStatusByClient", |
|
|
|
// }, |
|
|
|
// { |
|
|
|
// icon: <PeopleIcon />, |
|
|
|
// label: "Staff Utilization", |
|
|
|
// path: "/dashboard/StaffUtilization", |
|
|
|
// }, |
|
|
|
// ], |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Raw Material", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Purchase Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Pick Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Cons. Pick Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Delivery Pick Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Warehouse", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Location Transfer Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "View item In-out And invertory Ledger", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Production", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Job Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Job Order Traceablity ", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Work Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Work Order Traceablity ", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Quality Control Log", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Quality Control Log", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Delivery", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Delivery Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Report", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "report", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Recipe", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "FG Recipe", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "SFG Recipe", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Recipe", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Settings", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "User", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "User Group", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Material", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Maintain By-product", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Finished Goods", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Equipment Type", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Equipment", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Warehouse", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Supplier", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Customer", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "QC Check Item", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "QC Category", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "QC Check Template", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
|
const NavigationContent: React.FC = () => { |
|
|
|
// const abilities = window.localStorage.getItem("abilites") |
|
|
|
// console.log(abilities) |
|
|
|
const navigationItems: NavigationItem[] = [ |
|
|
|
{ |
|
|
|
icon: <Dashboard />, |
|
|
|
label: "Dashboard", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Raw Material", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Purchase Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Pick Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Cons. Pick Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Delivery Pick Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Warehouse", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Location Transfer Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "View item In-out And invertory Ledger", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Production", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Job Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Job Order Traceablity ", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Work Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Work Order Traceablity ", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Quality Control Log", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Quality Control Log", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Delivery", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Delivery Order", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Report", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "report", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Recipe", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "FG Recipe", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "SFG Recipe", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Recipe", |
|
|
|
path: "", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Settings", |
|
|
|
path: "", |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "User", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "User Group", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Material", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Maintain By-product", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Finished Goods", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Equipment Type", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Equipment", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Warehouse", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Supplier", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "Customer", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "QC Check Item", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "QC Category", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
{ |
|
|
|
icon: <RequestQuote />, |
|
|
|
label: "QC Check Template", |
|
|
|
path: "/settings/user", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
]; |
|
|
|
const { t } = useTranslation("common"); |
|
|
|
const pathname = usePathname(); |
|
|
|
|
|
|
@@ -297,7 +272,7 @@ const NavigationContent: React.FC = () => { |
|
|
|
</ListItemButton> |
|
|
|
{item.children && isOpen && ( |
|
|
|
<List sx={{ pl: 2 }}> |
|
|
|
{item.children.map((child) => renderNavigationItem(child))} |
|
|
|
{item.children.map((child) => (!child.isHidden && renderNavigationItem(child)))} |
|
|
|
</List> |
|
|
|
)} |
|
|
|
</Box> |
|
|
|