first notion bugs
parent
076c70f156
commit
571af306c1
6
.env
6
.env
|
@ -1,8 +1,8 @@
|
|||
NODE_ENV="development"
|
||||
|
||||
NEXT_PUBLIC_SERVER_URL=http://192.168.189.123:32769
|
||||
NEXT_PUBLIC_PUBLIC_URL=http://192.168.189.123:32769
|
||||
NEXT_PUBLIC_API_URL=http://192.168.189.123:32769/api
|
||||
NEXT_PUBLIC_SERVER_URL=http://192.168.88.251:32769
|
||||
NEXT_PUBLIC_PUBLIC_URL=http://192.168.88.251:32769
|
||||
NEXT_PUBLIC_API_URL=http://192.168.88.251:32769/api
|
||||
|
||||
# SECURE_LOCAL_STORAGE_HASH_KEY=f1da2b2c7a4c446934267fea631102ec389b5b99
|
||||
# NEXT_PUBLIC_API_URL_IMAGE=https://192.168.88.12:49154/Files/ReportImages
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
import Avatar from "boring-avatars";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React from "react";
|
||||
import React, { useContext } from "react";
|
||||
import { useLongPress } from "@uidotdev/usehooks";
|
||||
import { toast } from "react-toastify";
|
||||
import AppContext from "@ctx/AppContext";
|
||||
|
||||
const AppHeader = ({
|
||||
title,
|
||||
|
@ -27,8 +28,10 @@ const AppHeader = ({
|
|||
logOut,
|
||||
}) => {
|
||||
const router = useRouter();
|
||||
const CTX = useContext(AppContext);
|
||||
|
||||
const handlelogOut = () => {
|
||||
CTX.setStepLogin(0);
|
||||
localStorage.removeItem("token");
|
||||
router.push("/login");
|
||||
};
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
"use client";
|
||||
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import HasPermission from "plugins/HasPermission/page";
|
||||
import React, { useContext } from "react";
|
||||
|
||||
const PositionEmployees = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
const positionsData = CTX.state.positionsData;
|
||||
const permissions = CTX.state.profile?.permissions;
|
||||
|
||||
const goToEditPosition = (id) => {
|
||||
CTX.setGoToEditPosition(true);
|
||||
|
@ -24,49 +26,54 @@ const PositionEmployees = () => {
|
|||
{e.name}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
className="w-[30px] h-[30px] bg-secondaryLighter-100 rounded-full"
|
||||
onClick={() => goToEditPosition(e.id)}
|
||||
>
|
||||
<svg
|
||||
width="13"
|
||||
height="13"
|
||||
viewBox="0 0 18 18"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[8px]"
|
||||
>
|
||||
<g clip-path="url(#clip0_72_994)">
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<g opacity="0.5">
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_72_994">
|
||||
<rect width="18" height="18" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
{HasPermission("ManagePositions", permissions) && (
|
||||
<>
|
||||
<div
|
||||
className="w-[30px] h-[30px] bg-secondaryLighter-100 rounded-full"
|
||||
onClick={() => goToEditPosition(e.id)}
|
||||
>
|
||||
<svg
|
||||
width="13"
|
||||
height="13"
|
||||
viewBox="0 0 18 18"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[8px]"
|
||||
>
|
||||
<g clip-path="url(#clip0_72_994)">
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<g opacity="0.5">
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_72_994">
|
||||
<rect width="18" height="18" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
"use client";
|
||||
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import HasPermission from "plugins/HasPermission/page";
|
||||
import React, { useContext } from "react";
|
||||
|
||||
const SectionEmployees = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
const permissions = CTX.state.profile?.permissions;
|
||||
|
||||
const sectionsData = CTX.state.sectionsData;
|
||||
const goToEditSection = (id) => {
|
||||
CTX.setGoToEditSection(true);
|
||||
|
@ -23,49 +26,54 @@ const SectionEmployees = () => {
|
|||
{e.name}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
className="w-[30px] h-[30px] bg-secondaryLighter-100 rounded-full"
|
||||
onClick={() => goToEditSection(e.id)}
|
||||
>
|
||||
<svg
|
||||
width="13"
|
||||
height="13"
|
||||
viewBox="0 0 18 18"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[8px]"
|
||||
>
|
||||
<g clip-path="url(#clip0_72_994)">
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<g opacity="0.5">
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_72_994">
|
||||
<rect width="18" height="18" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
{HasPermission("ManageSections", permissions) && (
|
||||
<>
|
||||
<div
|
||||
className="w-[30px] h-[30px] bg-secondaryLighter-100 rounded-full"
|
||||
onClick={() => goToEditSection(e.id)}
|
||||
>
|
||||
<svg
|
||||
width="13"
|
||||
height="13"
|
||||
viewBox="0 0 18 18"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[8px]"
|
||||
>
|
||||
<g clip-path="url(#clip0_72_994)">
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<g opacity="0.5">
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_72_994">
|
||||
<rect width="18" height="18" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import { DaysOfWeek } from "plugins/DaysOfWeek/page";
|
||||
import HasPermission from "plugins/HasPermission/page";
|
||||
import PersianNumber from "plugins/PersianNumber";
|
||||
import { getTimeOfDay } from "plugins/TimeOfDay/page";
|
||||
import React, { useContext } from "react";
|
||||
|
@ -9,6 +10,7 @@ import React, { useContext } from "react";
|
|||
const ShiftsEmployees = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
const shiftsData = CTX.state.shiftsData;
|
||||
const permissions = CTX.state.profile?.permissions;
|
||||
|
||||
const goToEditUser = (id) => {
|
||||
CTX.setGoToEditShift(true);
|
||||
|
@ -30,49 +32,54 @@ const ShiftsEmployees = () => {
|
|||
{e?.title}{" "}
|
||||
</h4>
|
||||
</div>
|
||||
<div
|
||||
className="w-[35px] h-[35px] bg-secondaryLighter-100 rounded-full pt-[3px]"
|
||||
onClick={() => goToEditUser(e.id)}
|
||||
>
|
||||
<svg
|
||||
width="13"
|
||||
height="13"
|
||||
viewBox="0 0 18 18"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[8px]"
|
||||
>
|
||||
<g clip-path="url(#clip0_72_994)">
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<g opacity="0.5">
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_72_994">
|
||||
<rect width="18" height="18" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
{HasPermission("ManageShifts", permissions) && (
|
||||
<>
|
||||
<div
|
||||
className="w-[35px] h-[35px] bg-secondaryLighter-100 rounded-full pt-[3px]"
|
||||
onClick={() => goToEditUser(e.id)}
|
||||
>
|
||||
<svg
|
||||
width="13"
|
||||
height="13"
|
||||
viewBox="0 0 18 18"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[8px]"
|
||||
>
|
||||
<g clip-path="url(#clip0_72_994)">
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<g opacity="0.5">
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_72_994">
|
||||
<rect width="18" height="18" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="py-2 px-3">
|
||||
|
|
|
@ -4,10 +4,12 @@ import AppContext from "@ctx/AppContext";
|
|||
import React, { useContext } from "react";
|
||||
import Avatar from "boring-avatars";
|
||||
import PersianNumber from "plugins/PersianNumber";
|
||||
import HasPermission from "plugins/HasPermission/page";
|
||||
|
||||
const UsersEmployees = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
const usersData = CTX.state.usersData;
|
||||
const permissions = CTX.state.profile?.permissions;
|
||||
|
||||
const goToEditUser = (id) => {
|
||||
CTX.setGoToEditUser(true);
|
||||
|
@ -44,49 +46,53 @@ const UsersEmployees = () => {
|
|||
</p>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<div
|
||||
className="w-[35px] h-[35px] bg-secondaryLighter-100 rounded-full pt-[3px]"
|
||||
onClick={() => goToEditUser(e.userId)}
|
||||
>
|
||||
<svg
|
||||
width="13"
|
||||
height="13"
|
||||
viewBox="0 0 18 18"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[8px]"
|
||||
>
|
||||
<g clip-path="url(#clip0_72_994)">
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<g opacity="0.5">
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_72_994">
|
||||
<rect width="18" height="18" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
</div>
|
||||
{HasPermission("ManageUsers", permissions) && (
|
||||
<>
|
||||
<div
|
||||
className="w-[35px] h-[35px] bg-secondaryLighter-100 rounded-full pt-[3px]"
|
||||
onClick={() => goToEditUser(e.userId)}
|
||||
>
|
||||
<svg
|
||||
width="13"
|
||||
height="13"
|
||||
viewBox="0 0 18 18"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[8px]"
|
||||
>
|
||||
<g clip-path="url(#clip0_72_994)">
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<g opacity="0.5">
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_72_994">
|
||||
<rect width="18" height="18" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
"use client";
|
||||
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import HasPermission from "plugins/HasPermission/page";
|
||||
import React, { useContext } from "react";
|
||||
|
||||
const RoutineEmployees = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
const routinesData = CTX.state.routinesData;
|
||||
const permissions = CTX.state.profile?.permissions;
|
||||
|
||||
const goToEditRoutine = (id) => {
|
||||
CTX.setGoToEditRoutine(true);
|
||||
|
@ -24,49 +26,53 @@ const RoutineEmployees = () => {
|
|||
{e.name}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
className="w-[30px] h-[30px] bg-secondaryLighter-100 rounded-full"
|
||||
onClick={() => goToEditRoutine(e.id)}
|
||||
>
|
||||
<svg
|
||||
width="13"
|
||||
height="13"
|
||||
viewBox="0 0 18 18"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[8px]"
|
||||
>
|
||||
<g clip-path="url(#clip0_72_994)">
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<g opacity="0.5">
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_72_994">
|
||||
<rect width="18" height="18" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
</div>
|
||||
{HasPermission("ManageRoutines", permissions) && (
|
||||
<>
|
||||
<div
|
||||
className="w-[30px] h-[30px] bg-secondaryLighter-100 rounded-full"
|
||||
onClick={() => goToEditRoutine(e.id)}
|
||||
>
|
||||
<svg
|
||||
width="13"
|
||||
height="13"
|
||||
viewBox="0 0 18 18"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[8px]"
|
||||
>
|
||||
<g clip-path="url(#clip0_72_994)">
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M11.4653 2.36397L10.77 3.05922L4.37926 9.44922C3.94651 9.88272 3.72976 10.0995 3.54376 10.338C3.32409 10.6194 3.13573 10.924 2.98201 11.2462C2.85226 11.5192 2.75551 11.8102 2.56201 12.3907L1.74151 14.8515L1.54051 15.453C1.4935 15.5932 1.48652 15.7437 1.52037 15.8877C1.55422 16.0316 1.62755 16.1633 1.73212 16.2679C1.83669 16.3724 1.96835 16.4458 2.1123 16.4796C2.25626 16.5135 2.4068 16.5065 2.54701 16.4595L3.14851 16.2585L5.60926 15.438C6.19051 15.2445 6.48076 15.1477 6.75376 15.018C7.07626 14.8642 7.38076 14.676 7.66201 14.4562C7.90051 14.2702 8.11726 14.0535 8.55001 13.6207L14.9408 7.22997L15.636 6.53472C16.1891 5.98165 16.4998 5.23152 16.4998 4.44935C16.4998 3.66718 16.1891 2.91705 15.636 2.36397C15.0829 1.8109 14.3328 1.50018 13.5506 1.50018C12.7685 1.50018 12.0183 1.8109 11.4653 2.36397Z"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<g opacity="0.5">
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#DA4215"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
<path
|
||||
d="M10.77 3.05847C10.77 3.05847 10.857 4.53597 12.1605 5.83947C13.464 7.14297 14.9408 7.22922 14.9408 7.22922M3.14852 16.2585L1.74152 14.85"
|
||||
stroke="#D03405"
|
||||
stroke-width="1.5"
|
||||
/>
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_72_994">
|
||||
<rect width="18" height="18" fill="white" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
|
|
@ -28,10 +28,12 @@ const ActivityCard = ({ data }) => {
|
|||
);
|
||||
|
||||
const handleConditionTaskCircle = () => {
|
||||
if (conditionTask == 3 || conditionTask == 4) {
|
||||
return;
|
||||
} else {
|
||||
setConditionTask(1);
|
||||
if (data.status != 2 && data.status != 3 && data.status != 4) {
|
||||
if (conditionTask == 3 || conditionTask == 4) {
|
||||
return;
|
||||
} else {
|
||||
setConditionTask(1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -47,37 +49,59 @@ const ActivityCard = ({ data }) => {
|
|||
|
||||
return (
|
||||
<div
|
||||
className={`shadow-sm rounded-3xl p-2 mt-4 overflow-hidden ${
|
||||
className={` p-2 overflow-hidden ${
|
||||
conditionTask == 3 ||
|
||||
conditionTask == 4 ||
|
||||
data?.status == 4 ||
|
||||
data?.status == 2 ||
|
||||
data?.status == 3
|
||||
? "fuck-click "
|
||||
: "bg-white "
|
||||
: "border-b border-gray-200"
|
||||
}`}
|
||||
>
|
||||
<div className="flex">
|
||||
<div className="flex">
|
||||
<div className="bg-secondary-50 flex rounded-full w-fit ">
|
||||
<div className="relative pr-2 text-[11px] rounded-full text-secondary-200">
|
||||
{data?.scheduleType == 0
|
||||
? "روزانه"
|
||||
: data?.scheduleType == 1
|
||||
? "هفتگی"
|
||||
: data?.scheduleType == 2
|
||||
? "مخصوص"
|
||||
: ""}
|
||||
</div>
|
||||
<p className="mb-0 px-1 text-[10px] mt-1 text-secondary-200 opacity-60">
|
||||
-
|
||||
</p>
|
||||
<div className=" w-fit relative pl-2 text-[11px] rounded-full text-secondary-200">
|
||||
{data?.shiftTitle}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex mt-3">
|
||||
<div
|
||||
className={`w-[60px] h-[50px] border-2 rounded-full ml-3 tr03 ${
|
||||
className={`w-[40px] h-[35px] border-[2px] rounded-full ml-3 tr03 ${
|
||||
conditionTask == 1
|
||||
? "animate-spin-slow duration-700 border-gray-700 border-dashed"
|
||||
? "animate-spin-slow duration-700 border-gray-400 border-dashed"
|
||||
: conditionTask == 2 || conditionTask == 4 || data?.status == 4
|
||||
? "border-red-600"
|
||||
: conditionTask == 3 || data?.status == 2 || data?.status == 3
|
||||
? "border-primary-200"
|
||||
: "border-gray-700 border-dashed"
|
||||
: "border-gray-500 border-dashed"
|
||||
}`}
|
||||
onClick={() => handleConditionTaskCircle()}
|
||||
>
|
||||
{conditionTask == 2 || conditionTask == 4 || data?.status == 4 ? (
|
||||
<svg
|
||||
width="20"
|
||||
height="20"
|
||||
width="11"
|
||||
height="11"
|
||||
viewBox="0 0 167 168"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-3 "
|
||||
className="mx-auto mt-[9px] "
|
||||
>
|
||||
<path
|
||||
d="M95.7504 84.0002L164.834 14.9169C166.199 13.3227 166.912 11.2721 166.831 9.1748C166.75 7.0775 165.881 5.08801 164.397 3.60389C162.913 2.11976 160.923 1.25032 158.826 1.16931C156.729 1.0883 154.678 1.80169 153.084 3.16691L84.0004 72.2502L14.9171 3.08358C13.3479 1.51438 11.2196 0.632812 9.00043 0.632812C6.78125 0.632812 4.65296 1.51438 3.08376 3.08358C1.51456 4.65277 0.632996 6.78106 0.632996 9.00024C0.632996 11.2194 1.51456 13.3477 3.08376 14.9169L72.2504 84.0002L3.08376 153.084C2.21141 153.831 1.50291 154.75 1.00272 155.784C0.502522 156.818 0.221437 157.944 0.177108 159.091C0.132779 160.239 0.326158 161.384 0.745113 162.453C1.16407 163.522 1.79955 164.494 2.61168 165.306C3.4238 166.118 4.39503 166.753 5.4644 167.172C6.53378 167.591 7.67821 167.785 8.82587 167.74C9.97353 167.696 11.0996 167.415 12.1335 166.915C13.1674 166.414 14.0867 165.706 14.8338 164.834L84.0004 95.7502L153.084 164.834C154.678 166.199 156.729 166.912 158.826 166.831C160.923 166.75 162.913 165.881 164.397 164.397C165.881 162.912 166.75 160.923 166.831 158.826C166.912 156.728 166.199 154.678 164.834 153.084L95.7504 84.0002Z"
|
||||
|
@ -86,12 +110,12 @@ const ActivityCard = ({ data }) => {
|
|||
</svg>
|
||||
) : conditionTask == 3 || data?.status == 2 || data?.status == 3 ? (
|
||||
<svg
|
||||
width="37"
|
||||
height="37"
|
||||
width="25"
|
||||
height="25"
|
||||
viewBox="0 0 300 300"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-1 "
|
||||
className="mx-auto mt-[3px] "
|
||||
>
|
||||
<path
|
||||
d="M57.062 155.087C56.2612 154.132 55.2777 153.345 54.1692 152.774C53.0607 152.203 51.8494 151.859 50.6062 151.762C49.363 151.665 48.113 151.817 46.9292 152.209C45.7455 152.6 44.6518 153.225 43.7122 154.044C42.7727 154.864 42.0061 155.863 41.4574 156.983C40.9087 158.103 40.5889 159.321 40.5167 160.566C40.4445 161.811 40.6214 163.057 41.037 164.233C41.4526 165.409 42.0985 166.49 42.937 167.412L57.062 155.087ZM89.287 206.25L82.2245 212.412C83.1045 213.421 84.19 214.228 85.4082 214.782C86.6264 215.336 87.949 215.622 89.287 215.622C90.6251 215.622 91.9477 215.336 93.1658 214.782C94.384 214.228 95.4696 213.421 96.3495 212.412L89.287 206.25ZM194.562 99.9125C195.401 98.9896 196.046 97.9086 196.462 96.7329C196.878 95.5573 197.055 94.3105 196.982 93.0657C196.91 91.8208 196.59 90.6028 196.042 89.4831C195.493 88.3633 194.726 87.3643 193.787 86.5445C192.847 85.7247 191.754 85.1005 190.57 84.7086C189.386 84.3166 188.136 84.1648 186.893 84.2619C185.65 84.359 184.438 84.7032 183.33 85.2742C182.221 85.8452 181.238 86.6317 180.437 87.5875L194.562 99.9125ZM131.325 143.837C129.749 145.718 128.973 148.142 129.164 150.589C129.355 153.035 130.498 155.309 132.347 156.922C134.196 158.536 136.604 159.36 139.053 159.218C141.503 159.076 143.799 157.979 145.45 156.162L131.325 143.837ZM120.9 184.287C121.738 183.365 122.384 182.284 122.8 181.108C123.215 179.932 123.392 178.686 123.32 177.441C123.248 176.196 122.928 174.978 122.379 173.858C121.83 172.738 121.064 171.739 120.124 170.919C119.185 170.1 118.091 169.475 116.907 169.084C115.724 168.692 114.474 168.54 113.23 168.637C111.987 168.734 110.776 169.078 109.667 169.649C108.559 170.22 107.575 171.007 106.775 171.962L120.9 184.287ZM42.937 167.412L82.2245 212.412L96.3495 200.087L57.062 155.087L42.937 167.412ZM96.3495 212.412L120.9 184.287L106.775 171.962L82.2245 200.087L96.3495 212.412ZM145.45 156.162L170.012 128.037L155.887 115.712L131.325 143.837L145.45 156.162ZM170.012 128.037L194.562 99.9125L180.437 87.5875L155.887 115.712L170.012 128.037Z"
|
||||
|
@ -111,7 +135,7 @@ const ActivityCard = ({ data }) => {
|
|||
</div>
|
||||
<div className="w-full">
|
||||
<h3
|
||||
className={`text-base font-bold tr03 ${
|
||||
className={`text-sm font-medium tr03 ${
|
||||
conditionTask == 2 || conditionTask == 4 || data?.status == 4
|
||||
? "text-red-600"
|
||||
: "text-primary-300"
|
||||
|
@ -130,44 +154,14 @@ const ActivityCard = ({ data }) => {
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={`flex mx-2 mt-3 tr03 ${
|
||||
className={`flex mx-2 tr03 ${
|
||||
conditionTask == 1 || conditionTask == 2
|
||||
? "relative top-[300px] h-0"
|
||||
: " relative top-0 h-fit "
|
||||
}`}
|
||||
>
|
||||
<div className="bg-secondaryLighter-100 w-fit relative p-2 text-[12px] my-2 mx-1 rounded-3xl text-secondary-200">
|
||||
{data?.scheduleType == 0
|
||||
? "روزانه"
|
||||
: data?.scheduleType == 1
|
||||
? "هفتگی"
|
||||
: data?.scheduleType == 2
|
||||
? "مخصوص"
|
||||
: ""}
|
||||
</div>
|
||||
<div className="bg-secondaryLighter-100 w-fit relative p-2 text-[12px] my-2 mx-1 rounded-3xl text-secondary-200">
|
||||
{data?.shiftTitle}{" "}
|
||||
</div>
|
||||
|
||||
<div className="flex bg-gray-100 p-1 rounded-full m-1 justify-start h-fit mt-2">
|
||||
<div
|
||||
className="w-[26px] h-[26px] rounded-full bg-gray-400 "
|
||||
// onClick={() => deleteSearchUser(e)}
|
||||
>
|
||||
<Avatar
|
||||
size={26}
|
||||
name={data?.userFullName}
|
||||
variant="beam"
|
||||
colors={["#9d9f88", "#83af96", "#b2de93"]}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p className="mb-0 px-3 text-sm mt-1">{data?.userFirstName}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
></div>
|
||||
|
||||
<div
|
||||
className={`flex justify-between rtl mt-3 tr03 ${
|
||||
|
@ -177,16 +171,16 @@ const ActivityCard = ({ data }) => {
|
|||
}`}
|
||||
>
|
||||
<div
|
||||
className="w-[50px] h-[50px] rounded-full bg-sky-600 pt-4"
|
||||
className="w-[35px] h-[35px] rounded-full bg-sky-600 pt-4"
|
||||
onClick={() => setConditionTask(0)}
|
||||
>
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
width="14"
|
||||
height="14"
|
||||
viewBox="0 0 150 88"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto"
|
||||
className="mx-auto mt-[-5px]"
|
||||
>
|
||||
<path
|
||||
d="M137.5 75L75 12.5L12.5 75"
|
||||
|
@ -200,12 +194,12 @@ const ActivityCard = ({ data }) => {
|
|||
<div className="flex ">
|
||||
{" "}
|
||||
<div
|
||||
className="w-[50px] h-[50px] rounded-full bg-primary-200 pt-1 mx-2"
|
||||
className="w-[35px] h-[35px] rounded-full bg-primary-200 pt-1 mx-2"
|
||||
onClick={() => handleDone()}
|
||||
>
|
||||
<svg
|
||||
width="37"
|
||||
height="37"
|
||||
width="25"
|
||||
height="25"
|
||||
viewBox="0 0 300 300"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
@ -225,16 +219,16 @@ const ActivityCard = ({ data }) => {
|
|||
</svg>
|
||||
</div>
|
||||
<div
|
||||
className="w-[50px] h-[50px] rounded-full bg-red-600 pt-4"
|
||||
className="w-[35px] h-[35px] rounded-full bg-red-600 pt-4"
|
||||
onClick={() => setConditionTask(2)}
|
||||
>
|
||||
<svg
|
||||
width="15"
|
||||
height="15"
|
||||
viewBox="0 0 167 168"
|
||||
width="12"
|
||||
height="12"
|
||||
viewBox="0 0 166 168"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto "
|
||||
className="mx-auto mt-[-4px] "
|
||||
>
|
||||
<path
|
||||
d="M95.7504 84.0002L164.834 14.9169C166.199 13.3227 166.912 11.2721 166.831 9.1748C166.75 7.0775 165.881 5.08801 164.397 3.60389C162.913 2.11976 160.923 1.25032 158.826 1.16931C156.729 1.0883 154.678 1.80169 153.084 3.16691L84.0004 72.2502L14.9171 3.08358C13.3479 1.51438 11.2196 0.632812 9.00043 0.632812C6.78125 0.632812 4.65296 1.51438 3.08376 3.08358C1.51456 4.65277 0.632996 6.78106 0.632996 9.00024C0.632996 11.2194 1.51456 13.3477 3.08376 14.9169L72.2504 84.0002L3.08376 153.084C2.21141 153.831 1.50291 154.75 1.00272 155.784C0.502522 156.818 0.221437 157.944 0.177108 159.091C0.132779 160.239 0.326158 161.384 0.745113 162.453C1.16407 163.522 1.79955 164.494 2.61168 165.306C3.4238 166.118 4.39503 166.753 5.4644 167.172C6.53378 167.591 7.67821 167.785 8.82587 167.74C9.97353 167.696 11.0996 167.415 12.1335 166.915C13.1674 166.414 14.0867 165.706 14.8338 164.834L84.0004 95.7502L153.084 164.834C154.678 166.199 156.729 166.912 158.826 166.831C160.923 166.75 162.913 165.881 164.397 164.397C165.881 162.912 166.75 160.923 166.831 158.826C166.912 156.728 166.199 154.678 164.834 153.084L95.7504 84.0002Z"
|
||||
|
@ -250,7 +244,7 @@ const ActivityCard = ({ data }) => {
|
|||
className={`tr03 ${
|
||||
conditionTask == 2
|
||||
? "relative h-fit "
|
||||
: " relative h-0 overflow-hidden "
|
||||
: "relative h-0 overflow-hidden "
|
||||
}`}
|
||||
>
|
||||
<div className="">
|
||||
|
@ -272,7 +266,8 @@ const ActivityCard = ({ data }) => {
|
|||
"required"
|
||||
)}
|
||||
textarea={true}
|
||||
theme={1}
|
||||
theme={0}
|
||||
mt={"2"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -72,18 +72,18 @@ const ActivityCardCloseShift = ({ data }) => {
|
|||
|
||||
return (
|
||||
<div
|
||||
className={`shadow-sm rounded-3xl p-3 mt-4 overflow-hidden tr03 ${
|
||||
className={`border-b border-gray-200 p-2 overflow-hidden tr03 mt-3 ${
|
||||
conditionTask == 3 ||
|
||||
conditionTask == 4 ||
|
||||
data?.status == 4 ||
|
||||
data?.status == 2 ||
|
||||
data?.status == 3
|
||||
? "fuck-click bg-white "
|
||||
: "bg-white "
|
||||
? "fuck-click "
|
||||
: "border-b border-gray-200"
|
||||
} ${
|
||||
completeActivities?.find((e) => e.activityId == data?.id)
|
||||
?.isCompleted != data?.isDone
|
||||
? "!bg-yellow-100"
|
||||
? "!bg-yellow-100 rounded-xl"
|
||||
: ""
|
||||
}`}
|
||||
onClick={() => {
|
||||
|
@ -95,26 +95,48 @@ const ActivityCardCloseShift = ({ data }) => {
|
|||
}}
|
||||
>
|
||||
<div className="flex">
|
||||
<div className="flex">
|
||||
<div className="bg-secondary-50 flex rounded-full w-fit ">
|
||||
<div className="relative pr-2 text-[11px] rounded-full text-secondary-200">
|
||||
{data?.scheduleType == 0
|
||||
? "روزانه"
|
||||
: data?.scheduleType == 1
|
||||
? "هفتگی"
|
||||
: data?.scheduleType == 2
|
||||
? "مخصوص"
|
||||
: ""}
|
||||
</div>
|
||||
<p className="mb-0 px-1 text-[10px] mt-1 text-secondary-200 opacity-60">
|
||||
-
|
||||
</p>
|
||||
<div className=" w-fit relative pl-2 text-[11px] rounded-full text-secondary-200">
|
||||
{data?.shiftTitle}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex mt-3">
|
||||
<div
|
||||
className={`w-[60px] h-[50px] border-2 rounded-full ml-3 tr03 ${
|
||||
className={`w-[40px] h-[35px] border-[2px] rounded-full ml-3 tr03 ${
|
||||
conditionTask == 1
|
||||
? "animate-spin-slow duration-700 border-gray-700 border-dashed"
|
||||
? "animate-spin-slow duration-700 border-gray-400 border-dashed"
|
||||
: conditionTask == 2 || conditionTask == 4 || data?.status == 4
|
||||
? "border-red-600"
|
||||
: conditionTask == 3 || data?.status == 2 || data?.status == 3
|
||||
? "border-primary-200"
|
||||
: "border-gray-700 border-dashed"
|
||||
: "border-gray-500 border-dashed"
|
||||
}`}
|
||||
onClick={() => handleConditionTaskCircle()}
|
||||
>
|
||||
{conditionTask == 2 || conditionTask == 4 || data?.status == 4 ? (
|
||||
<svg
|
||||
width="20"
|
||||
height="20"
|
||||
width="11"
|
||||
height="11"
|
||||
viewBox="0 0 167 168"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-3 "
|
||||
className="mx-auto mt-[9px] "
|
||||
>
|
||||
<path
|
||||
d="M95.7504 84.0002L164.834 14.9169C166.199 13.3227 166.912 11.2721 166.831 9.1748C166.75 7.0775 165.881 5.08801 164.397 3.60389C162.913 2.11976 160.923 1.25032 158.826 1.16931C156.729 1.0883 154.678 1.80169 153.084 3.16691L84.0004 72.2502L14.9171 3.08358C13.3479 1.51438 11.2196 0.632812 9.00043 0.632812C6.78125 0.632812 4.65296 1.51438 3.08376 3.08358C1.51456 4.65277 0.632996 6.78106 0.632996 9.00024C0.632996 11.2194 1.51456 13.3477 3.08376 14.9169L72.2504 84.0002L3.08376 153.084C2.21141 153.831 1.50291 154.75 1.00272 155.784C0.502522 156.818 0.221437 157.944 0.177108 159.091C0.132779 160.239 0.326158 161.384 0.745113 162.453C1.16407 163.522 1.79955 164.494 2.61168 165.306C3.4238 166.118 4.39503 166.753 5.4644 167.172C6.53378 167.591 7.67821 167.785 8.82587 167.74C9.97353 167.696 11.0996 167.415 12.1335 166.915C13.1674 166.414 14.0867 165.706 14.8338 164.834L84.0004 95.7502L153.084 164.834C154.678 166.199 156.729 166.912 158.826 166.831C160.923 166.75 162.913 165.881 164.397 164.397C165.881 162.912 166.75 160.923 166.831 158.826C166.912 156.728 166.199 154.678 164.834 153.084L95.7504 84.0002Z"
|
||||
|
@ -123,12 +145,12 @@ const ActivityCardCloseShift = ({ data }) => {
|
|||
</svg>
|
||||
) : conditionTask == 3 || data?.status == 2 || data?.status == 3 ? (
|
||||
<svg
|
||||
width="37"
|
||||
height="37"
|
||||
width="25"
|
||||
height="25"
|
||||
viewBox="0 0 300 300"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-1 "
|
||||
className="mx-auto mt-[3px] "
|
||||
>
|
||||
<path
|
||||
d="M57.062 155.087C56.2612 154.132 55.2777 153.345 54.1692 152.774C53.0607 152.203 51.8494 151.859 50.6062 151.762C49.363 151.665 48.113 151.817 46.9292 152.209C45.7455 152.6 44.6518 153.225 43.7122 154.044C42.7727 154.864 42.0061 155.863 41.4574 156.983C40.9087 158.103 40.5889 159.321 40.5167 160.566C40.4445 161.811 40.6214 163.057 41.037 164.233C41.4526 165.409 42.0985 166.49 42.937 167.412L57.062 155.087ZM89.287 206.25L82.2245 212.412C83.1045 213.421 84.19 214.228 85.4082 214.782C86.6264 215.336 87.949 215.622 89.287 215.622C90.6251 215.622 91.9477 215.336 93.1658 214.782C94.384 214.228 95.4696 213.421 96.3495 212.412L89.287 206.25ZM194.562 99.9125C195.401 98.9896 196.046 97.9086 196.462 96.7329C196.878 95.5573 197.055 94.3105 196.982 93.0657C196.91 91.8208 196.59 90.6028 196.042 89.4831C195.493 88.3633 194.726 87.3643 193.787 86.5445C192.847 85.7247 191.754 85.1005 190.57 84.7086C189.386 84.3166 188.136 84.1648 186.893 84.2619C185.65 84.359 184.438 84.7032 183.33 85.2742C182.221 85.8452 181.238 86.6317 180.437 87.5875L194.562 99.9125ZM131.325 143.837C129.749 145.718 128.973 148.142 129.164 150.589C129.355 153.035 130.498 155.309 132.347 156.922C134.196 158.536 136.604 159.36 139.053 159.218C141.503 159.076 143.799 157.979 145.45 156.162L131.325 143.837ZM120.9 184.287C121.738 183.365 122.384 182.284 122.8 181.108C123.215 179.932 123.392 178.686 123.32 177.441C123.248 176.196 122.928 174.978 122.379 173.858C121.83 172.738 121.064 171.739 120.124 170.919C119.185 170.1 118.091 169.475 116.907 169.084C115.724 168.692 114.474 168.54 113.23 168.637C111.987 168.734 110.776 169.078 109.667 169.649C108.559 170.22 107.575 171.007 106.775 171.962L120.9 184.287ZM42.937 167.412L82.2245 212.412L96.3495 200.087L57.062 155.087L42.937 167.412ZM96.3495 212.412L120.9 184.287L106.775 171.962L82.2245 200.087L96.3495 212.412ZM145.45 156.162L170.012 128.037L155.887 115.712L131.325 143.837L145.45 156.162ZM170.012 128.037L194.562 99.9125L180.437 87.5875L155.887 115.712L170.012 128.037Z"
|
||||
|
@ -148,7 +170,7 @@ const ActivityCardCloseShift = ({ data }) => {
|
|||
</div>
|
||||
<div className="w-full">
|
||||
<h3
|
||||
className={`text-base font-bold tr03 ${
|
||||
className={`text-sm font-medium tr03 ${
|
||||
conditionTask == 2 || conditionTask == 4 || data?.status == 4
|
||||
? "text-red-600"
|
||||
: "text-primary-300"
|
||||
|
@ -167,30 +189,6 @@ const ActivityCardCloseShift = ({ data }) => {
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className={`flex mx-2 mt-3 tr03 ${
|
||||
conditionTask == 1 || conditionTask == 2
|
||||
? "relative top-[300px] h-0"
|
||||
: " relative top-0 h-fit "
|
||||
}`}
|
||||
>
|
||||
<div className="bg-secondaryLighter-100 w-fit relative text-[12px] my-2 mx-1 px-2 rounded-3xl text-secondary-200">
|
||||
{data?.scheduleType == 0
|
||||
? "روزانه"
|
||||
: data?.scheduleType == 1
|
||||
? "هفتگی"
|
||||
: data?.scheduleType == 2
|
||||
? "مخصوص"
|
||||
: ""}
|
||||
</div>
|
||||
<div className="bg-secondaryLighter-100 w-fit relative text-[12px] my-2 mx-1 px-2 rounded-3xl text-secondary-200">
|
||||
{data?.shiftTitle}{" "}
|
||||
</div>
|
||||
|
||||
<div className="bg-secondaryLighter-100 w-fit relative text-[12px] my-2 mx-1 px-2 rounded-3xl text-secondary-200">
|
||||
{data?.userFirstName}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={`flex justify-between rtl mt-3 tr03 ${
|
||||
|
@ -200,16 +198,16 @@ const ActivityCardCloseShift = ({ data }) => {
|
|||
}`}
|
||||
>
|
||||
<div
|
||||
className="w-[50px] h-[50px] rounded-full bg-sky-600 pt-4"
|
||||
className="w-[35px] h-[35px] rounded-full bg-sky-600 pt-4"
|
||||
onClick={() => setConditionTask(0)}
|
||||
>
|
||||
<svg
|
||||
width="18"
|
||||
height="18"
|
||||
width="14"
|
||||
height="14"
|
||||
viewBox="0 0 150 88"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto"
|
||||
className="mx-auto mt-[-5px]"
|
||||
>
|
||||
<path
|
||||
d="M137.5 75L75 12.5L12.5 75"
|
||||
|
@ -223,12 +221,12 @@ const ActivityCardCloseShift = ({ data }) => {
|
|||
<div className="flex ">
|
||||
{" "}
|
||||
<div
|
||||
className="w-[50px] h-[50px] rounded-full bg-primary-200 pt-1 mx-2"
|
||||
className="w-[35px] h-[35px] rounded-full bg-primary-200 pt-1 mx-2"
|
||||
onClick={() => handleDone(data?.id)}
|
||||
>
|
||||
<svg
|
||||
width="37"
|
||||
height="37"
|
||||
width="25"
|
||||
height="25"
|
||||
viewBox="0 0 300 300"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
@ -248,16 +246,16 @@ const ActivityCardCloseShift = ({ data }) => {
|
|||
</svg>
|
||||
</div>
|
||||
<div
|
||||
className="w-[50px] h-[50px] rounded-full bg-red-600 pt-4"
|
||||
className="w-[35px] h-[35px] rounded-full bg-red-600 pt-4"
|
||||
onClick={() => setConditionTask(2)}
|
||||
>
|
||||
<svg
|
||||
width="15"
|
||||
height="15"
|
||||
viewBox="0 0 167 168"
|
||||
width="12"
|
||||
height="12"
|
||||
viewBox="0 0 166 168"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto "
|
||||
className="mx-auto mt-[-4px] "
|
||||
>
|
||||
<path
|
||||
d="M95.7504 84.0002L164.834 14.9169C166.199 13.3227 166.912 11.2721 166.831 9.1748C166.75 7.0775 165.881 5.08801 164.397 3.60389C162.913 2.11976 160.923 1.25032 158.826 1.16931C156.729 1.0883 154.678 1.80169 153.084 3.16691L84.0004 72.2502L14.9171 3.08358C13.3479 1.51438 11.2196 0.632812 9.00043 0.632812C6.78125 0.632812 4.65296 1.51438 3.08376 3.08358C1.51456 4.65277 0.632996 6.78106 0.632996 9.00024C0.632996 11.2194 1.51456 13.3477 3.08376 14.9169L72.2504 84.0002L3.08376 153.084C2.21141 153.831 1.50291 154.75 1.00272 155.784C0.502522 156.818 0.221437 157.944 0.177108 159.091C0.132779 160.239 0.326158 161.384 0.745113 162.453C1.16407 163.522 1.79955 164.494 2.61168 165.306C3.4238 166.118 4.39503 166.753 5.4644 167.172C6.53378 167.591 7.67821 167.785 8.82587 167.74C9.97353 167.696 11.0996 167.415 12.1335 166.915C13.1674 166.414 14.0867 165.706 14.8338 164.834L84.0004 95.7502L153.084 164.834C154.678 166.199 156.729 166.912 158.826 166.831C160.923 166.75 162.913 165.881 164.397 164.397C165.881 162.912 166.75 160.923 166.831 158.826C166.912 156.728 166.199 154.678 164.834 153.084L95.7504 84.0002Z"
|
||||
|
@ -295,7 +293,8 @@ const ActivityCardCloseShift = ({ data }) => {
|
|||
"required"
|
||||
)}
|
||||
textarea={true}
|
||||
theme={1}
|
||||
theme={0}
|
||||
mt={"2"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -22,38 +22,52 @@ const TasksCard = ({ tasksData, permissions }) => {
|
|||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{tasksData?.map((e) => (
|
||||
<div className="mt-3">
|
||||
{tasksData?.map((e, index) => (
|
||||
<div
|
||||
className=" bg-white p-1 rounded-3xl overflow-hidden relative mt-5"
|
||||
className=" py-3 overflow-hidden relative border-b border-gray-200"
|
||||
onClick={() => {
|
||||
goToEditTask(e.id);
|
||||
}}
|
||||
>
|
||||
<div className="flex mx-2">
|
||||
<div className="bg-secondaryLighter-100 w-fit relative px-2 text-[12px] my-2 mx-1 rounded-3xl text-secondary-200">
|
||||
{e?.scheduleType == 0
|
||||
? "روزانه"
|
||||
: e?.scheduleType == 1
|
||||
? "هفتگی"
|
||||
: e?.scheduleType == 2
|
||||
? "مخصوص"
|
||||
: ""}
|
||||
<div className="flex">
|
||||
{/* <div className=" w-fit relative px-2 text-[12px] my-2 mx-1 rounded-3xl text-primary-300 bg-red-200 px-2">
|
||||
<PersianNumber number={index + 1} />
|
||||
</div> */}
|
||||
|
||||
<div className="bg-secondary-50 flex rounded-full ">
|
||||
<div className="w-fit relative pr-2 text-[11px] rounded-full text-secondary-200">
|
||||
{e?.scheduleType == 0
|
||||
? "روزانه"
|
||||
: e?.scheduleType == 1
|
||||
? "هفتگی"
|
||||
: e?.scheduleType == 2
|
||||
? "مخصوص"
|
||||
: ""}
|
||||
</div>
|
||||
<p className="mb-0 px-1 text-[10px] mt-1 text-secondary-200 opacity-60">
|
||||
-
|
||||
</p>
|
||||
<div className=" w-fit relative pl-2 text-[12px] rounded-full text-secondary-200">
|
||||
{e?.shifts[0]}
|
||||
</div>
|
||||
</div>
|
||||
<div className="bg-secondaryLighter-100 w-fit relative px-2 text-[12px] my-2 mx-1 rounded-3xl text-secondary-200">
|
||||
{e?.shifts[0]}
|
||||
|
||||
<div className=" w-fit relative px-2 text-[12px] mr-1 rounded-full bg-gray-300 text-gray-600 text-center ">
|
||||
{" "}
|
||||
{e?.positions[0]}
|
||||
</div>
|
||||
</div>
|
||||
<div className=" relative m-2 text-white">
|
||||
<div className="text-right h-[45px] overflow-hidden">
|
||||
<h4 className="mb-0 text-primary-300 font-semibold text-sm ">
|
||||
<div className=" relative m-1 text-white">
|
||||
<div className="text-right max-h-[40px] overflow-hidden">
|
||||
<h4 className="mb-0 text-primary-300 font-medium text-[13px] ">
|
||||
{e?.title}{" "}
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "brizco",
|
||||
"version": "0.2.2",
|
||||
"version": "0.2.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
|
|
@ -57,22 +57,28 @@ const BottomSheetAddUserToPositionShiftPlan = ({
|
|||
: "bg-gray-100"
|
||||
}`}
|
||||
onClick={() => {
|
||||
console.log("Clicked!");
|
||||
console.log("userAndPositionIds:", userAndPositionIds);
|
||||
console.log("positionId:", positionId);
|
||||
console.log("e.userId:", e.userId);
|
||||
|
||||
const userExistsIndex = userAndPositionIds?.findIndex(
|
||||
(item) => item.value === e.userId && item.key === positionId
|
||||
);
|
||||
console.log("userExistsIndex:", userExistsIndex);
|
||||
|
||||
if (userExistsIndex !== -1) {
|
||||
if (!userAndPositionIds || userExistsIndex === -1) {
|
||||
setUserAndPositionIds((current) => [
|
||||
...(current ? current?.slice(0, userExistsIndex) : []),
|
||||
...(current ? current?.slice(userExistsIndex + 1) : []),
|
||||
...(current || []),
|
||||
{
|
||||
key: positionId,
|
||||
value: e.userId,
|
||||
},
|
||||
]);
|
||||
} else {
|
||||
setUserAndPositionIds((current) => [
|
||||
...current,
|
||||
{
|
||||
key: positionId,
|
||||
value: e?.userId,
|
||||
},
|
||||
...(current ? current.slice(0, userExistsIndex) : []),
|
||||
...(current ? current.slice(userExistsIndex + 1) : []),
|
||||
]);
|
||||
}
|
||||
CTX.setBottomSheetAddUserToPositionShiftPlanOpen(false);
|
||||
|
|
|
@ -59,7 +59,7 @@ const Buttonbriz = ({
|
|||
];
|
||||
|
||||
return (
|
||||
<div className="flex rtl mt-4">
|
||||
<div className="flex rtl mt-4 ">
|
||||
<div className=" w-full">
|
||||
<button
|
||||
className={`btn w-full rounded-xl mt-2 flex rtl justify-between p-2 ${
|
||||
|
|
|
@ -29,7 +29,7 @@ const Input = ({
|
|||
{textarea ? (
|
||||
<textarea
|
||||
type="text"
|
||||
className={`peer w-full border-b placeholder:text-transparent relative rtl ${
|
||||
className={`peer w-full border-b placeholder:text-transparent relative rtl !text-sm ${
|
||||
theme == 1 ? "form-control-white" : "form-control"
|
||||
}`}
|
||||
placeholder={name}
|
||||
|
@ -41,7 +41,7 @@ const Input = ({
|
|||
/>
|
||||
) : select ? (
|
||||
<select
|
||||
className={`peer w-full border-b placeholder:text-transparent rtl ${
|
||||
className={`peer w-full border-b placeholder:text-transparent rtl text-sm ${
|
||||
theme == 1 ? "form-control-white" : "form-control"
|
||||
} ${style ? style : ""} relative`}
|
||||
placeholder={name}
|
||||
|
@ -59,13 +59,17 @@ const Input = ({
|
|||
)}
|
||||
|
||||
{selectData &&
|
||||
selectData.map((e) => <option value={e.value}>{e.key}</option>)}
|
||||
selectData.map((e) => (
|
||||
<option className="text-sm" value={e.value}>
|
||||
{e.key}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
) : (
|
||||
<input
|
||||
type={type}
|
||||
id={id}
|
||||
className={`peer w-full border-b placeholder:text-transparent rtl ${
|
||||
className={`peer w-full border-b placeholder:text-transparent rtl !text-sm ${
|
||||
theme == 1 ? "form-control-white" : "form-control"
|
||||
} ${style ? style : ""} relative`}
|
||||
placeholder={name}
|
||||
|
|
|
@ -19,11 +19,13 @@ 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);
|
||||
|
||||
|
@ -53,7 +55,9 @@ const Employees = (props) => {
|
|||
case 3:
|
||||
if (activeSection != num) {
|
||||
CTX.GetUsers();
|
||||
CTX.GetRoles();
|
||||
if (HasPermission("ViewRoles", permissions)) {
|
||||
CTX.GetRoles();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
|
@ -108,31 +112,35 @@ const Employees = (props) => {
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{activeSection == 0 ? (
|
||||
<div
|
||||
className="w-[40px] h-[40px] bg-gray-100 shadow-sm rounded-xl m-[15px] "
|
||||
onClick={() => CTX.setBottomSheetCreateRoutineOpen(true)}
|
||||
>
|
||||
<svg
|
||||
width="22"
|
||||
height="22"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-2 opacity-70"
|
||||
>
|
||||
<path
|
||||
d="M8 1V15M1 8H15"
|
||||
stroke="#2B2B2B"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-[10px] h-[10px] bg-gray-200 shadow-sm rounded-xl m-[15px] "></div>
|
||||
{HasPermission("ManageRoutines", permissions) && (
|
||||
<>
|
||||
{" "}
|
||||
{activeSection == 0 ? (
|
||||
<div
|
||||
className="w-[40px] h-[40px] bg-gray-100 shadow-sm rounded-xl m-[15px] "
|
||||
onClick={() => CTX.setBottomSheetCreateRoutineOpen(true)}
|
||||
>
|
||||
<svg
|
||||
width="22"
|
||||
height="22"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-2 opacity-70"
|
||||
>
|
||||
<path
|
||||
d="M8 1V15M1 8H15"
|
||||
stroke="#2B2B2B"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-[10px] h-[10px] bg-gray-200 shadow-sm rounded-xl m-[15px] "></div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
@ -198,30 +206,35 @@ const Employees = (props) => {
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{activeSection == 1 ? (
|
||||
<div
|
||||
className="w-[40px] h-[40px] bg-gray-100 shadow-sm rounded-xl m-[15px] "
|
||||
onClick={() => CTX.setBottomSheetCreateSectionOpen(true)}
|
||||
>
|
||||
<svg
|
||||
width="22"
|
||||
height="22"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-2 opacity-70"
|
||||
>
|
||||
<path
|
||||
d="M8 1V15M1 8H15"
|
||||
stroke="#2B2B2B"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-[10px] h-[10px] bg-gray-200 shadow-sm rounded-xl m-[15px] "></div>
|
||||
|
||||
{HasPermission("ManageSections", permissions) && (
|
||||
<>
|
||||
{activeSection == 1 ? (
|
||||
<div
|
||||
className="w-[40px] h-[40px] bg-gray-100 shadow-sm rounded-xl m-[15px] "
|
||||
onClick={() => CTX.setBottomSheetCreateSectionOpen(true)}
|
||||
>
|
||||
<svg
|
||||
width="22"
|
||||
height="22"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-2 opacity-70"
|
||||
>
|
||||
<path
|
||||
d="M8 1V15M1 8H15"
|
||||
stroke="#2B2B2B"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-[10px] h-[10px] bg-gray-200 shadow-sm rounded-xl m-[15px] "></div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{activeSection == 1 && <SectionEmployees />}
|
||||
|
@ -251,30 +264,35 @@ const Employees = (props) => {
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{activeSection == 2 ? (
|
||||
<div
|
||||
className="w-[40px] h-[40px] bg-gray-100 shadow-sm rounded-xl m-[15px] "
|
||||
onClick={() => CTX.setBottomSheetCreatePositionOpen(true)}
|
||||
>
|
||||
<svg
|
||||
width="22"
|
||||
height="22"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-2 opacity-70"
|
||||
>
|
||||
<path
|
||||
d="M8 1V15M1 8H15"
|
||||
stroke="#2B2B2B"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-[10px] h-[10px] bg-gray-200 shadow-sm rounded-xl m-[15px] "></div>
|
||||
|
||||
{HasPermission("ManagePositions", permissions) && (
|
||||
<>
|
||||
{activeSection == 2 ? (
|
||||
<div
|
||||
className="w-[40px] h-[40px] bg-gray-100 shadow-sm rounded-xl m-[15px] "
|
||||
onClick={() => CTX.setBottomSheetCreatePositionOpen(true)}
|
||||
>
|
||||
<svg
|
||||
width="22"
|
||||
height="22"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-2 opacity-70"
|
||||
>
|
||||
<path
|
||||
d="M8 1V15M1 8H15"
|
||||
stroke="#2B2B2B"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-[10px] h-[10px] bg-gray-200 shadow-sm rounded-xl m-[15px] "></div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{activeSection == 2 && <PositionEmployees />}
|
||||
|
@ -303,30 +321,34 @@ const Employees = (props) => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{activeSection == 3 ? (
|
||||
<div
|
||||
className="w-[40px] h-[40px] bg-gray-100 shadow-sm rounded-xl m-[15px] "
|
||||
onClick={() => CTX.setBottomSheetCreateEmployeesOpen(true)}
|
||||
>
|
||||
<svg
|
||||
width="22"
|
||||
height="22"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-2 opacity-70"
|
||||
>
|
||||
<path
|
||||
d="M8 1V15M1 8H15"
|
||||
stroke="#2B2B2B"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-[10px] h-[10px] bg-gray-200 shadow-sm rounded-xl m-[15px] "></div>
|
||||
{HasPermission("ManageUsers", permissions) && (
|
||||
<>
|
||||
{activeSection == 3 ? (
|
||||
<div
|
||||
className="w-[40px] h-[40px] bg-gray-100 shadow-sm rounded-xl m-[15px] "
|
||||
onClick={() => CTX.setBottomSheetCreateEmployeesOpen(true)}
|
||||
>
|
||||
<svg
|
||||
width="22"
|
||||
height="22"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-2 opacity-70"
|
||||
>
|
||||
<path
|
||||
d="M8 1V15M1 8H15"
|
||||
stroke="#2B2B2B"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-[10px] h-[10px] bg-gray-200 shadow-sm rounded-xl m-[15px] "></div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{activeSection == 3 && <UsersEmployees />}
|
||||
|
@ -355,30 +377,34 @@ const Employees = (props) => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{activeSection == 4 ? (
|
||||
<div
|
||||
className="w-[40px] h-[40px] bg-gray-100 shadow-sm rounded-xl m-[15px] "
|
||||
onClick={() => CTX.setBottomSheetCreateShiftsOpen(true)}
|
||||
>
|
||||
<svg
|
||||
width="22"
|
||||
height="22"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-2 opacity-70"
|
||||
>
|
||||
<path
|
||||
d="M8 1V15M1 8H15"
|
||||
stroke="#2B2B2B"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-[10px] h-[10px] bg-gray-200 shadow-sm rounded-xl m-[15px] "></div>
|
||||
{HasPermission("ManageShifts", permissions) && (
|
||||
<>
|
||||
{activeSection == 4 ? (
|
||||
<div
|
||||
className="w-[40px] h-[40px] bg-gray-100 shadow-sm rounded-xl m-[15px] "
|
||||
onClick={() => CTX.setBottomSheetCreateShiftsOpen(true)}
|
||||
>
|
||||
<svg
|
||||
width="22"
|
||||
height="22"
|
||||
viewBox="0 0 16 16"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-2 opacity-70"
|
||||
>
|
||||
<path
|
||||
d="M8 1V15M1 8H15"
|
||||
stroke="#2B2B2B"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-[10px] h-[10px] bg-gray-200 shadow-sm rounded-xl m-[15px] "></div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
{activeSection == 4 && <ShiftsEmployees />}
|
||||
|
|
|
@ -50,20 +50,6 @@ const Home = (props) => {
|
|||
|
||||
const profile = CTX.state.profile;
|
||||
|
||||
useEffect(() => {
|
||||
if (!!localStorage.token) {
|
||||
const datatoken = ParseJwt(getToken());
|
||||
CTX.setComplexId(datatoken.ComplexId);
|
||||
|
||||
if (datatoken.SignUpStatus == 1) {
|
||||
CTX.setStepLogin(2);
|
||||
router.push(`/login?phoneNumber=${datatoken.unique_name}`);
|
||||
}
|
||||
} else {
|
||||
router.push("/login");
|
||||
}
|
||||
}, []);
|
||||
|
||||
// useEffect(() => {
|
||||
// if (!HasPermission("ViewDashboard")) {
|
||||
// // You can customize the redirect path as needed
|
||||
|
|
|
@ -197,7 +197,7 @@ export default function RootLayout({ children }) {
|
|||
setStepLogin(2);
|
||||
} else if (data.user.signUpStatus == 2 || data.user.signUpStatus == 3) {
|
||||
setProfile(data);
|
||||
toast.success(` ${data.user.firstName} جان خوش اومدی `, {
|
||||
toast.success(`${data.user.firstName} جان خوش اومدی `, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
|
@ -220,7 +220,7 @@ export default function RootLayout({ children }) {
|
|||
body,
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -234,6 +234,7 @@ export default function RootLayout({ children }) {
|
|||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
// localStorage.removeItem("token");
|
||||
localStorage.setItem("token", data.access_token);
|
||||
|
||||
router.push("/home");
|
||||
|
@ -255,7 +256,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -279,7 +280,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -307,7 +308,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -334,7 +335,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -356,7 +357,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -378,7 +379,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -403,7 +404,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -431,7 +432,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -458,7 +459,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -481,7 +482,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -503,7 +504,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -527,7 +528,7 @@ export default function RootLayout({ children }) {
|
|||
JSON.stringify(body),
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -555,7 +556,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -590,7 +591,7 @@ export default function RootLayout({ children }) {
|
|||
}`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -612,7 +613,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -634,7 +635,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -658,7 +659,7 @@ export default function RootLayout({ children }) {
|
|||
JSON.stringify(body),
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -686,7 +687,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -714,7 +715,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -736,7 +737,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -758,7 +759,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -782,7 +783,7 @@ export default function RootLayout({ children }) {
|
|||
JSON.stringify(body),
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -810,7 +811,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -838,7 +839,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -864,7 +865,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -886,7 +887,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -908,7 +909,7 @@ export default function RootLayout({ children }) {
|
|||
`${process.env.NEXT_PUBLIC_API_URL}/shift/plan/${id}`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -931,7 +932,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -959,7 +960,7 @@ export default function RootLayout({ children }) {
|
|||
JSON.stringify(body),
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -984,7 +985,7 @@ export default function RootLayout({ children }) {
|
|||
`${process.env.NEXT_PUBLIC_API_URL}/shift/plan?page=${page}`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1010,7 +1011,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1034,7 +1035,7 @@ export default function RootLayout({ children }) {
|
|||
JSON.stringify(body),
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1062,7 +1063,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1090,7 +1091,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1112,7 +1113,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1134,7 +1135,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1158,7 +1159,7 @@ export default function RootLayout({ children }) {
|
|||
JSON.stringify(body),
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1189,7 +1190,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1218,7 +1219,7 @@ export default function RootLayout({ children }) {
|
|||
`${process.env.NEXT_PUBLIC_API_URL}/task?page=${page}`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1249,7 +1250,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1271,7 +1272,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1298,7 +1299,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1329,7 +1330,7 @@ export default function RootLayout({ children }) {
|
|||
`${process.env.NEXT_PUBLIC_API_URL}/activity/done/${id}`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1355,7 +1356,7 @@ export default function RootLayout({ children }) {
|
|||
`${process.env.NEXT_PUBLIC_API_URL}/activity/undone/${id}?undoneReason=${resone}`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1375,7 +1376,7 @@ export default function RootLayout({ children }) {
|
|||
}
|
||||
};
|
||||
|
||||
const CloseShift = async (body, id) => {
|
||||
const CloseShift = async (body, id, index) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.post(
|
||||
|
@ -1383,7 +1384,7 @@ export default function RootLayout({ children }) {
|
|||
body,
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1393,6 +1394,8 @@ export default function RootLayout({ children }) {
|
|||
});
|
||||
// router->
|
||||
|
||||
CTX.GetShifts(moment().locale("fa").startOf("day").unix() * 1000);
|
||||
|
||||
setLoading(false);
|
||||
// GetTasks();
|
||||
} catch ({ error, status }) {
|
||||
|
@ -1405,6 +1408,7 @@ export default function RootLayout({ children }) {
|
|||
};
|
||||
|
||||
const changeRole = async (id) => {
|
||||
console.log(getToken());
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.post(
|
||||
|
@ -1412,7 +1416,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1435,7 +1439,7 @@ export default function RootLayout({ children }) {
|
|||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1458,7 +1462,7 @@ export default function RootLayout({ children }) {
|
|||
`${process.env.NEXT_PUBLIC_API_URL}/report/shift/plan/${shiftPlanId}`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1493,7 +1497,7 @@ export default function RootLayout({ children }) {
|
|||
`${process.env.NEXT_PUBLIC_API_URL}/report/task`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
Authorization: "Bearer " + localStorage.getItem("token"),
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -1544,8 +1548,12 @@ export default function RootLayout({ children }) {
|
|||
soli chizi bood bgo hossein__masoomi
|
||||
|
||||
`);
|
||||
const token = localStorage.getItem("token");
|
||||
if (!token) {
|
||||
router.push("/login");
|
||||
}
|
||||
|
||||
if (profile.length <= 0 && localStorage.token) CheckUser();
|
||||
if (profile.length <= 0 && token) CheckUser();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
|
|
@ -15,7 +15,7 @@ import { toast } from "react-toastify";
|
|||
const CompleteShift = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
|
||||
const [closeShiftScore, setCloseShiftScore] = useState(70);
|
||||
const [closeShiftScore, setCloseShiftScore] = useState(50);
|
||||
const [activeShifPlan, setActiveShifPlan] = useState(-1);
|
||||
const [selectDayForShift, setSelectDayForShift] = useState(-1);
|
||||
const currentDate = new Date();
|
||||
|
@ -32,18 +32,17 @@ const CompleteShift = () => {
|
|||
cursor: "pointer",
|
||||
height: 30, // Adjust the height in pixels
|
||||
width: 30, // Adjust the width to maintain a circular shape
|
||||
marginLeft: -15, // Adjust the margin to center the handle
|
||||
marginTop: -10, // Adjust the margin to center the handle
|
||||
borderRadius: "50%", // Make the handle circular
|
||||
};
|
||||
|
||||
const railStyle = {
|
||||
backgroundColor: "red", // Overall track color
|
||||
backgroundColor: "rgba(255, 0, 37, 0.54)", // Overall track color
|
||||
height: 10,
|
||||
};
|
||||
|
||||
const trackStyle = {
|
||||
backgroundColor: "green", // Color between handles
|
||||
backgroundColor: "rgba(0, 165, 0, 0.7)", // Color between handles
|
||||
height: 10,
|
||||
};
|
||||
|
||||
|
@ -84,7 +83,7 @@ const CompleteShift = () => {
|
|||
};
|
||||
const handleActivityCloseShift = (id, index) => {
|
||||
CTX.setCompleteActivities([]);
|
||||
setCloseShiftScore(70);
|
||||
setCloseShiftScore(50);
|
||||
if (activeShifPlan == index) {
|
||||
setActiveShifPlan(-1);
|
||||
} else {
|
||||
|
@ -127,11 +126,8 @@ const CompleteShift = () => {
|
|||
|
||||
const handleCloseShift = () => {
|
||||
CTX.CloseShift(body, siftsData[activeShifPlan]?.currentShiftPlanId);
|
||||
|
||||
// ;
|
||||
// ;
|
||||
// ;
|
||||
// ;
|
||||
setActiveShifPlan(-1);
|
||||
handleDayCloseShift(1);
|
||||
};
|
||||
|
||||
const handleGoToReport = (title, shiftId) => {
|
||||
|
@ -184,7 +180,7 @@ const CompleteShift = () => {
|
|||
<div className="bg-body-100 relative top-[-30px] rounded-t-3xl overflow-hidden p-4 rtl">
|
||||
<div className="flex overflow-auto whitespace-nowrap mb-7">
|
||||
<div
|
||||
className={`mx-1 rtl py-1 px-2 rounded-full font-bold inline-block tr03 ${
|
||||
className={`mx-1 rtl py-1 px-2 rounded-full font-medium inline-block tr03 ${
|
||||
selectDayForShift == 0
|
||||
? "bg-primary-200 text-white"
|
||||
: " opacity-60 font-normal"
|
||||
|
@ -194,7 +190,7 @@ const CompleteShift = () => {
|
|||
<PersianNumber number={getYesterdayPersianDate()} />
|
||||
</div>
|
||||
<div
|
||||
className={`mx-1 rtl py-1 px-2 rounded-full font-bold inline-block tr03 ${
|
||||
className={`mx-1 rtl py-1 px-2 rounded-full font-medium inline-block tr03 ${
|
||||
selectDayForShift == 1
|
||||
? "bg-primary-200 text-white"
|
||||
: " opacity-60 font-normal"
|
||||
|
@ -208,7 +204,7 @@ const CompleteShift = () => {
|
|||
</div>
|
||||
|
||||
<div
|
||||
className={`mx-1 rtl py-1 px-2 rounded-full font-bold inline-block tr03 ${
|
||||
className={`mx-1 rtl py-1 px-2 rounded-full font-medium inline-block tr03 ${
|
||||
selectDayForShift == 2
|
||||
? "bg-primary-200 text-white"
|
||||
: " opacity-60 font-normal"
|
||||
|
@ -303,7 +299,8 @@ const CompleteShift = () => {
|
|||
<Slider
|
||||
min={0}
|
||||
max={100}
|
||||
defaultValue={[70]}
|
||||
defaultValue={[50]}
|
||||
step={10}
|
||||
handleStyle={[circularHandleStyle, circularHandleStyle]}
|
||||
railStyle={railStyle}
|
||||
trackStyle={[trackStyle, trackStyle]}
|
||||
|
|
|
@ -202,10 +202,10 @@ const Calendar = () => {
|
|||
}, [shiftPlanData]);
|
||||
|
||||
useEffect(() => {
|
||||
const userJustSuper = usersData?.filter((obj) =>
|
||||
obj.roleNames.includes("سوپروایزر")
|
||||
const userJustSuper = usersData?.filter(
|
||||
(obj) =>
|
||||
obj.roleNames.includes("سوپروایزر") || obj.roleNames.includes("مدیریت")
|
||||
);
|
||||
|
||||
setSuperData(
|
||||
userJustSuper?.map((item) => ({
|
||||
key: item.firstName + " " + item.lastName,
|
||||
|
|
|
@ -6,6 +6,7 @@ import moment from "jalali-moment";
|
|||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import HasPermission from "plugins/HasPermission/page";
|
||||
import PersianNumber from "plugins/PersianNumber";
|
||||
|
||||
import React, { useContext, useEffect, useState } from "react";
|
||||
|
@ -13,6 +14,7 @@ import React, { useContext, useEffect, useState } from "react";
|
|||
const Shifts = (props) => {
|
||||
const CTX = useContext(AppContext);
|
||||
const router = useRouter();
|
||||
const permissions = CTX.state.profile?.permissions;
|
||||
|
||||
const [shiftplans, setShiftplans] = useState([]);
|
||||
const [shiftPlansSelect, setShiftPlansSelect] = useState(0);
|
||||
|
@ -83,91 +85,107 @@ const Shifts = (props) => {
|
|||
}}
|
||||
/>
|
||||
|
||||
<div className="bg-primary-300 flex whitespace-nowrap rtl p-3">
|
||||
<Link
|
||||
href={"/shifts/manage-shift"}
|
||||
className=" bg-white rounded-3xl p-5 inline-block w-fit relative top-[-32px] mx-2"
|
||||
>
|
||||
<div>
|
||||
<h2> شیفت هفته </h2>
|
||||
|
||||
<div className="flex justify-end">
|
||||
<div className="w-10 h-5 rounded-full bg-secondary-200 opacity-30"></div>
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
<Link
|
||||
href={"/shifts/manage-shift"}
|
||||
className=" bg-white rounded-3xl p-5 inline-block w-fit relative top-[-32px]"
|
||||
>
|
||||
<div>
|
||||
<h2>
|
||||
{" "}
|
||||
شیفت بعدی
|
||||
<strong> هفته بعد </strong>
|
||||
</h2>
|
||||
<div className="flex justify-end">
|
||||
<div className="w-5 h-5 rounded-full bg-secondary-100 opacity-30"></div>
|
||||
</div>{" "}
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="bg-body-100 relative top-[-30px] rounded-t-3xl overflow-hidden p-4 rtl mt-2">
|
||||
{shiftplans?.map((e, index) => (
|
||||
<>
|
||||
<div
|
||||
className={` bg-gray-200 rounded-xl p-5 my-3 tr03 ${
|
||||
shiftPlansSelect == index ? "h-fit " : "h-[65px]"
|
||||
}`}
|
||||
{HasPermission("ManageShiftPlans", permissions) && (
|
||||
<>
|
||||
<div className="bg-primary-300 flex whitespace-nowrap rtl p-3">
|
||||
<Link
|
||||
href={"/shifts/manage-shift"}
|
||||
className=" bg-white rounded-3xl p-5 inline-block w-fit relative top-[-32px] mx-2"
|
||||
>
|
||||
<div
|
||||
className={`flex justify-between ${
|
||||
shiftPlansSelect == index
|
||||
? "border-b border-gray-300 pb-3"
|
||||
: ""
|
||||
}`}
|
||||
onClick={() => setShiftPlansSelect(index)}
|
||||
>
|
||||
<div className="">
|
||||
<PersianNumber
|
||||
number={moment(e.planFor).format("jYYYY/jM/jD")}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className="text-sm"> شیفت هفته </h2>
|
||||
|
||||
<div className="bg-gray-500 fit rounded-xl p-1 px-2 h-fit">
|
||||
<p className="mb-0 text-sm text-white">
|
||||
<PersianNumber number={e.data.length} style={"ml-1"} />
|
||||
شیفت
|
||||
</p>
|
||||
<div className="flex justify-end">
|
||||
<div className="w-10 h-3 rounded-full bg-secondary-200 opacity-30"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{shiftPlansSelect == index && (
|
||||
<div className="flex">
|
||||
{e.data.map((e) => (
|
||||
<div className="ml-2 bg-white rounded-xl mt-3 p-2">
|
||||
<p className="text-sm mb-0 text-gray-700 font-medium">
|
||||
{" "}
|
||||
{e.shiftTitle}
|
||||
</p>
|
||||
|
||||
<div className="flex justify-center">
|
||||
<p className="mb-0 text-[12px] text-center w-fit bg-primary-100 px-1 rounded-xl mt-2 ">
|
||||
<PersianNumber
|
||||
number={e.totalActivitiesCount}
|
||||
style={"ml-1 !text-[12px]"}
|
||||
/>
|
||||
فعالیت
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</Link>
|
||||
<Link
|
||||
href={"/shifts/manage-shift"}
|
||||
className=" bg-white rounded-3xl p-5 inline-block w-fit relative top-[-32px]"
|
||||
>
|
||||
<div>
|
||||
<h2 className="text-sm">
|
||||
{" "}
|
||||
شیفت بعدی
|
||||
<strong> هفته بعد </strong>
|
||||
</h2>
|
||||
<div className="flex justify-end">
|
||||
<div className="w-5 h-3 rounded-full bg-secondary-100 opacity-30"></div>
|
||||
</div>{" "}
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
<div className="bg-body-100 relative top-[-30px] rounded-t-3xl overflow-hidden p-4 rtl mt-2">
|
||||
{shiftplans.length <= 0 ? (
|
||||
<div className="flex justify-center py-5">
|
||||
<div className="bg-white shadow mt-5 w-fit rounded-full text-sm p-4">
|
||||
چیزی یافت نشد
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
{shiftplans?.map((e, index) => (
|
||||
<>
|
||||
<div
|
||||
className={` bg-gray-200 rounded-xl p-5 my-3 tr03 ${
|
||||
shiftPlansSelect == index ? "h-fit " : "h-[65px]"
|
||||
}`}
|
||||
>
|
||||
<div
|
||||
className={`flex justify-between ${
|
||||
shiftPlansSelect == index
|
||||
? "border-b border-gray-300 pb-3"
|
||||
: ""
|
||||
}`}
|
||||
onClick={() => setShiftPlansSelect(index)}
|
||||
>
|
||||
<div className="">
|
||||
<PersianNumber
|
||||
number={moment(e.planFor).format("jYYYY/jM/jD")}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="bg-gray-500 fit rounded-xl p-1 px-2 h-fit">
|
||||
<p className="mb-0 text-sm text-white">
|
||||
<PersianNumber
|
||||
number={e.data.length}
|
||||
style={"ml-1"}
|
||||
/>
|
||||
شیفت
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{shiftPlansSelect == index && (
|
||||
<div className="flex">
|
||||
{e.data.map((e) => (
|
||||
<div className="ml-2 bg-white rounded-xl mt-3 p-2">
|
||||
<p className="text-sm mb-0 text-gray-700 font-medium">
|
||||
{" "}
|
||||
{e.shiftTitle}
|
||||
</p>
|
||||
|
||||
<div className="flex justify-center">
|
||||
<p className="mb-0 text-[12px] text-center w-fit bg-primary-100 px-1 rounded-xl mt-2 ">
|
||||
<PersianNumber
|
||||
number={e.totalActivitiesCount}
|
||||
style={"ml-1 !text-[12px]"}
|
||||
/>
|
||||
فعالیت
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
))}
|
||||
</>
|
||||
))}
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
|
|
|
@ -361,26 +361,13 @@ const AddTask = () => {
|
|||
setRoutineForTaskCurrent(e.target.value);
|
||||
validator.current.showMessageFor("routines");
|
||||
|
||||
if (routineForTaskChoose.length >= 1) {
|
||||
toast.error(
|
||||
"فعلا معلوم نیست بیشتر از یکی بتونی باید با ممد اینا حرف بزنیم",
|
||||
{
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
}
|
||||
);
|
||||
if (!!routineForTaskChoose.find((b) => b == e.target.value)) {
|
||||
toast.error("روز تکراری است", {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
} else {
|
||||
if (!!routineForTaskChoose.find((b) => b == e.target.value)) {
|
||||
toast.error("روز تکراری است", {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
} else {
|
||||
CTX.setRoutineForTaskChoose((current) => [
|
||||
...current,
|
||||
e.target.value,
|
||||
]);
|
||||
}
|
||||
CTX.setRoutineForTaskChoose(() => [e.target.value]);
|
||||
}
|
||||
}}
|
||||
style="text-right"
|
||||
|
@ -403,13 +390,13 @@ const AddTask = () => {
|
|||
className="flex bg-gray-300 p-1 rounded-full m-1 justify-start mt-3"
|
||||
key={index}
|
||||
>
|
||||
<div
|
||||
{/* <div
|
||||
className="w-[30px] h-[30px] rounded-full bg-gray-400 "
|
||||
onClick={() => deleteRoutineForTask(e)}
|
||||
></div>
|
||||
></div> */}
|
||||
|
||||
<div>
|
||||
<p className="mb-0 px-3 text-sm mt-1">
|
||||
<p className="mb-0 px-3 text-sm">
|
||||
{routinesData?.find((b) => b.id == e)?.name}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -423,24 +410,22 @@ const AddTask = () => {
|
|||
lable="پوزیشن فعالیت"
|
||||
id="positions-id"
|
||||
name="positions"
|
||||
value={setPositionsForTaskCurrent}
|
||||
type={"text"}
|
||||
inputEvent={(e) => {
|
||||
setPositionsForTaskCurrent(e.target.value);
|
||||
validator.current.showMessageFor("positions");
|
||||
|
||||
if (positionsForTaskChoose.length >= 1) {
|
||||
toast.error(
|
||||
"فعلا معلوم نیست بیشتر از یکی بتونی باید با ممد اینا حرف بزنیم",
|
||||
{
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
}
|
||||
);
|
||||
toast.error("شما فقط یک پوزیشن را میتوانید انتخاب کنید", {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
} else {
|
||||
if (
|
||||
!!positionsForTaskChoose.find((b) => b == e.target.value)
|
||||
) {
|
||||
toast.error("روز تکراری است", {
|
||||
toast.error("پوزیشن تکراری است", {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
|
@ -472,12 +457,12 @@ const AddTask = () => {
|
|||
key={index}
|
||||
>
|
||||
<div
|
||||
className="w-[30px] h-[30px] rounded-full bg-gray-400 "
|
||||
className="w-[20px] h-[20px] rounded-full bg-gray-400 "
|
||||
onClick={() => deletePositionForTask(e)}
|
||||
></div>
|
||||
|
||||
<div>
|
||||
<p className="mb-0 px-3 text-sm mt-1">
|
||||
<p className="mb-0 px-3 text-sm ">
|
||||
{positionsData?.find((b) => b.id == e)?.name}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -496,26 +481,13 @@ const AddTask = () => {
|
|||
setShiftsForTaskCurrent(e.target.value);
|
||||
validator.current.showMessageFor("shifts");
|
||||
|
||||
if (shiftsForTaskChoose.length >= 1) {
|
||||
toast.error(
|
||||
"فعلا معلوم نیست بیشتر از یکی بتونی باید با ممد اینا حرف بزنیم",
|
||||
{
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
}
|
||||
);
|
||||
if (!!shiftsForTaskChoose.find((b) => b == e.target.value)) {
|
||||
toast.error("روز تکراری است", {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
} else {
|
||||
if (!!shiftsForTaskChoose.find((b) => b == e.target.value)) {
|
||||
toast.error("روز تکراری است", {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
} else {
|
||||
CTX.setShiftsForTaskChoose((current) => [
|
||||
...current,
|
||||
e.target.value,
|
||||
]);
|
||||
}
|
||||
CTX.setShiftsForTaskChoose(() => [e.target.value]);
|
||||
}
|
||||
}}
|
||||
style="text-right"
|
||||
|
@ -537,13 +509,13 @@ const AddTask = () => {
|
|||
className="flex bg-gray-300 p-1 rounded-full m-1 justify-start mt-3"
|
||||
key={index}
|
||||
>
|
||||
<div
|
||||
className="w-[30px] h-[30px] rounded-full bg-gray-400 "
|
||||
{/* <div
|
||||
className="w-[20px] h-[20px] rounded-full bg-gray-400 "
|
||||
onClick={() => deleteShiftForTask(e)}
|
||||
></div>
|
||||
></div> */}
|
||||
|
||||
<div>
|
||||
<p className="mb-0 px-3 text-sm mt-1">
|
||||
<p className="mb-0 px-3 text-sm ">
|
||||
{shiftsData?.find((b) => b?.id == e)?.title}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -617,11 +589,11 @@ const AddTask = () => {
|
|||
<>
|
||||
<div className="">
|
||||
<Input
|
||||
lable="انتخاب روزهای این قعالیت در هفته"
|
||||
lable="انتخاب روزهای این فعالیت در هفته"
|
||||
id="shiftsDaysChoose-id"
|
||||
name="shiftsDaysChoose"
|
||||
type={"text"}
|
||||
value={shiftsDaysChoose}
|
||||
value={setShiftsDaysCurrent}
|
||||
inputEvent={(e) => {
|
||||
setShiftsDaysCurrent(e.target.value);
|
||||
validator.current.showMessageFor("shiftsDaysChoose");
|
||||
|
@ -659,12 +631,12 @@ const AddTask = () => {
|
|||
key={index}
|
||||
>
|
||||
<div
|
||||
className="w-[30px] h-[30px] rounded-full bg-gray-400 "
|
||||
className="w-[20px] h-[20px] rounded-full bg-gray-400 "
|
||||
onClick={() => deleteShiftsDaysForTask(e)}
|
||||
></div>
|
||||
|
||||
<div>
|
||||
<p className="mb-0 px-3 text-sm mt-1">
|
||||
<p className="mb-0 px-3 text-sm ">
|
||||
{week?.find((b) => b.value == e).key}
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -85,23 +85,28 @@ const page = () => {
|
|||
GoBack();
|
||||
}}
|
||||
/>
|
||||
<div className="bg-primary-300 flex whitespace-nowrap rtl p-3">
|
||||
<div
|
||||
className=" bg-white rounded-3xl p-5 inline-block w-fit relative top-[-32px] mx-2"
|
||||
onClick={() => handleGoToReport()}
|
||||
>
|
||||
<div>
|
||||
<h2> خروجی گرفتن از فعالیت ها </h2>
|
||||
|
||||
<div className="flex justify-end">
|
||||
<div className="w-10 h-5 rounded-full bg-secondary-200 opacity-30"></div>
|
||||
{HasPermission("ManageReports", permissions) && (
|
||||
<>
|
||||
<div className="bg-primary-300 flex whitespace-nowrap rtl p-3">
|
||||
<div
|
||||
className=" bg-white rounded-3xl p-5 inline-block w-fit relative top-[-32px] mx-2"
|
||||
onClick={() => handleGoToReport()}
|
||||
>
|
||||
<div>
|
||||
<h2 className="text-sm"> خروجی گرفتن از فعالیت ها </h2>
|
||||
|
||||
<div className="flex justify-end">
|
||||
<div className="w-10 h-3 rounded-full bg-secondary-200 opacity-30"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
<div className="bg-body-100 relative top-[-30px] rounded-t-3xl overflow-hidden p-5 rtl ">
|
||||
{!!HasPermission("ManageTasks", permissions) && (
|
||||
<div className="flex mb-6 ">
|
||||
<div className="flex bg-[#e066150e] rounded-full ">
|
||||
<div
|
||||
className={` p-2 w-full rounded-3xl tr03 ${
|
||||
typeTask == 0 ? "bg-secondary-100" : ""
|
||||
|
@ -109,7 +114,7 @@ const page = () => {
|
|||
onClick={() => setTypeTask(0)}
|
||||
>
|
||||
<p
|
||||
className={`mb-0 text-center text-base ${
|
||||
className={`mb-0 text-center text-sm ${
|
||||
typeTask == 0 ? "text-white " : "opacity-70"
|
||||
}`}
|
||||
>
|
||||
|
@ -123,7 +128,7 @@ const page = () => {
|
|||
onClick={() => setTypeTask(1)}
|
||||
>
|
||||
<p
|
||||
className={`mb-0 text-center text-base ${
|
||||
className={`mb-0 text-center text-sm ${
|
||||
typeTask == 1 ? "text-white " : "opacity-70"
|
||||
}`}
|
||||
>
|
||||
|
@ -178,7 +183,7 @@ const page = () => {
|
|||
</InfiniteScroll>
|
||||
) : (
|
||||
<div className="flex justify-center py-5">
|
||||
<div className="bg-white shadow mt-5 w-fit rounded-full p-4">
|
||||
<div className="bg-white shadow mt-5 w-fit rounded-full text-sm p-4">
|
||||
چیزی یافت نشد
|
||||
</div>
|
||||
</div>
|
||||
|
@ -198,7 +203,7 @@ const page = () => {
|
|||
</InfiniteScroll>
|
||||
) : (
|
||||
<div className="flex justify-center py-5">
|
||||
<div className="bg-white shadow mt-5 w-fit rounded-full p-4">
|
||||
<div className="bg-white shadow mt-5 w-fit rounded-full text-sm p-4">
|
||||
چیزی یافت نشد
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -19,6 +19,7 @@ module.exports = {
|
|||
},
|
||||
|
||||
secondary: {
|
||||
50: "#fd562317",
|
||||
100: "#FD5523",
|
||||
200: "#DA4215",
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue