Merge branch 'feature/profile_and_icons' into 'develop'
Feature/profile and icons See merge request witel-front-end/rms!17
This commit is contained in:
@@ -6,6 +6,7 @@ import { Box, Drawer, IconButton, Stack, styled, Toolbar, Typography } from "@mu
|
|||||||
import MuiAppBar from "@mui/material/AppBar";
|
import MuiAppBar from "@mui/material/AppBar";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import HeaderMenu from "./HeaderMenu";
|
import HeaderMenu from "./HeaderMenu";
|
||||||
|
import moment from "jalali-moment";
|
||||||
import { headerMenu } from "@/core/utils/headerMenu";
|
import { headerMenu } from "@/core/utils/headerMenu";
|
||||||
|
|
||||||
const drawerWidth = 300;
|
const drawerWidth = 300;
|
||||||
@@ -56,6 +57,7 @@ const DrawerHeader = styled("div")(({ theme }) => ({
|
|||||||
|
|
||||||
const HeaderWithSidebar = ({ children }) => {
|
const HeaderWithSidebar = ({ children }) => {
|
||||||
const [open, setOpen] = useState(true);
|
const [open, setOpen] = useState(true);
|
||||||
|
const now = moment().locale("fa").format("HH:mm | YYYY/MM/DD");
|
||||||
|
|
||||||
const handleDrawerOpen = () => {
|
const handleDrawerOpen = () => {
|
||||||
setOpen(true);
|
setOpen(true);
|
||||||
@@ -101,7 +103,8 @@ const HeaderWithSidebar = ({ children }) => {
|
|||||||
anchor="left"
|
anchor="left"
|
||||||
open={open}
|
open={open}
|
||||||
>
|
>
|
||||||
<DrawerHeader>
|
<DrawerHeader sx={{ display: "flex", alignItems: "center", justifyContent: "space-between" }}>
|
||||||
|
<Typography variant="subtitle2" color="#757575" sx={{ px: 1 }}>تاریخ امروز: {now}</Typography>
|
||||||
<IconButton onClick={handleDrawerClose}>
|
<IconButton onClick={handleDrawerClose}>
|
||||||
<ChevronRightIcon />
|
<ChevronRightIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|||||||
52
src/core/components/Profile/ChangePass/index.jsx
Normal file
52
src/core/components/Profile/ChangePass/index.jsx
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Box,
|
||||||
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogActions,
|
||||||
|
DialogContent,
|
||||||
|
DialogTitle,
|
||||||
|
IconButton,
|
||||||
|
useMediaQuery,
|
||||||
|
} from "@mui/material";
|
||||||
|
import { useTheme } from "@mui/material/styles";
|
||||||
|
import CloseIcon from "@mui/icons-material/Close";
|
||||||
|
|
||||||
|
const ChangePass = ({ open, setOpen }) => {
|
||||||
|
const theme = useTheme();
|
||||||
|
const fullScreen = useMediaQuery(theme.breakpoints.down("sm"));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dialog fullScreen={fullScreen} maxWidth="sm" fullWidth={true} open={open}
|
||||||
|
onClose={() => {
|
||||||
|
setOpen(false);
|
||||||
|
}}>
|
||||||
|
<Box sx={{ display: "flex", alignItems: "center", justifyContent: "space-between", mx: 1 }}>
|
||||||
|
<DialogTitle sx={{ py: 2, px: 1 }}>
|
||||||
|
تغییر رمز عبور
|
||||||
|
</DialogTitle>
|
||||||
|
<IconButton
|
||||||
|
aria-label="بستن تغییر رمز عبور"
|
||||||
|
onClick={() => {
|
||||||
|
setOpen(false);
|
||||||
|
}}
|
||||||
|
sx={{ color: (theme) => theme.palette.grey[500] }}
|
||||||
|
>
|
||||||
|
<CloseIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Box>
|
||||||
|
<DialogContent dividers>
|
||||||
|
تست
|
||||||
|
</DialogContent>
|
||||||
|
<DialogActions>
|
||||||
|
<Button autoFocus variant="outlined" onClick={() => {
|
||||||
|
setOpen(false);
|
||||||
|
}}>
|
||||||
|
ثبت
|
||||||
|
</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default ChangePass;
|
||||||
0
src/core/components/Profile/Update/form.jsx
Normal file
0
src/core/components/Profile/Update/form.jsx
Normal file
52
src/core/components/Profile/Update/index.jsx
Normal file
52
src/core/components/Profile/Update/index.jsx
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Box,
|
||||||
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogActions,
|
||||||
|
DialogContent,
|
||||||
|
DialogTitle,
|
||||||
|
IconButton,
|
||||||
|
useMediaQuery,
|
||||||
|
} from "@mui/material";
|
||||||
|
import { useTheme } from "@mui/material/styles";
|
||||||
|
import CloseIcon from "@mui/icons-material/Close";
|
||||||
|
|
||||||
|
const Update = ({ open, setOpen }) => {
|
||||||
|
const theme = useTheme();
|
||||||
|
const fullScreen = useMediaQuery(theme.breakpoints.down("sm"));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dialog fullScreen={fullScreen} maxWidth="sm" fullWidth={true} open={open}
|
||||||
|
onClose={() => {
|
||||||
|
setOpen(false);
|
||||||
|
}}>
|
||||||
|
<Box sx={{ display: "flex", alignItems: "center", justifyContent: "space-between", mx: 1 }}>
|
||||||
|
<DialogTitle sx={{ py: 2, px: 1 }}>
|
||||||
|
ویرایش پروفایل
|
||||||
|
</DialogTitle>
|
||||||
|
<IconButton
|
||||||
|
aria-label="بستن ویرایش پروفایل"
|
||||||
|
onClick={() => {
|
||||||
|
setOpen(false);
|
||||||
|
}}
|
||||||
|
sx={{ color: (theme) => theme.palette.grey[500] }}
|
||||||
|
>
|
||||||
|
<CloseIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Box>
|
||||||
|
<DialogContent dividers>
|
||||||
|
form will come here
|
||||||
|
</DialogContent>
|
||||||
|
<DialogActions>
|
||||||
|
<Button autoFocus variant="outlined" onClick={() => {
|
||||||
|
setOpen(false);
|
||||||
|
}}>
|
||||||
|
ثبت
|
||||||
|
</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default Update;
|
||||||
75
src/core/components/Profile/index.jsx
Normal file
75
src/core/components/Profile/index.jsx
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { Avatar, Box, Chip, Divider, IconButton, Stack, Tooltip, Typography } from "@mui/material";
|
||||||
|
import PowerSettingsNewIcon from "@mui/icons-material/PowerSettingsNew";
|
||||||
|
import ModeEditIcon from "@mui/icons-material/ModeEdit";
|
||||||
|
import VpnKeyIcon from "@mui/icons-material/VpnKey";
|
||||||
|
import { useState } from "react";
|
||||||
|
import Update from "@/core/components/Profile/Update";
|
||||||
|
import ChangePass from "@/core/components/Profile/ChangePass";
|
||||||
|
|
||||||
|
const Profile = () => {
|
||||||
|
const [openUpdate, setOpenUpdate] = useState(false);
|
||||||
|
const [openChangePass, setOpenChangePass] = useState(false);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack sx={{
|
||||||
|
px: 2,
|
||||||
|
background: "#f7f7f7",
|
||||||
|
borderTop: "1px dashed #e1e1e1",
|
||||||
|
borderBottom: "1px dashed #e1e1e1",
|
||||||
|
}}>
|
||||||
|
<Box sx={{ display: "flex", alignItems: "center", my: 0.5 }}>
|
||||||
|
<Avatar
|
||||||
|
alt="User Image"
|
||||||
|
src=""
|
||||||
|
sx={{ width: 56, height: 56 }}
|
||||||
|
/>
|
||||||
|
<Stack sx={{ ml: 1 }}>
|
||||||
|
<Box sx={{ display: "flex", alignItems: "end", gap: 0.7 }}>
|
||||||
|
<Typography variant="h6">حسن محمد زاده عبدالله</Typography>
|
||||||
|
</Box>
|
||||||
|
<Typography variant="caption">.: اداره کل ستاد :.</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
|
<Box sx={{ display: "flex", alignItems: "center", my: 0.5 }}>
|
||||||
|
<Typography variant="button" color="#757575">آخرین ورود</Typography>
|
||||||
|
<Divider sx={{ mx: 2, flexGrow: 1 }} />
|
||||||
|
<Typography variant="subtitle2" color="#757575">1 ساعت پیش</Typography>
|
||||||
|
</Box>
|
||||||
|
<Box sx={{ my: 0.5 }}>
|
||||||
|
<Divider>
|
||||||
|
<Chip size="small" label="userName" color="success" variant="outlined" />
|
||||||
|
</Divider>
|
||||||
|
</Box>
|
||||||
|
<Box sx={{ display: "flex", justifyContent: "center" }}>
|
||||||
|
<Tooltip title="ویرایش پروفایل" arrow>
|
||||||
|
<IconButton aria-label="ویرایش پروفایل" color="success" onClick={() => {
|
||||||
|
setOpenUpdate(true);
|
||||||
|
}}>
|
||||||
|
<ModeEditIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
|
<Divider orientation="vertical" variant="middle" flexItem sx={{ mx: 1 }} />
|
||||||
|
<Tooltip title="خروج" arrow>
|
||||||
|
<IconButton aria-label="خروج" color="error">
|
||||||
|
<PowerSettingsNewIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
|
<Divider orientation="vertical" variant="middle" flexItem sx={{ mx: 1 }} />
|
||||||
|
<Tooltip title="تغییر رمز عبور" arrow>
|
||||||
|
<IconButton aria-label="تغییر رمز عبور" color="primary" onClick={() => {
|
||||||
|
setOpenChangePass(true);
|
||||||
|
}}>
|
||||||
|
<VpnKeyIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
|
</Box>
|
||||||
|
</Stack>
|
||||||
|
<Update open={openUpdate} setOpen={setOpenUpdate} />
|
||||||
|
<ChangePass open={openChangePass} setOpen={setOpenChangePass} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default Profile;
|
||||||
@@ -6,6 +6,7 @@ import { usePathname } from "next/navigation";
|
|||||||
import { useEffect, useReducer, useState } from "react";
|
import { useEffect, useReducer, useState } from "react";
|
||||||
import { filterMenuItems } from "../utils/filterMenuItems";
|
import { filterMenuItems } from "../utils/filterMenuItems";
|
||||||
import { pageMenu } from "../utils/pageMenu";
|
import { pageMenu } from "../utils/pageMenu";
|
||||||
|
import Profile from "@/core/components/Profile";
|
||||||
|
|
||||||
function selectPage(item, route) {
|
function selectPage(item, route) {
|
||||||
if (item.type === "page") {
|
if (item.type === "page") {
|
||||||
@@ -35,48 +36,48 @@ function reducer(state, action) {
|
|||||||
return state.map((item) =>
|
return state.map((item) =>
|
||||||
action.id == item.id
|
action.id == item.id
|
||||||
? {
|
? {
|
||||||
...item,
|
...item,
|
||||||
showSubitems: !item.showSubitems,
|
showSubitems: !item.showSubitems,
|
||||||
}
|
}
|
||||||
: item
|
: item,
|
||||||
);
|
);
|
||||||
case "COLLAPSE_SUB_ITEMS":
|
case "COLLAPSE_SUB_ITEMS":
|
||||||
return state.map((item) => {
|
return state.map((item) => {
|
||||||
return item.hasSubitems
|
return item.hasSubitems
|
||||||
? {
|
? {
|
||||||
...item,
|
...item,
|
||||||
Subitems: item.Subitems.map((subitem) =>
|
Subitems: item.Subitems.map((subitem) =>
|
||||||
action.id === subitem.id
|
action.id === subitem.id
|
||||||
? {
|
? {
|
||||||
...subitem,
|
...subitem,
|
||||||
showSubitems: !subitem.showSubitems,
|
showSubitems: !subitem.showSubitems,
|
||||||
}
|
}
|
||||||
: subitem
|
: subitem,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
: item;
|
: item;
|
||||||
});
|
});
|
||||||
case "COLLAPSE_SUB_SECOND_ITEMS":
|
case "COLLAPSE_SUB_SECOND_ITEMS":
|
||||||
return state.map((item) => {
|
return state.map((item) => {
|
||||||
return item.hasSubitems
|
return item.hasSubitems
|
||||||
? {
|
? {
|
||||||
...item,
|
...item,
|
||||||
Subitems: item.Subitems.map((subitem) => {
|
Subitems: item.Subitems.map((subitem) => {
|
||||||
return subitem.hasSubitems
|
return subitem.hasSubitems
|
||||||
? {
|
? {
|
||||||
...subitem,
|
...subitem,
|
||||||
Subitems: subitem.Subitems.map((secondSubitem) =>
|
Subitems: subitem.Subitems.map((secondSubitem) =>
|
||||||
action.id === secondSubitem.id
|
action.id === secondSubitem.id
|
||||||
? {
|
? {
|
||||||
...secondSubitem,
|
...secondSubitem,
|
||||||
showSubitems: !secondSubitem.showSubitems,
|
showSubitems: !secondSubitem.showSubitems,
|
||||||
}
|
}
|
||||||
: secondSubitem
|
: secondSubitem,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
: subitem;
|
: subitem;
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
: item;
|
: item;
|
||||||
});
|
});
|
||||||
case "SELECTED":
|
case "SELECTED":
|
||||||
@@ -105,20 +106,25 @@ const SidebarMenu = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
selectedKey &&
|
selectedKey &&
|
||||||
document.querySelector(`[data-route="${selectedKey}"]`)?.scrollIntoView({
|
document.querySelector(`[data-route="${selectedKey}"]`)?.scrollIntoView({
|
||||||
behavior: "smooth",
|
behavior: "smooth",
|
||||||
block: "center",
|
block: "center",
|
||||||
});
|
});
|
||||||
}, [selectedKey]);
|
}, [selectedKey]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
userPermissions && (
|
<>
|
||||||
<List sx={{ overflow: "auto", flex: 1 }} disablePadding dense>
|
<Profile />
|
||||||
{menuItems.map((menuItem) => {
|
{
|
||||||
return <SidebarListItems dispatch={dispatch} key={menuItem.id} menuItem={menuItem} />;
|
userPermissions && (
|
||||||
})}
|
<List sx={{ overflow: "auto", flex: 1 }} disablePadding dense>
|
||||||
</List>
|
{menuItems.map((menuItem) => {
|
||||||
)
|
return <SidebarListItems dispatch={dispatch} key={menuItem.id} menuItem={menuItem} />;
|
||||||
|
})}
|
||||||
|
</List>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default SidebarMenu;
|
export default SidebarMenu;
|
||||||
|
|||||||
@@ -1,4 +1,23 @@
|
|||||||
import { Security } from "@mui/icons-material";
|
import SpaceDashboardIcon from "@mui/icons-material/SpaceDashboard";
|
||||||
|
import GroupsIcon from "@mui/icons-material/Groups";
|
||||||
|
import AccountTreeIcon from "@mui/icons-material/AccountTree";
|
||||||
|
import FactCheckIcon from "@mui/icons-material/FactCheck";
|
||||||
|
import FireTruckIcon from "@mui/icons-material/FireTruck";
|
||||||
|
import RouteIcon from "@mui/icons-material/Route";
|
||||||
|
import DoorbellIcon from "@mui/icons-material/Doorbell";
|
||||||
|
import ElectricBoltIcon from "@mui/icons-material/ElectricBolt";
|
||||||
|
import CottageIcon from "@mui/icons-material/Cottage";
|
||||||
|
import GppMaybeIcon from "@mui/icons-material/GppMaybe";
|
||||||
|
import GavelIcon from "@mui/icons-material/Gavel";
|
||||||
|
import BallotIcon from "@mui/icons-material/Ballot";
|
||||||
|
import AssistantIcon from "@mui/icons-material/Assistant";
|
||||||
|
import AdminPanelSettingsIcon from "@mui/icons-material/AdminPanelSettings";
|
||||||
|
import MapIcon from "@mui/icons-material/Map";
|
||||||
|
import SpeedIcon from "@mui/icons-material/Speed";
|
||||||
|
import EngineeringIcon from "@mui/icons-material/Engineering";
|
||||||
|
import ReportIcon from "@mui/icons-material/Report";
|
||||||
|
import AssignmentLateIcon from "@mui/icons-material/AssignmentLate";
|
||||||
|
import LineAxisIcon from "@mui/icons-material/LineAxis";
|
||||||
|
|
||||||
export const pageMenu = [
|
export const pageMenu = [
|
||||||
{
|
{
|
||||||
@@ -6,7 +25,7 @@ export const pageMenu = [
|
|||||||
label: "پیشخوان",
|
label: "پیشخوان",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: "/dashboard",
|
route: "/dashboard",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <SpaceDashboardIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["all"],
|
permissions: ["all"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -14,14 +33,14 @@ export const pageMenu = [
|
|||||||
label: "مدیریت کاربران",
|
label: "مدیریت کاربران",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/user_management",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/user_management",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <GroupsIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["full-user-management", "limited-user-management"],
|
permissions: ["full-user-management", "limited-user-management"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "projectsManagment",
|
id: "projectsManagment",
|
||||||
label: "پروژه های راهداری",
|
label: "پروژه های راهداری",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <AccountTreeIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
@@ -29,7 +48,7 @@ export const pageMenu = [
|
|||||||
label: "ثبت قرارداد و پروژه",
|
label: "ثبت قرارداد و پروژه",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/rahdari_projects/finance",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/rahdari_projects/finance",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <GavelIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["show-contract", "show-contract-province"],
|
permissions: ["show-contract", "show-contract-province"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -37,7 +56,7 @@ export const pageMenu = [
|
|||||||
label: "لیست پروژه ها",
|
label: "لیست پروژه ها",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/rahdari_projects/projects_list",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/rahdari_projects/projects_list",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <BallotIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["all"],
|
permissions: ["all"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -45,7 +64,7 @@ export const pageMenu = [
|
|||||||
label: "پروژه های پیشنهادی",
|
label: "پروژه های پیشنهادی",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/rahdari_projects/proposal",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/rahdari_projects/proposal",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <AssistantIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["show-proposal", "show-proposal-province"],
|
permissions: ["show-proposal", "show-proposal-province"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -53,7 +72,7 @@ export const pageMenu = [
|
|||||||
label: "درخواست نمایندگان",
|
label: "درخواست نمایندگان",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/rahdari_projects/lawmakers",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/rahdari_projects/lawmakers",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <AdminPanelSettingsIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["show-lawmaker", "show-lawmaker-province"],
|
permissions: ["show-lawmaker", "show-lawmaker-province"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -61,7 +80,7 @@ export const pageMenu = [
|
|||||||
label: "پراکندگی بر روی نقشه",
|
label: "پراکندگی بر روی نقشه",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=rahdari_projects",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=rahdari_projects",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <MapIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["all"],
|
permissions: ["all"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -70,14 +89,14 @@ export const pageMenu = [
|
|||||||
id: "roadItemManagment",
|
id: "roadItemManagment",
|
||||||
label: "فعالیت های روزانه",
|
label: "فعالیت های روزانه",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <FactCheckIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
id: "roadItemManagmentSupervisor",
|
id: "roadItemManagmentSupervisor",
|
||||||
label: "ارزیابی",
|
label: "ارزیابی",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
@@ -96,7 +115,7 @@ export const pageMenu = [
|
|||||||
id: "roadItemManagmentOparation",
|
id: "roadItemManagmentOparation",
|
||||||
label: "عملیات",
|
label: "عملیات",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
@@ -120,7 +139,7 @@ export const pageMenu = [
|
|||||||
label: "پراکندگی بر روی نقشه",
|
label: "پراکندگی بر روی نقشه",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=road_items",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=road_items",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <MapIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: [
|
permissions: [
|
||||||
"show-road-item-supervise-cartable",
|
"show-road-item-supervise-cartable",
|
||||||
"show-road-item-supervise-cartable-province",
|
"show-road-item-supervise-cartable-province",
|
||||||
@@ -132,7 +151,7 @@ export const pageMenu = [
|
|||||||
label: "گزارش ها",
|
label: "گزارش ها",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_items/report",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_items/report",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <ReportIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: [
|
permissions: [
|
||||||
"show-road-item-supervise-cartable",
|
"show-road-item-supervise-cartable",
|
||||||
"show-road-item-supervise-cartable-province",
|
"show-road-item-supervise-cartable-province",
|
||||||
@@ -145,14 +164,14 @@ export const pageMenu = [
|
|||||||
id: "roadPatrolManagment",
|
id: "roadPatrolManagment",
|
||||||
label: "گشت راهداری و ترابری",
|
label: "گشت راهداری و ترابری",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <FireTruckIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
id: "roadPatrolManagmentSupervisor",
|
id: "roadPatrolManagmentSupervisor",
|
||||||
label: "ارزیابی",
|
label: "ارزیابی",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
@@ -171,7 +190,7 @@ export const pageMenu = [
|
|||||||
id: "roadPatrolManagmentOparation",
|
id: "roadPatrolManagmentOparation",
|
||||||
label: "عملیات",
|
label: "عملیات",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
@@ -195,7 +214,7 @@ export const pageMenu = [
|
|||||||
label: "پراکندگی بر روی نقشه",
|
label: "پراکندگی بر روی نقشه",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=road_patrols",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=road_patrols",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <MapIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: [
|
permissions: [
|
||||||
"add-road-patrol",
|
"add-road-patrol",
|
||||||
"show-road-patrol-supervise-cartable",
|
"show-road-patrol-supervise-cartable",
|
||||||
@@ -207,7 +226,7 @@ export const pageMenu = [
|
|||||||
label: "گزارش ها",
|
label: "گزارش ها",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_patrols/report",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_patrols/report",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <ReportIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: [
|
permissions: [
|
||||||
"add-road-patrol",
|
"add-road-patrol",
|
||||||
"show-road-patrol-supervise-cartable",
|
"show-road-patrol-supervise-cartable",
|
||||||
@@ -220,7 +239,7 @@ export const pageMenu = [
|
|||||||
id: "inquiryPrivacyManagment",
|
id: "inquiryPrivacyManagment",
|
||||||
label: "استعلام حریم راه",
|
label: "استعلام حریم راه",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <DoorbellIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
@@ -250,14 +269,14 @@ export const pageMenu = [
|
|||||||
id: "safetyAndPrivacyManagment",
|
id: "safetyAndPrivacyManagment",
|
||||||
label: "نگهداری حریم راه",
|
label: "نگهداری حریم راه",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <RouteIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
id: "safetyAndPrivacyManagmentOparation",
|
id: "safetyAndPrivacyManagmentOparation",
|
||||||
label: "عملیات",
|
label: "عملیات",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
@@ -285,7 +304,7 @@ export const pageMenu = [
|
|||||||
label: "پراکندگی بر روی نقشه",
|
label: "پراکندگی بر روی نقشه",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=safety_and_privacy",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=safety_and_privacy",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <MapIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: [
|
permissions: [
|
||||||
"show-safety-and-privacy-operator-cartable",
|
"show-safety-and-privacy-operator-cartable",
|
||||||
"show-safety-and-privacy-operator-cartable-province",
|
"show-safety-and-privacy-operator-cartable-province",
|
||||||
@@ -298,7 +317,7 @@ export const pageMenu = [
|
|||||||
label: "گزارش ها",
|
label: "گزارش ها",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/safety_and_privacy/report",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/safety_and_privacy/report",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <ReportIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: [
|
permissions: [
|
||||||
"show-safety-and-privacy-operator-cartable",
|
"show-safety-and-privacy-operator-cartable",
|
||||||
"show-safety-and-privacy-operator-cartable-province",
|
"show-safety-and-privacy-operator-cartable-province",
|
||||||
@@ -312,14 +331,14 @@ export const pageMenu = [
|
|||||||
id: "roadObservationsManagment",
|
id: "roadObservationsManagment",
|
||||||
label: "واکنش سریع",
|
label: "واکنش سریع",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <ElectricBoltIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
id: "roadObservationsManagmentSupervisor",
|
id: "roadObservationsManagmentSupervisor",
|
||||||
label: "ارزیابی",
|
label: "ارزیابی",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
@@ -336,14 +355,14 @@ export const pageMenu = [
|
|||||||
label: "رسیدگی به شکایات",
|
label: "رسیدگی به شکایات",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_observations",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_observations",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <AssignmentLateIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["show-fast-react", "show-fast-react-province", "show-fast-react-edarate-shahri"],
|
permissions: ["show-fast-react", "show-fast-react-province", "show-fast-react-edarate-shahri"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "roadObservationsManagmentOparation",
|
id: "roadObservationsManagmentOparation",
|
||||||
label: "عملیات",
|
label: "عملیات",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
@@ -360,7 +379,7 @@ export const pageMenu = [
|
|||||||
label: "پراکندگی بر روی نقشه",
|
label: "پراکندگی بر روی نقشه",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=road_observations",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=road_observations",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <MapIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["all"],
|
permissions: ["all"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -368,7 +387,7 @@ export const pageMenu = [
|
|||||||
label: "گزارش ها",
|
label: "گزارش ها",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_observations/report/index",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_observations/report/index",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <ReportIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["all"],
|
permissions: ["all"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -377,7 +396,7 @@ export const pageMenu = [
|
|||||||
id: "winterCampManagment",
|
id: "winterCampManagment",
|
||||||
label: "قرارگاه زمستانی",
|
label: "قرارگاه زمستانی",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <CottageIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
@@ -385,7 +404,7 @@ export const pageMenu = [
|
|||||||
label: "محور های انسدادی",
|
label: "محور های انسدادی",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/winter_camp",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/winter_camp",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <LineAxisIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["show-camp", "show-camp-province"],
|
permissions: ["show-camp", "show-camp-province"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -393,7 +412,7 @@ export const pageMenu = [
|
|||||||
label: "محور های حلقه اول",
|
label: "محور های حلقه اول",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=camp",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=camp",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <LineAxisIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["show-camp", "show-camp-province"],
|
permissions: ["show-camp", "show-camp-province"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -401,7 +420,7 @@ export const pageMenu = [
|
|||||||
label: "گزارش ها",
|
label: "گزارش ها",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=campNew",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=campNew",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <ReportIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["show-camp", "show-camp-province"],
|
permissions: ["show-camp", "show-camp-province"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -410,14 +429,14 @@ export const pageMenu = [
|
|||||||
id: "receiptManagment",
|
id: "receiptManagment",
|
||||||
label: "خسارات وارده بر ابنیه فنی و تاسیسات راه",
|
label: "خسارات وارده بر ابنیه فنی و تاسیسات راه",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <GppMaybeIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
id: "receiptManagmentOparation",
|
id: "receiptManagmentOparation",
|
||||||
label: "عملیات",
|
label: "عملیات",
|
||||||
type: "menu",
|
type: "menu",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
hasSubitems: true,
|
hasSubitems: true,
|
||||||
Subitems: [
|
Subitems: [
|
||||||
{
|
{
|
||||||
@@ -434,7 +453,7 @@ export const pageMenu = [
|
|||||||
label: "گزارش ها",
|
label: "گزارش ها",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/receipt/report",
|
route: process.env.NEXT_PUBLIC_API_URL + "/v2/receipt/report",
|
||||||
icon: <Security sx={{ width: "inherit", height: "inherit" }} />,
|
icon: <ReportIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||||
permissions: ["all"],
|
permissions: ["all"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { createContext, useCallback, useEffect, useState } from "react";
|
import { createContext, useCallback, useEffect, useState } from "react";
|
||||||
import LZString from "lz-string";
|
import LZString from "lz-string";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user