"use client"; import AppHeader from "@comp/AppHeader/page"; import PositionEmployees from "@comp/EmployeesComponent/Position/page"; import RolesEmployees from "@comp/EmployeesComponent/Roles/page"; import Roles from "@comp/EmployeesComponent/Roles/page"; import SectionEmployees from "@comp/EmployeesComponent/Sections/page"; import UsersEmployees from "@comp/EmployeesComponent/Users/page"; import RoutineEmployees from "@comp/EmployeesComponent/routine/page"; import AppContext from "@ctx/AppContext"; import BottomSheetCreateEmployees from "plugins/BottomSheet/BottomSheetCreateEmployees"; import BottomSheetCreatePosition from "plugins/BottomSheet/BottomSheetCreatePosition"; import BottomSheetCreateRole from "plugins/BottomSheet/BottomSheetCreateRole"; import BottomSheetCreateRoutine from "plugins/BottomSheet/BottomSheetCreateRoutine"; import BottomSheetCreateSection from "plugins/BottomSheet/BottomSheetCreateSection"; import BottomSheetCreateShifts from "plugins/BottomSheet/BottomSheetCreateShifts"; import PersianNumber from "plugins/PersianNumber"; import React, { useContext, useEffect, useState } from "react"; import ShiftsEmployees from "@comp/EmployeesComponent/Shifts/page"; import ParseJwt from "plugins/ParseJwt/page"; import GoBack from "plugins/GoBack/page"; import HasPermission from "plugins/HasPermission/page"; // import second from "@img/test.png"; const Employees = (props) => { const CTX = useContext(AppContext); const permissions = CTX.state.profile?.permissions; const [activeSection, setActiveSection] = useState(0); useEffect(() => { CTX.GetRoutines(); }, []); const handleGetApi = (num) => { setActiveSection(num); switch (num) { case 0: if (activeSection != num) { CTX.GetRoutines(); } break; case 1: if (activeSection != num) { CTX.GetSections(); } break; case 2: if (activeSection != num) { CTX.GetPositions(); CTX.GetSections(); } break; case 3: if (activeSection != num) { CTX.GetUsers(); if (HasPermission("ViewRoles", permissions)) { CTX.GetRoles(); } } break; case 4: if (activeSection != num) { CTX.GetShifts(); CTX.GetRoutines(); } break; default: break; } }; // const justLength = CTX.state.justLength; return (
{ GoBack(); }} />
handleGetApi(0)} >

مدیریت روتین های مجموعه

شما {/* */} روتین فعال دارید

{HasPermission("ManageRoutines", permissions) && ( <> {" "} {activeSection == 0 ? (
CTX.setBottomSheetCreateRoutineOpen(true)} >
) : (
)} )}
{activeSection == 0 && }
{/*

مدیریت نقش های مجموعه

شما نقش فعال دارید

CTX.setBottomSheetCreateRoleOpen(true)} >
*/}
handleGetApi(1)} >

مدیریت سکشن ها مجموعه

شما {/* */} سکشن فعال دارید

{HasPermission("ManageSections", permissions) && ( <> {activeSection == 1 ? (
CTX.setBottomSheetCreateSectionOpen(true)} >
) : (
)} )}
{activeSection == 1 && }
handleGetApi(2)} >

مدیریت پوزیشن های مجموعه

شما {/* */} پوزیشن فعال دارید

{HasPermission("ManagePositions", permissions) && ( <> {activeSection == 2 ? (
CTX.setBottomSheetCreatePositionOpen(true)} >
) : (
)} )}
{activeSection == 2 && }
handleGetApi(3)} >

مدیریت کارکنان مجموعه

شما {/* */} کارمند فعال دارید

{HasPermission("ManageUsers", permissions) && ( <> {activeSection == 3 ? (
CTX.setBottomSheetCreateEmployeesOpen(true)} >
) : (
)} )}
{activeSection == 3 && }
handleGetApi(4)} >

مدیریت شیفت های مجموعه

شما {/* */} شیفت فعال دارید

{HasPermission("ManageShifts", permissions) && ( <> {activeSection == 4 ? (
CTX.setBottomSheetCreateShiftsOpen(true)} >
) : (
)} )}
{activeSection == 4 && }
{/* */}
); }; export default Employees;