NEW VER
parent
39139159a5
commit
078859977a
12
.env
12
.env
|
@ -1,16 +1,16 @@
|
|||
NODE_ENV="development"
|
||||
|
||||
NEXT_PUBLIC_SERVER_URL=http://192.168.31.46:32769
|
||||
NEXT_PUBLIC_PUBLIC_URL=http://192.168.31.46:32769
|
||||
NEXT_PUBLIC_API_URL=http://192.168.31.46:32769/api
|
||||
NEXT_PUBLIC_SERVER_URL=http://192.168.88.12:32769
|
||||
NEXT_PUBLIC_PUBLIC_URL=http://192.168.88.12:32769
|
||||
NEXT_PUBLIC_API_URL=http://192.168.88.12:32769/api
|
||||
# SECURE_LOCAL_STORAGE_HASH_KEY=f1da2b2c7a4c446934267fea631102ec389b5b99
|
||||
# NEXT_PUBLIC_API_URL_IMAGE=https://192.168.88.12:49154/Files/ReportImages
|
||||
# NEXT_PUBLIC_API_URL_BackUp=https://192.168.88.12:49154/Files/BackUps
|
||||
|
||||
|
||||
|
||||
# NEXT_PUBLIC_SERVER_URL=https://api.macsonline.ir
|
||||
# NEXT_PUBLIC_PUBLIC_URL=https://api.macsonline.ir
|
||||
# NEXT_PUBLIC_API_URL=https://api.macsonline.ir/api/v1
|
||||
# NEXT_PUBLIC_SERVER_URL=https://api.brizco.io
|
||||
# NEXT_PUBLIC_PUBLIC_URL=https://api.brizco.io
|
||||
# NEXT_PUBLIC_API_URL=https://api.brizco.io/api
|
||||
# NEXT_PUBLIC_API_URL_IMAGE=https://api.macsonline.ir/Files/ReportImages
|
||||
# NEXT_PUBLIC_API_URL_BackUp=https://api.macsonline.ir/Files/BackUps
|
|
@ -0,0 +1,84 @@
|
|||
"use client";
|
||||
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import React, { useContext } from "react";
|
||||
|
||||
const PositionEmployees = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
const positionsData = CTX.state.positionsData;
|
||||
|
||||
const goToEditPosition = (id) => {
|
||||
CTX.setGoToEditPosition(true);
|
||||
CTX.setBottomSheetCreatePositionOpen(true);
|
||||
CTX.setIdEditPosition(id);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{positionsData && positionsData.length > 0 ? (
|
||||
<div className="flex flex-wrap">
|
||||
{positionsData.map((e) => (
|
||||
<div className="bg-white shadow-sm rounded-full p-1 ml-2 w-fit flex mt-4">
|
||||
<div className="mx-3">
|
||||
<p className="mb-0 mt-[6px] text-[12px] font-medium">
|
||||
{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>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex justify-center py-5">
|
||||
<div className="bg-white shadow mt-5 w-fit rounded-full p-4">
|
||||
چیزی یافت نشد
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default PositionEmployees;
|
|
@ -0,0 +1,83 @@
|
|||
"use client";
|
||||
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import React, { useContext } from "react";
|
||||
|
||||
const SectionEmployees = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
const sectionsData = CTX.state.sectionsData;
|
||||
const goToEditSection = (id) => {
|
||||
CTX.setGoToEditSection(true);
|
||||
CTX.setBottomSheetCreateSectionOpen(true);
|
||||
CTX.setIdEditSection(id);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{sectionsData && sectionsData.length > 0 ? (
|
||||
<div className="flex flex-wrap">
|
||||
{sectionsData.map((e) => (
|
||||
<div className="bg-white shadow-sm rounded-full p-1 ml-2 w-fit flex mt-4">
|
||||
<div className="mx-3">
|
||||
<p className="mb-0 mt-[6px] text-[12px] font-medium">
|
||||
{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>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex justify-center py-5">
|
||||
<div className="bg-white shadow mt-5 w-fit rounded-full p-4">
|
||||
چیزی یافت نشد
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default SectionEmployees;
|
|
@ -0,0 +1,84 @@
|
|||
"use client";
|
||||
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import React, { useContext } from "react";
|
||||
|
||||
const RoutineEmployees = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
const routinesData = CTX.state.routinesData;
|
||||
|
||||
const goToEditRoutine = (id) => {
|
||||
CTX.setGoToEditRoutine(true);
|
||||
CTX.setBottomSheetCreateRoutineOpen(true);
|
||||
CTX.setIdEditRoutine(id);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{routinesData && routinesData.length > 0 ? (
|
||||
<div className="flex flex-wrap">
|
||||
{routinesData.map((e) => (
|
||||
<div className="bg-white shadow-sm rounded-full p-1 ml-2 w-fit flex mt-4">
|
||||
<div className="mx-3">
|
||||
<p className="mb-0 mt-[6px] text-[12px] font-medium">
|
||||
{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>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex justify-center py-5">
|
||||
<div className="bg-white shadow mt-5 w-fit rounded-full p-4">
|
||||
چیزی یافت نشد
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default RoutineEmployees;
|
|
@ -180,9 +180,9 @@ const NavBAr = (props) => {
|
|||
</>
|
||||
</Link>
|
||||
|
||||
<Link href={"/dashboard"} className="w-full !no-underline ml-5">
|
||||
<Link href={"/routine"} className="w-full !no-underline ml-5">
|
||||
<>
|
||||
{usePath.includes("/dashboard") ? (
|
||||
{usePath.includes("/routine") ? (
|
||||
<div className="flex justify-center w-full">
|
||||
<div className="w-[32px] mt-2">
|
||||
<Image src={logo} />
|
||||
|
|
|
@ -148,7 +148,7 @@ const BottomManageShift = (props) => {
|
|||
CTX.GetUser(idEditUser);
|
||||
}
|
||||
} else if (e.type == "CLOSE") {
|
||||
clear();
|
||||
// clear();
|
||||
CTX.setGoToEditUser(false);
|
||||
CTX.setIdEditUser(null);
|
||||
CTX.setUserData([]);
|
||||
|
|
|
@ -17,11 +17,15 @@ const BottomSheetCreateEmployees = (props) => {
|
|||
const [firstName, setFirstName] = useState("");
|
||||
const [lastName, setLastName] = useState("");
|
||||
const [phoneNumber, setPhoneNumber] = useState("");
|
||||
const [nationalId, setNationalId] = useState("");
|
||||
// const [nationalId, setNationalId] = useState("");
|
||||
const [gender, setGender] = useState(parseInt(0));
|
||||
const [birthDate, setBirthDate] = useState(null);
|
||||
// const [birthDate, setBirthDate] = useState(null);
|
||||
const [roleSelectCurrntData, setRoleSelectCurrntData] = useState("");
|
||||
const [roleSelectData, setRoleSelectData] = useState([]);
|
||||
|
||||
const [positionId, setPositionId] = useState("");
|
||||
const [positionIdSelectData, setPositionIdSelectData] = useState("");
|
||||
|
||||
const [, forceUpdate] = useState();
|
||||
|
||||
const validator = useRef(
|
||||
|
@ -43,40 +47,43 @@ const BottomSheetCreateEmployees = (props) => {
|
|||
const goToEditUser = CTX.state.goToEditUser;
|
||||
const idEditUser = CTX.state.idEditUser;
|
||||
const userData = CTX.state.userData;
|
||||
const positionsData = CTX.state.positionsData;
|
||||
|
||||
const body = {
|
||||
phoneNumber,
|
||||
firstName,
|
||||
lastName,
|
||||
birthDateTimeStamp:
|
||||
birthDate &&
|
||||
moment
|
||||
.utc(
|
||||
[birthDate.year, birthDate.month, birthDate.day],
|
||||
"jYYYY-jMM-jDDTHH"
|
||||
)
|
||||
.unix(),
|
||||
// birthDateTimeStamp:
|
||||
// birthDate &&
|
||||
// moment
|
||||
// .utc(
|
||||
// [birthDate.year, birthDate.month, birthDate.day],
|
||||
// "jYYYY-jMM-jDDTHH"
|
||||
// )
|
||||
// .unix(),
|
||||
gender: parseInt(gender),
|
||||
nationalId,
|
||||
// nationalId,
|
||||
roleIds: rolesChoose,
|
||||
positionId,
|
||||
};
|
||||
|
||||
const bodyUpdate = {
|
||||
phoneNumber,
|
||||
firstName,
|
||||
lastName,
|
||||
birthDateTimeStamp:
|
||||
birthDate &&
|
||||
moment
|
||||
.utc(
|
||||
[birthDate.year, birthDate.month, birthDate.day],
|
||||
"jYYYY-jMM-jDDTHH"
|
||||
)
|
||||
.unix(),
|
||||
// birthDateTimeStamp:
|
||||
// birthDate &&
|
||||
// moment
|
||||
// .utc(
|
||||
// [birthDate.year, birthDate.month, birthDate.day],
|
||||
// "jYYYY-jMM-jDDTHH"
|
||||
// )
|
||||
// .unix(),
|
||||
gender: parseInt(gender),
|
||||
nationalId,
|
||||
// nationalId,
|
||||
roleIds: rolesChoose,
|
||||
userId: userData.id,
|
||||
positionId,
|
||||
};
|
||||
|
||||
console.log(bodyUpdate);
|
||||
|
@ -85,11 +92,12 @@ const BottomSheetCreateEmployees = (props) => {
|
|||
setFirstName("");
|
||||
setLastName("");
|
||||
setPhoneNumber("");
|
||||
setNationalId("");
|
||||
// setNationalId("");
|
||||
setGender("");
|
||||
setBirthDate("");
|
||||
// setBirthDate("");
|
||||
setRoleSelectCurrntData("");
|
||||
setRoleSelectData([]);
|
||||
setPositionId("");
|
||||
CTX.setRolesChoose([]);
|
||||
};
|
||||
|
||||
|
@ -140,6 +148,13 @@ const BottomSheetCreateEmployees = (props) => {
|
|||
}))
|
||||
);
|
||||
|
||||
setPositionIdSelectData(
|
||||
positionsData.map((item) => ({
|
||||
key: item.name,
|
||||
value: item.id,
|
||||
}))
|
||||
);
|
||||
|
||||
console.log(idEditUser);
|
||||
|
||||
if (e.type == "OPEN") {
|
||||
|
@ -157,28 +172,32 @@ const BottomSheetCreateEmployees = (props) => {
|
|||
|
||||
useEffect(() => {
|
||||
if (goToEditUser) {
|
||||
const date = moment
|
||||
.unix(userData.birthDateTimeStamp)
|
||||
.locale("fa")
|
||||
.format("YYYY/MM/DD")
|
||||
.split("/");
|
||||
// const date = moment
|
||||
// .unix(userData.birthDateTimeStamp)
|
||||
// .locale("fa")
|
||||
// .format("YYYY/MM/DD")
|
||||
// .split("/");
|
||||
|
||||
setFirstName(userData.firstName);
|
||||
setLastName(userData.lastName);
|
||||
setPhoneNumber(userData.phoneNumber);
|
||||
setNationalId(userData.nationalId);
|
||||
// setNationalId(userData.nationalId);
|
||||
setGender(userData.gender);
|
||||
setBirthDate({
|
||||
day: parseInt(date[2]),
|
||||
month: parseInt(date[1]),
|
||||
year: parseInt(date[0]),
|
||||
});
|
||||
// setBirthDate({
|
||||
// day: parseInt(date[2]),
|
||||
// month: parseInt(date[1]),
|
||||
// year: parseInt(date[0]),
|
||||
// });
|
||||
// setRoleSelectCurrntData("");
|
||||
CTX.setRolesChoose(userData.roleIds);
|
||||
setPositionId(userData.positionId);
|
||||
|
||||
console.log("userData2", userData);
|
||||
}
|
||||
}, [userData]);
|
||||
|
||||
console.log("positionIdSelectData", positionIdSelectData);
|
||||
|
||||
return (
|
||||
<BottomSheet
|
||||
onSpringStart={(e) => handleBottomSheetCreateEmployeesOpen(e)}
|
||||
|
@ -252,11 +271,11 @@ const BottomSheetCreateEmployees = (props) => {
|
|||
/>
|
||||
</div>
|
||||
|
||||
<DatePickerIran
|
||||
{/* <DatePickerIran
|
||||
datePickerEvent={(e) => setBirthDate(e)}
|
||||
date={birthDate}
|
||||
zindex="z-[1000]"
|
||||
/>
|
||||
/> */}
|
||||
|
||||
<div className="">
|
||||
<Input
|
||||
|
@ -279,7 +298,7 @@ const BottomSheetCreateEmployees = (props) => {
|
|||
/>
|
||||
</div>
|
||||
|
||||
<div className="">
|
||||
{/* <div className="">
|
||||
<Input
|
||||
lable="کد ملی"
|
||||
id="nationalId-id"
|
||||
|
@ -291,7 +310,7 @@ const BottomSheetCreateEmployees = (props) => {
|
|||
}}
|
||||
style="text-right"
|
||||
/>
|
||||
</div>
|
||||
</div> */}
|
||||
|
||||
<div className="">
|
||||
<Input
|
||||
|
@ -320,6 +339,7 @@ const BottomSheetCreateEmployees = (props) => {
|
|||
)}
|
||||
select={true}
|
||||
selectData={roleSelectData}
|
||||
defaultValue={"انتخاب کنید"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
@ -341,6 +361,55 @@ const BottomSheetCreateEmployees = (props) => {
|
|||
))}
|
||||
</div>
|
||||
|
||||
<div className="">
|
||||
<Input
|
||||
lable="پوزیشن مد نظر"
|
||||
id="positionId-id"
|
||||
name="positionId"
|
||||
type={"text"}
|
||||
// value={sectionIdSelectCurrntData}
|
||||
inputEvent={(e) => {
|
||||
setPositionId(e.target.value);
|
||||
// setSectionId(e.target.value);
|
||||
// if (!!sectionIdChoose.find((b) => b == e.target.value)) {
|
||||
// toast.error("سکشن تکراری است", {
|
||||
// position: "bottom-right",
|
||||
// closeOnClick: true,
|
||||
// });
|
||||
// } else {
|
||||
// CTX.setSectionIdChoose((current) => [
|
||||
// ...current,
|
||||
// e.target.value,
|
||||
// ]);
|
||||
// }
|
||||
}}
|
||||
style="text-right"
|
||||
validatorData={validator.current.message(
|
||||
"positionId",
|
||||
positionId,
|
||||
"required"
|
||||
)}
|
||||
select={true}
|
||||
selectData={positionIdSelectData}
|
||||
defaultValue={"انتخاب کنید"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap mt-3 rtl">
|
||||
<div className="flex bg-gray-300 p-1 rounded-full m-1 justify-start">
|
||||
{/* <div
|
||||
className="w-[30px] h-[30px] rounded-full bg-gray-400 "
|
||||
onClick={() => deleteSection(e)}
|
||||
></div> */}
|
||||
|
||||
<div>
|
||||
<p className="mb-0 px-3 text-sm mt-1">
|
||||
{positionsData?.find((b) => b.id == positionId)?.name}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{goToEditUser ? (
|
||||
<Buttonbriz
|
||||
title="ویرایش کاربر"
|
||||
|
|
|
@ -0,0 +1,252 @@
|
|||
"use client";
|
||||
|
||||
import React, { useContext, useEffect, useRef, useState } from "react";
|
||||
import { BottomSheet } from "react-spring-bottom-sheet";
|
||||
import Input from "plugins/Input/page";
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import SimpleReactValidator from "simple-react-validator";
|
||||
import { toast } from "react-toastify";
|
||||
import Buttonbriz from "plugins/Buttonbriz/page";
|
||||
|
||||
const BottomSheetCreatePosition = (props) => {
|
||||
const CTX = useContext(AppContext);
|
||||
const [title, setTitle] = useState("");
|
||||
const [description, setDescription] = useState("");
|
||||
const [sectionId, setSectionId] = useState("");
|
||||
const [sectionIdSelectData, setSectionIdSelectData] = useState("");
|
||||
const [sectionIdSelectCurrntData, setSectionIdSelectCurrntData] =
|
||||
useState("");
|
||||
|
||||
const [, forceUpdate] = useState();
|
||||
|
||||
const validator = useRef(
|
||||
new SimpleReactValidator({
|
||||
messages: {
|
||||
required: "پر کردن این فیلد الزامی میباشد",
|
||||
},
|
||||
element: (message) => (
|
||||
<>
|
||||
<div className="text-right px-1 ">
|
||||
<small className="text-red-600 t-ig-small ">{message}</small>
|
||||
</div>
|
||||
</>
|
||||
),
|
||||
})
|
||||
);
|
||||
|
||||
const goToEditPosition = CTX.state.goToEditPosition;
|
||||
const idEditPosition = CTX.state.idEditPosition;
|
||||
const positionData = CTX.state.positionData;
|
||||
const sectionIdChoose = CTX.state.sectionIdChoose;
|
||||
const sectionsData = CTX.state.sectionsData;
|
||||
|
||||
const body = {
|
||||
description,
|
||||
title,
|
||||
sectionId,
|
||||
};
|
||||
|
||||
const bodyUpdate = {
|
||||
description,
|
||||
title,
|
||||
sectionId,
|
||||
id: idEditPosition,
|
||||
};
|
||||
|
||||
console.log(bodyUpdate);
|
||||
|
||||
const clear = () => {
|
||||
setTitle("");
|
||||
setDescription("");
|
||||
setSectionId("");
|
||||
setSectionIdSelectCurrntData("");
|
||||
};
|
||||
|
||||
const handleCreatePosition = (update) => {
|
||||
if (validator.current.allValid()) {
|
||||
if (update == "UPDATE") {
|
||||
CTX.UpdatePosition(bodyUpdate);
|
||||
} else {
|
||||
CTX.CreatePosition(body);
|
||||
}
|
||||
} else {
|
||||
toast.error("پرکردن همه ی فیلد ها واجب است", {
|
||||
position: "bottom-right",
|
||||
autoClose: 2000,
|
||||
hideProgressBar: false,
|
||||
closeOnClick: true,
|
||||
pauseOnHover: true,
|
||||
draggable: true,
|
||||
progress: undefined,
|
||||
});
|
||||
|
||||
validator.current.showMessages();
|
||||
forceUpdate(1);
|
||||
}
|
||||
};
|
||||
|
||||
const handleBottomSheetCreatePositionOpen = (e) => {
|
||||
setSectionIdSelectData(
|
||||
sectionsData?.map((item) => ({
|
||||
key: item.name,
|
||||
value: item.id,
|
||||
}))
|
||||
);
|
||||
if (e.type == "OPEN") {
|
||||
CTX.GetSections();
|
||||
if (goToEditPosition) {
|
||||
CTX.GetPosition(idEditPosition);
|
||||
}
|
||||
} else if (e.type == "CLOSE") {
|
||||
clear();
|
||||
CTX.setGoToEditPosition(false);
|
||||
CTX.setIdEditPosition(null);
|
||||
CTX.setPositionData([]);
|
||||
}
|
||||
};
|
||||
|
||||
const deleteSection = (id) => {
|
||||
CTX.setSectionIdChoose(sectionIdChoose.filter((el) => el !== id));
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (goToEditPosition) {
|
||||
setTitle(positionData.name);
|
||||
setDescription(positionData.description);
|
||||
setSectionId(positionData.sectionId);
|
||||
console.log("Position", positionData);
|
||||
}
|
||||
}, [positionData]);
|
||||
|
||||
console.log("sectionsData", sectionsData);
|
||||
console.log("sectionId", sectionId);
|
||||
|
||||
return (
|
||||
<BottomSheet
|
||||
onSpringStart={(e) => handleBottomSheetCreatePositionOpen(e)}
|
||||
open={CTX.state.BottomSheetCreatePositionOpen}
|
||||
onDismiss={() => CTX.setBottomSheetCreatePositionOpen(false)}
|
||||
blocking={false}
|
||||
>
|
||||
<div className="text-center py-2 bg-primary-300 ">
|
||||
<p className="mb-0 text-white relative top-[-5px]">
|
||||
افزودن پوزیشن جدید{" "}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="bg-body-100 p-4 ">
|
||||
<div className="">
|
||||
<Input
|
||||
lable="نام پوزیشن "
|
||||
id="title-id"
|
||||
name="title"
|
||||
type={"text"}
|
||||
value={title}
|
||||
inputEvent={(e) => {
|
||||
setTitle(e.target.value);
|
||||
validator.current.showMessageFor("title");
|
||||
}}
|
||||
style="text-right"
|
||||
validator={true}
|
||||
validatorData={validator.current.message(
|
||||
"title",
|
||||
title,
|
||||
"required"
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="">
|
||||
<Input
|
||||
lable=" توضیحات"
|
||||
id="description-id"
|
||||
name="description"
|
||||
type={"text"}
|
||||
value={description}
|
||||
inputEvent={(e) => {
|
||||
setDescription(e.target.value);
|
||||
validator.current.showMessageFor("description");
|
||||
}}
|
||||
textarea={true}
|
||||
style="text-right"
|
||||
validator={true}
|
||||
validatorData={validator.current.message(
|
||||
"description",
|
||||
description,
|
||||
"required"
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="">
|
||||
<Input
|
||||
lable="سکشن مد نظر"
|
||||
id="sectionId-id"
|
||||
name="sectionId"
|
||||
type={"text"}
|
||||
value={sectionIdSelectCurrntData}
|
||||
inputEvent={(e) => {
|
||||
setSectionId(e.target.value);
|
||||
// setSectionId(e.target.value);
|
||||
// if (!!sectionIdChoose.find((b) => b == e.target.value)) {
|
||||
// toast.error("سکشن تکراری است", {
|
||||
// position: "bottom-right",
|
||||
// closeOnClick: true,
|
||||
// });
|
||||
// } else {
|
||||
// CTX.setSectionIdChoose((current) => [
|
||||
// ...current,
|
||||
// e.target.value,
|
||||
// ]);
|
||||
// }
|
||||
}}
|
||||
style="text-right"
|
||||
validatorData={validator.current.message(
|
||||
"sectionId",
|
||||
sectionId,
|
||||
"required"
|
||||
)}
|
||||
select={true}
|
||||
selectData={sectionIdSelectData}
|
||||
defaultValue={"انتخاب کنید"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap mt-3 rtl">
|
||||
<div className="flex bg-gray-300 p-1 rounded-full m-1 justify-start">
|
||||
{/* <div
|
||||
className="w-[30px] h-[30px] rounded-full bg-gray-400 "
|
||||
onClick={() => deleteSection(e)}
|
||||
></div> */}
|
||||
|
||||
<div>
|
||||
<p className="mb-0 px-3 text-sm mt-1">
|
||||
{sectionsData?.find((b) => b.id == sectionId)?.name}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{goToEditPosition ? (
|
||||
<Buttonbriz
|
||||
title="ویرایش پوزیشن"
|
||||
color="INFO"
|
||||
icon="CHECK"
|
||||
buttonEvent={() => handleCreatePosition("UPDATE")}
|
||||
subButton={true}
|
||||
subButtonTitle="حذف پوزیشن"
|
||||
subButtonEvent={() => CTX.DeletePosition(idEditPosition)}
|
||||
/>
|
||||
) : (
|
||||
<Buttonbriz
|
||||
title="ثبت پوزیشن"
|
||||
color="PRIMARY"
|
||||
icon="CHECK"
|
||||
buttonEvent={() => handleCreatePosition()}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</BottomSheet>
|
||||
);
|
||||
};
|
||||
|
||||
export default BottomSheetCreatePosition;
|
|
@ -0,0 +1,178 @@
|
|||
"use client";
|
||||
|
||||
import React, { useContext, useEffect, useRef, useState } from "react";
|
||||
import { BottomSheet } from "react-spring-bottom-sheet";
|
||||
import Input from "plugins/Input/page";
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import SimpleReactValidator from "simple-react-validator";
|
||||
import { toast } from "react-toastify";
|
||||
import Buttonbriz from "plugins/Buttonbriz/page";
|
||||
|
||||
const BottomSheetCreateRoutine = (props) => {
|
||||
const CTX = useContext(AppContext);
|
||||
const [title, setTitle] = useState("");
|
||||
const [description, setDescription] = useState("");
|
||||
|
||||
const [, forceUpdate] = useState();
|
||||
|
||||
const validator = useRef(
|
||||
new SimpleReactValidator({
|
||||
messages: {
|
||||
required: "پر کردن این فیلد الزامی میباشد",
|
||||
},
|
||||
element: (message) => (
|
||||
<>
|
||||
<div className="text-right px-1 ">
|
||||
<small className="text-red-600 t-ig-small ">{message}</small>
|
||||
</div>
|
||||
</>
|
||||
),
|
||||
})
|
||||
);
|
||||
|
||||
const goToEditRoutine = CTX.state.goToEditRoutine;
|
||||
const idEditRoutine = CTX.state.idEditRoutine;
|
||||
const routineData = CTX.state.routineData;
|
||||
|
||||
const body = {
|
||||
description,
|
||||
title,
|
||||
};
|
||||
|
||||
const bodyUpdate = {
|
||||
description,
|
||||
title,
|
||||
id: idEditRoutine,
|
||||
};
|
||||
|
||||
console.log(bodyUpdate);
|
||||
|
||||
const clear = () => {
|
||||
setTitle("");
|
||||
setDescription("");
|
||||
};
|
||||
|
||||
const handleCreateRoutine = (update) => {
|
||||
if (validator.current.allValid()) {
|
||||
if (update == "UPDATE") {
|
||||
CTX.UpdateRoutine(bodyUpdate);
|
||||
} else {
|
||||
CTX.CreateRoutine(body);
|
||||
}
|
||||
} else {
|
||||
toast.error("پرکردن همه ی فیلد ها واجب است", {
|
||||
position: "bottom-right",
|
||||
autoClose: 2000,
|
||||
hideProgressBar: false,
|
||||
closeOnClick: true,
|
||||
pauseOnHover: true,
|
||||
draggable: true,
|
||||
progress: undefined,
|
||||
});
|
||||
|
||||
validator.current.showMessages();
|
||||
forceUpdate(1);
|
||||
}
|
||||
};
|
||||
|
||||
const handleBottomSheetCreateRoutineOpen = (e) => {
|
||||
if (e.type == "OPEN") {
|
||||
if (goToEditRoutine) {
|
||||
CTX.GetRoutine(idEditRoutine);
|
||||
}
|
||||
} else if (e.type == "CLOSE") {
|
||||
clear();
|
||||
CTX.setGoToEditRoutine(false);
|
||||
CTX.setIdEditRoutine(null);
|
||||
CTX.setRoutineData([]);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (goToEditRoutine) {
|
||||
setTitle(routineData.name);
|
||||
setDescription(routineData.description);
|
||||
console.log("sectionData", routineData);
|
||||
}
|
||||
}, [routineData]);
|
||||
|
||||
return (
|
||||
<BottomSheet
|
||||
onSpringStart={(e) => handleBottomSheetCreateRoutineOpen(e)}
|
||||
open={CTX.state.BottomSheetCreateRoutineOpen}
|
||||
onDismiss={() => CTX.setBottomSheetCreateRoutineOpen(false)}
|
||||
blocking={false}
|
||||
>
|
||||
<div className="text-center py-2 bg-primary-300 ">
|
||||
<p className="mb-0 text-white relative top-[-5px]">
|
||||
افزودن روتین جدید{" "}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="bg-body-100 p-4 ">
|
||||
<div className="">
|
||||
<Input
|
||||
lable="نام روتین "
|
||||
id="title-id"
|
||||
name="title"
|
||||
type={"text"}
|
||||
value={title}
|
||||
inputEvent={(e) => {
|
||||
setTitle(e.target.value);
|
||||
validator.current.showMessageFor("title");
|
||||
}}
|
||||
style="text-right"
|
||||
validator={true}
|
||||
validatorData={validator.current.message(
|
||||
"title",
|
||||
title,
|
||||
"required"
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="">
|
||||
<Input
|
||||
lable=" توضیحات"
|
||||
id="description-id"
|
||||
name="description"
|
||||
type={"text"}
|
||||
value={description}
|
||||
inputEvent={(e) => {
|
||||
setDescription(e.target.value);
|
||||
validator.current.showMessageFor("description");
|
||||
}}
|
||||
textarea={true}
|
||||
style="text-right"
|
||||
validator={true}
|
||||
validatorData={validator.current.message(
|
||||
"description",
|
||||
description,
|
||||
"required"
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{goToEditRoutine ? (
|
||||
<Buttonbriz
|
||||
title="ویرایش روتین"
|
||||
color="INFO"
|
||||
icon="CHECK"
|
||||
buttonEvent={() => handleCreateRoutine("UPDATE")}
|
||||
subButton={true}
|
||||
subButtonTitle="حذف روتین"
|
||||
subButtonEvent={() => CTX.DeleteRoutine(idEditRoutine)}
|
||||
/>
|
||||
) : (
|
||||
<Buttonbriz
|
||||
title="ثبت روتین"
|
||||
color="PRIMARY"
|
||||
icon="CHECK"
|
||||
buttonEvent={() => handleCreateRoutine()}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</BottomSheet>
|
||||
);
|
||||
};
|
||||
|
||||
export default BottomSheetCreateRoutine;
|
|
@ -0,0 +1,176 @@
|
|||
"use client";
|
||||
|
||||
import React, { useContext, useEffect, useRef, useState } from "react";
|
||||
import { BottomSheet } from "react-spring-bottom-sheet";
|
||||
import Input from "plugins/Input/page";
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import SimpleReactValidator from "simple-react-validator";
|
||||
import { toast } from "react-toastify";
|
||||
import Buttonbriz from "plugins/Buttonbriz/page";
|
||||
|
||||
const BottomSheetCreateSection = (props) => {
|
||||
const CTX = useContext(AppContext);
|
||||
const [title, setTitle] = useState("");
|
||||
const [description, setDescription] = useState("");
|
||||
|
||||
const [, forceUpdate] = useState();
|
||||
|
||||
const validator = useRef(
|
||||
new SimpleReactValidator({
|
||||
messages: {
|
||||
required: "پر کردن این فیلد الزامی میباشد",
|
||||
},
|
||||
element: (message) => (
|
||||
<>
|
||||
<div className="text-right px-1 ">
|
||||
<small className="text-red-600 t-ig-small ">{message}</small>
|
||||
</div>
|
||||
</>
|
||||
),
|
||||
})
|
||||
);
|
||||
|
||||
const goToEditSection = CTX.state.goToEditSection;
|
||||
const idEditSection = CTX.state.idEditSection;
|
||||
const sectionData = CTX.state.sectionData;
|
||||
|
||||
const body = {
|
||||
description,
|
||||
title,
|
||||
};
|
||||
|
||||
const bodyUpdate = {
|
||||
description,
|
||||
title,
|
||||
id: idEditSection,
|
||||
};
|
||||
|
||||
console.log(bodyUpdate);
|
||||
|
||||
const clear = () => {
|
||||
setTitle("");
|
||||
setDescription("");
|
||||
};
|
||||
|
||||
const handleCreateSection = (update) => {
|
||||
if (validator.current.allValid()) {
|
||||
if (update == "UPDATE") {
|
||||
CTX.UpdateSection(bodyUpdate);
|
||||
} else {
|
||||
CTX.CreateSection(body);
|
||||
}
|
||||
} else {
|
||||
toast.error("پرکردن همه ی فیلد ها واجب است", {
|
||||
position: "bottom-right",
|
||||
autoClose: 2000,
|
||||
hideProgressBar: false,
|
||||
closeOnClick: true,
|
||||
pauseOnHover: true,
|
||||
draggable: true,
|
||||
progress: undefined,
|
||||
});
|
||||
|
||||
validator.current.showMessages();
|
||||
forceUpdate(1);
|
||||
}
|
||||
};
|
||||
|
||||
const handleBottomSheetCreateSectionOpen = (e) => {
|
||||
if (e.type == "OPEN") {
|
||||
if (goToEditSection) {
|
||||
CTX.GetSection(idEditSection);
|
||||
}
|
||||
} else if (e.type == "CLOSE") {
|
||||
clear();
|
||||
CTX.setGoToEditSection(false);
|
||||
CTX.setIdEditSection(null);
|
||||
CTX.setSectionData([]);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (goToEditSection) {
|
||||
setTitle(sectionData.name);
|
||||
setDescription(sectionData.description);
|
||||
console.log("sectionData", sectionData);
|
||||
}
|
||||
}, [sectionData]);
|
||||
|
||||
return (
|
||||
<BottomSheet
|
||||
onSpringStart={(e) => handleBottomSheetCreateSectionOpen(e)}
|
||||
open={CTX.state.BottomSheetCreateSectionOpen}
|
||||
onDismiss={() => CTX.setBottomSheetCreateSectionOpen(false)}
|
||||
blocking={false}
|
||||
>
|
||||
<div className="text-center py-2 bg-primary-300 ">
|
||||
<p className="mb-0 text-white relative top-[-5px]">افزودن سکشن جدید </p>
|
||||
</div>
|
||||
|
||||
<div className="bg-body-100 p-4 ">
|
||||
<div className="">
|
||||
<Input
|
||||
lable="نام سکشن "
|
||||
id="title-id"
|
||||
name="title"
|
||||
type={"text"}
|
||||
value={title}
|
||||
inputEvent={(e) => {
|
||||
setTitle(e.target.value);
|
||||
validator.current.showMessageFor("title");
|
||||
}}
|
||||
style="text-right"
|
||||
validator={true}
|
||||
validatorData={validator.current.message(
|
||||
"title",
|
||||
title,
|
||||
"required"
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="">
|
||||
<Input
|
||||
lable=" توضیحات"
|
||||
id="description-id"
|
||||
name="description"
|
||||
type={"text"}
|
||||
value={description}
|
||||
inputEvent={(e) => {
|
||||
setDescription(e.target.value);
|
||||
validator.current.showMessageFor("description");
|
||||
}}
|
||||
textarea={true}
|
||||
style="text-right"
|
||||
validator={true}
|
||||
validatorData={validator.current.message(
|
||||
"description",
|
||||
description,
|
||||
"required"
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{goToEditSection ? (
|
||||
<Buttonbriz
|
||||
title="ویرایش سکشن"
|
||||
color="INFO"
|
||||
icon="CHECK"
|
||||
buttonEvent={() => handleCreateSection("UPDATE")}
|
||||
subButton={true}
|
||||
subButtonTitle="حذف سکشن"
|
||||
subButtonEvent={() => CTX.DeleteSection(idEditSection)}
|
||||
/>
|
||||
) : (
|
||||
<Buttonbriz
|
||||
title="ثبت سکشن"
|
||||
color="PRIMARY"
|
||||
icon="CHECK"
|
||||
buttonEvent={() => handleCreateSection()}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</BottomSheet>
|
||||
);
|
||||
};
|
||||
|
||||
export default BottomSheetCreateSection;
|
|
@ -15,6 +15,7 @@ const BottomSheetCreateShifts = (props) => {
|
|||
const [dayOfWeeksCurrent, setDayOfWeeksCurrent] = useState("");
|
||||
const [, forceUpdate] = useState();
|
||||
|
||||
const dayOfWeeksChoose = CTX.state.dayOfWeeksChoose;
|
||||
const startAtTimeShift = CTX.state.startAtTimeShift;
|
||||
const endAtTimeShift = CTX.state.endAtTimeShift;
|
||||
const goToEditShift = CTX.state.goToEditShift;
|
||||
|
@ -36,12 +37,25 @@ const BottomSheetCreateShifts = (props) => {
|
|||
})
|
||||
);
|
||||
|
||||
console.log("dayOfWeeksChoose", dayOfWeeksChoose);
|
||||
|
||||
const week = [
|
||||
{ key: "شنبه", value: 6 },
|
||||
{ key: "یکشنبه", value: 0 },
|
||||
{ key: "دوشنبه", value: 1 },
|
||||
{ key: "سه شنبه", value: 2 },
|
||||
{ key: "چهار شنبه", value: 3 },
|
||||
{ key: "پنج شنبه", value: 4 },
|
||||
{ key: "جمعه", value: 5 },
|
||||
];
|
||||
|
||||
const clear = () => {
|
||||
setDayOfWeeksCurrent("");
|
||||
setDescription("");
|
||||
setTitle("");
|
||||
// CTX.setEndAtTimeShift(["00", "00"]);
|
||||
// CTX.setStartAtTimeShift(["00", "00"]);
|
||||
CTX.setEndAtTimeShift(["00", "00"]);
|
||||
CTX.setStartAtTimeShift(["00", "00"]);
|
||||
CTX.setDayOfWeeksChoose([]);
|
||||
};
|
||||
|
||||
const body = {
|
||||
|
@ -49,6 +63,7 @@ const BottomSheetCreateShifts = (props) => {
|
|||
description,
|
||||
endAt: endAtTimeShift[0] + ":" + endAtTimeShift[1] + ":00",
|
||||
startAt: startAtTimeShift[0] + ":" + startAtTimeShift[1] + ":00",
|
||||
dayOfWeeks: dayOfWeeksChoose,
|
||||
};
|
||||
|
||||
const bodyUpdate = {
|
||||
|
@ -56,9 +71,9 @@ const BottomSheetCreateShifts = (props) => {
|
|||
description,
|
||||
endAt: endAtTimeShift[0] + ":" + endAtTimeShift[1] + ":00",
|
||||
startAt: startAtTimeShift[0] + ":" + startAtTimeShift[1] + ":00",
|
||||
dayOfWeeks: dayOfWeeksChoose,
|
||||
id: shiftData.id,
|
||||
};
|
||||
|
||||
const handleCreateShift = (update) => {
|
||||
if (validator.current.allValid()) {
|
||||
if (update == "UPDATE") {
|
||||
|
@ -97,6 +112,11 @@ const BottomSheetCreateShifts = (props) => {
|
|||
}
|
||||
};
|
||||
|
||||
const deleteRole = (value) => {
|
||||
console.log(value);
|
||||
CTX.setDayOfWeeksChoose(dayOfWeeksChoose.filter((el) => el !== value));
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (goToEditShift) {
|
||||
setTitle(shiftData.title);
|
||||
|
@ -109,6 +129,8 @@ const BottomSheetCreateShifts = (props) => {
|
|||
shiftData.endAt.split(":")[0],
|
||||
shiftData.endAt.split(":")[1],
|
||||
]);
|
||||
|
||||
CTX.setDayOfWeeksChoose(shiftData.days);
|
||||
}
|
||||
}, [shiftData]);
|
||||
|
||||
|
@ -157,10 +179,18 @@ const BottomSheetCreateShifts = (props) => {
|
|||
inputEvent={(e) => {
|
||||
validator.current.showMessageFor("startAt");
|
||||
}}
|
||||
inputFocus={() => {
|
||||
inputFocus={(e) => {
|
||||
if (goToEditShift) {
|
||||
toast.error("ویرایش ساعت ممکن نیست", {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
} else {
|
||||
CTX.setOpenTimePicker(true);
|
||||
CTX.setBottomSheetCreateShiftsOpen(false);
|
||||
CTX.setTimePickerOrder("CREATE-SHIFT-START");
|
||||
e.preventDefault();
|
||||
}
|
||||
}}
|
||||
style="text-right"
|
||||
validator={true}
|
||||
|
@ -182,10 +212,18 @@ const BottomSheetCreateShifts = (props) => {
|
|||
inputEvent={(e) => {
|
||||
validator.current.showMessageFor("startAt");
|
||||
}}
|
||||
inputFocus={() => {
|
||||
inputFocus={(e) => {
|
||||
if (goToEditShift) {
|
||||
toast.error("ویرایش ساعت ممکن نیست", {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
} else {
|
||||
CTX.setOpenTimePicker(true);
|
||||
CTX.setBottomSheetCreateShiftsOpen(false);
|
||||
CTX.setTimePickerOrder("CREATE-SHIFT-END");
|
||||
e.preventDefault();
|
||||
}
|
||||
}}
|
||||
style="text-right"
|
||||
validator={true}
|
||||
|
@ -194,9 +232,65 @@ const BottomSheetCreateShifts = (props) => {
|
|||
endAtTimeShift,
|
||||
"required"
|
||||
)}
|
||||
readOnly={true}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="">
|
||||
<Input
|
||||
lable="انتخاب روزهای این شیفت در هفته"
|
||||
id="dayOfWeeksCurrent-id"
|
||||
name="dayOfWeeksCurrent"
|
||||
type={"text"}
|
||||
value={dayOfWeeksCurrent}
|
||||
inputEvent={(e) => {
|
||||
setDayOfWeeksCurrent(e.target.value);
|
||||
|
||||
if (!!dayOfWeeksChoose.find((b) => b == e.target.value)) {
|
||||
toast.error("روز تکراری است", {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
} else {
|
||||
CTX.setDayOfWeeksChoose((current) => [
|
||||
...current,
|
||||
parseInt(e.target.value),
|
||||
]);
|
||||
}
|
||||
}}
|
||||
style="text-right"
|
||||
select={true}
|
||||
selectData={[
|
||||
{ key: "شنبه", value: parseInt(6) },
|
||||
{ key: "یکشنبه", value: 0 },
|
||||
{ key: "دوشنبه", value: 1 },
|
||||
{ key: "سه شنبه", value: 2 },
|
||||
{ key: "چهار شنبه", value: 3 },
|
||||
{ key: "پنج شنبه", value: 4 },
|
||||
{ key: "جمعه", value: 5 },
|
||||
]}
|
||||
defaultValue={"انتخاب کنید"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap mt-3 rtl">
|
||||
{dayOfWeeksChoose &&
|
||||
dayOfWeeksChoose.map((e) => (
|
||||
<div className="flex bg-gray-300 p-1 rounded-full m-1 justify-start">
|
||||
<div
|
||||
className="w-[30px] h-[30px] rounded-full bg-gray-400 "
|
||||
onClick={() => deleteRole(e)}
|
||||
></div>
|
||||
|
||||
<div>
|
||||
<p className="mb-0 px-3 text-sm mt-1">
|
||||
{week?.find((b) => b.value == e).key}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="">
|
||||
<Input
|
||||
lable=" توضیحات"
|
||||
|
|
|
@ -18,6 +18,7 @@ const Input = ({
|
|||
validatorData,
|
||||
select,
|
||||
selectData,
|
||||
defaultValue,
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
|
@ -28,7 +29,7 @@ const Input = ({
|
|||
{textarea ? (
|
||||
<textarea
|
||||
type="text"
|
||||
className={`peer w-full border-b placeholder:text-transparent relative ${
|
||||
className={`peer w-full border-b placeholder:text-transparent relative rtl ${
|
||||
theme == 1 ? "form-control-white" : "form-control"
|
||||
}`}
|
||||
placeholder={name}
|
||||
|
@ -39,7 +40,7 @@ const Input = ({
|
|||
/>
|
||||
) : select ? (
|
||||
<select
|
||||
className={`peer w-full border-b placeholder:text-transparent ${
|
||||
className={`peer w-full border-b placeholder:text-transparent rtl ${
|
||||
theme == 1 ? "form-control-white" : "form-control"
|
||||
} ${style ? style : ""} relative`}
|
||||
placeholder={name}
|
||||
|
@ -48,7 +49,14 @@ const Input = ({
|
|||
value={value}
|
||||
onChange={inputEvent}
|
||||
id={id}
|
||||
defaultValue=""
|
||||
>
|
||||
{defaultValue && (
|
||||
<option value="" disabled hidden>
|
||||
{defaultValue}
|
||||
</option>
|
||||
)}
|
||||
|
||||
{selectData &&
|
||||
selectData.map((e) => <option value={e.value}>{e.key}</option>)}
|
||||
</select>
|
||||
|
@ -56,7 +64,7 @@ const Input = ({
|
|||
<input
|
||||
type={type}
|
||||
id={id}
|
||||
className={`peer w-full border-b placeholder:text-transparent ${
|
||||
className={`peer w-full border-b placeholder:text-transparent rtl ${
|
||||
theme == 1 ? "form-control-white" : "form-control"
|
||||
} ${style ? style : ""} relative`}
|
||||
placeholder={name}
|
||||
|
|
|
@ -8,8 +8,8 @@ import { useState, useEffect, useRef, useContext } from "react";
|
|||
const TimePicker = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
|
||||
const [hureSelect, setHureSelect] = useState(0);
|
||||
const [secondSelect, setSecondSelect] = useState(0);
|
||||
const [hureSelect, setHureSelect] = useState("00");
|
||||
const [secondSelect, setSecondSelect] = useState("00");
|
||||
const [time, setTime] = useState(["00", "00"]);
|
||||
const hoursArray = Array.from({ length: 24 }, (_, index) => {
|
||||
const formattedHour = index < 10 ? `0${index}` : `${index}`;
|
||||
|
|
|
@ -1,25 +1,41 @@
|
|||
"use client";
|
||||
|
||||
import AppHeader from "@comp/AppHeader/page";
|
||||
import PositionEmployees from "@comp/EmployeesComponent/Position/page";
|
||||
import RolesEmployees from "@comp/EmployeesComponent/Roles/page";
|
||||
import Roles from "@comp/EmployeesComponent/Roles/page";
|
||||
import SectionEmployees from "@comp/EmployeesComponent/Sections/page";
|
||||
import UsersEmployees from "@comp/EmployeesComponent/Users/page";
|
||||
import RoutineEmployees from "@comp/EmployeesComponent/routine/page";
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import BottomSheetCreateEmployees from "plugins/BottomSheet/BottomSheetCreateEmployees";
|
||||
import BottomSheetCreatePosition from "plugins/BottomSheet/BottomSheetCreatePosition";
|
||||
import BottomSheetCreateRole from "plugins/BottomSheet/BottomSheetCreateRole";
|
||||
import BottomSheetCreateRoutine from "plugins/BottomSheet/BottomSheetCreateRoutine";
|
||||
import BottomSheetCreateSection from "plugins/BottomSheet/BottomSheetCreateSection";
|
||||
import PersianNumber from "plugins/PersianNumber";
|
||||
import React, { useContext, useEffect } from "react";
|
||||
import React, { useContext, useEffect, useState } from "react";
|
||||
|
||||
// import second from "@img/test.png";
|
||||
|
||||
const Employees = (props) => {
|
||||
const CTX = useContext(AppContext);
|
||||
|
||||
const [activeSection, setActiveSection] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
CTX.GetRoles();
|
||||
CTX.GetUsers();
|
||||
CTX.GetRoutines();
|
||||
CTX.GetSections();
|
||||
CTX.GetPositions();
|
||||
}, []);
|
||||
|
||||
const routinesData = CTX.state.routinesData;
|
||||
const sectionsData = CTX.state.sectionsData;
|
||||
const usersData = CTX.state.usersData;
|
||||
const positionsData = CTX.state.positionsData;
|
||||
|
||||
return (
|
||||
<div className="pb-20">
|
||||
<AppHeader
|
||||
|
@ -33,14 +49,69 @@ const Employees = (props) => {
|
|||
}}
|
||||
/>
|
||||
|
||||
<div className="bg-body-100 relative top-[-30px] rounded-t-3xl overflow-hidden p-5 rtl">
|
||||
<div className="flex justify-between mt-3">
|
||||
<div className="bg-body-100 relative top-[-30px] rounded-t-3xl overflow-hidden p-3 rtl">
|
||||
<div>
|
||||
<h4 className="text-base font-bold">مدیریت نقش های مجموعه</h4>
|
||||
<p className="mb-0 text-sm">
|
||||
<div
|
||||
className="flex justify-between mt-7 bg-white rounded-2xl"
|
||||
onClick={() => setActiveSection(0)}
|
||||
>
|
||||
<div className="flex p-2">
|
||||
<div className="bg-gray-100 rounded-xl p-3 w-fit">
|
||||
<p className="mb-0 text-center pt-3">
|
||||
<PersianNumber number={1} style="text-[30px] " />
|
||||
</p>
|
||||
</div>
|
||||
<div className="m-2">
|
||||
<h4 className="text-base font-bold">
|
||||
مدیریت روتین های مجموعه
|
||||
</h4>
|
||||
<p className="mb-0 text-[10px] opacity-90 ">
|
||||
شما
|
||||
<strong className="mx-1 text-primary-300">
|
||||
<PersianNumber number={24} />
|
||||
<PersianNumber number={routinesData?.length} />
|
||||
</strong>
|
||||
روتین فعال دارید
|
||||
</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>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{activeSection == 0 && <RoutineEmployees />}
|
||||
</div>
|
||||
|
||||
{/* <div className="flex justify-between mt-3">
|
||||
<div>
|
||||
<h4 className="text-base font-bold">مدیریت نقش های مجموعه</h4>
|
||||
<p className="mb-0 text-[10px] opacity-90 ">
|
||||
شما
|
||||
<strong className="mx-1 text-primary-300">
|
||||
<PersianNumber number={rolesData?.length} />
|
||||
</strong>
|
||||
نقش فعال دارید
|
||||
</p>
|
||||
|
@ -69,22 +140,138 @@ const Employees = (props) => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<RolesEmployees />
|
||||
<RolesEmployees /> */}
|
||||
|
||||
<div className="flex justify-between mt-7">
|
||||
<div>
|
||||
<h4 className="text-base font-bold">مدیریت کارکنان مجموعه</h4>
|
||||
<p className="mb-0 text-sm">
|
||||
<div
|
||||
className="flex justify-between mt-7 bg-white rounded-2xl"
|
||||
onClick={() => setActiveSection(1)}
|
||||
>
|
||||
<div className="flex p-2">
|
||||
<div className="bg-gray-100 rounded-xl p-3 w-fit">
|
||||
<p className="mb-0 text-center pt-3">
|
||||
<PersianNumber number={2} style="text-[30px] " />
|
||||
</p>
|
||||
</div>
|
||||
<div className="m-2">
|
||||
<h4 className="text-base font-bold">مدیریت سکشن ها مجموعه</h4>
|
||||
<p className="mb-0 text-[10px] opacity-90 ">
|
||||
شما
|
||||
<strong className="mx-1 text-primary-300">
|
||||
<PersianNumber number={24} />
|
||||
<PersianNumber number={sectionsData?.length} />
|
||||
</strong>
|
||||
سکشن فعال دارید
|
||||
</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>
|
||||
)}
|
||||
</div>
|
||||
{activeSection == 1 && <SectionEmployees />}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div
|
||||
className="flex justify-between mt-7 bg-white rounded-2xl"
|
||||
onClick={() => setActiveSection(2)}
|
||||
>
|
||||
<div className="flex p-2">
|
||||
<div className="bg-gray-100 rounded-xl p-3 w-fit">
|
||||
<p className="mb-0 text-center pt-3">
|
||||
<PersianNumber number={3} style="text-[30px] " />
|
||||
</p>
|
||||
</div>
|
||||
<div className="m-2">
|
||||
<h4 className="text-base font-bold">
|
||||
مدیریت پوزیشن های مجموعه
|
||||
</h4>
|
||||
<p className="mb-0 text-[10px] opacity-90 ">
|
||||
شما
|
||||
<strong className="mx-1 text-primary-300">
|
||||
<PersianNumber number={positionsData?.length} />
|
||||
</strong>
|
||||
پوزیشن فعال دارید
|
||||
</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>
|
||||
)}
|
||||
</div>
|
||||
{activeSection == 2 && <PositionEmployees />}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div
|
||||
className="flex justify-between mt-7 bg-white rounded-2xl"
|
||||
onClick={() => setActiveSection(3)}
|
||||
>
|
||||
<div className="flex p-2">
|
||||
<div className="bg-gray-100 rounded-xl p-3 w-fit">
|
||||
<p className="mb-0 text-center pt-3">
|
||||
<PersianNumber number={4} style="text-[30px] " />
|
||||
</p>
|
||||
</div>
|
||||
<div className="m-2">
|
||||
<h4 className="text-base font-bold">مدیریت کارکنان مجموعه</h4>
|
||||
<p className="mb-0 text-[10px] opacity-90 ">
|
||||
شما
|
||||
<strong className="mx-1 text-primary-300">
|
||||
<PersianNumber number={usersData?.length} />
|
||||
</strong>
|
||||
کارمند فعال دارید
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{activeSection == 3 ? (
|
||||
<div
|
||||
className="w-[40px] h-[40px] bg-white shadow-sm rounded-xl "
|
||||
className="w-[40px] h-[40px] bg-gray-100 shadow-sm rounded-xl m-[15px] "
|
||||
onClick={() => CTX.setBottomSheetCreateEmployeesOpen(true)}
|
||||
>
|
||||
<svg
|
||||
|
@ -104,12 +291,18 @@ const Employees = (props) => {
|
|||
/>
|
||||
</svg>
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-[10px] h-[10px] bg-gray-200 shadow-sm rounded-xl m-[15px] "></div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<UsersEmployees />
|
||||
{activeSection == 3 && <UsersEmployees />}
|
||||
</div>
|
||||
<BottomSheetCreateRole />
|
||||
</div>
|
||||
{/* <BottomSheetCreateRole /> */}
|
||||
<BottomSheetCreateEmployees />
|
||||
<BottomSheetCreateSection />
|
||||
<BottomSheetCreateRoutine />
|
||||
<BottomSheetCreatePosition />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"use client";
|
||||
|
||||
import AppHeader from "@comp/AppHeader/page";
|
||||
import TaskCard from "@comp/TaskCard/page";
|
||||
// import TaskCard from "@comp/TaskCard/page";
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
@ -9,7 +9,7 @@ import { getToken } from "plugins/Chapar";
|
|||
import { ParseJwt } from "plugins/ParseJwt/page";
|
||||
import PersianNumber from "plugins/PersianNumber";
|
||||
import React, { useContext, useEffect } from "react";
|
||||
import { Swiper, SwiperSlide } from "swiper/react";
|
||||
// import { Swiper, SwiperSlide } from "swiper/react";
|
||||
|
||||
const Home = (props) => {
|
||||
const CTX = useContext(AppContext);
|
||||
|
@ -53,203 +53,7 @@ const Home = (props) => {
|
|||
/>
|
||||
|
||||
<div className="bg-body-100 relative top-[-30px] rounded-t-3xl overflow-hidden p-5 rtl">
|
||||
<div className="flex justify-between">
|
||||
<div>
|
||||
<h4 className="text-base font-bold">تسک های هفتگی مجموعه</h4>
|
||||
<p className="mb-0 text-sm">
|
||||
امروز
|
||||
<strong className="mx-1 text-primary-300">
|
||||
<PersianNumber number={24} />
|
||||
</strong>
|
||||
تسک فعال دارید
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="w-[40px] h-[40px] bg-white shadow-sm rounded-xl">
|
||||
<svg
|
||||
width="23"
|
||||
height="27"
|
||||
viewBox="0 0 16 20"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[6px]"
|
||||
>
|
||||
<path
|
||||
d="M5 3.00001C4.73478 3.00001 4.48043 3.10537 4.29289 3.2929C4.10536 3.48044 4 3.73479 4 4.00001C4 4.26523 4.10536 4.51958 4.29289 4.70712C4.48043 4.89465 4.73478 5.00001 5 5.00001C5.26522 5.00001 5.51957 4.89465 5.70711 4.70712C5.89464 4.51958 6 4.26523 6 4.00001C6 3.73479 5.89464 3.48044 5.70711 3.2929C5.51957 3.10537 5.26522 3.00001 5 3.00001ZM2.17 3.00001C2.3766 2.41448 2.75974 1.90744 3.2666 1.5488C3.77346 1.19015 4.37909 0.997559 5 0.997559C5.62091 0.997559 6.22654 1.19015 6.7334 1.5488C7.24026 1.90744 7.6234 2.41448 7.83 3.00001H15C15.2652 3.00001 15.5196 3.10537 15.7071 3.2929C15.8946 3.48044 16 3.73479 16 4.00001C16 4.26523 15.8946 4.51958 15.7071 4.70712C15.5196 4.89465 15.2652 5.00001 15 5.00001H7.83C7.6234 5.58554 7.24026 6.09258 6.7334 6.45122C6.22654 6.80986 5.62091 7.00246 5 7.00246C4.37909 7.00246 3.77346 6.80986 3.2666 6.45122C2.75974 6.09258 2.3766 5.58554 2.17 5.00001H1C0.734784 5.00001 0.48043 4.89465 0.292893 4.70712C0.105357 4.51958 0 4.26523 0 4.00001C0 3.73479 0.105357 3.48044 0.292893 3.2929C0.48043 3.10537 0.734784 3.00001 1 3.00001H2.17ZM11 9.00001C10.7348 9.00001 10.4804 9.10537 10.2929 9.2929C10.1054 9.48044 10 9.73479 10 10C10 10.2652 10.1054 10.5196 10.2929 10.7071C10.4804 10.8947 10.7348 11 11 11C11.2652 11 11.5196 10.8947 11.7071 10.7071C11.8946 10.5196 12 10.2652 12 10C12 9.73479 11.8946 9.48044 11.7071 9.2929C11.5196 9.10537 11.2652 9.00001 11 9.00001ZM8.17 9.00001C8.3766 8.41448 8.75974 7.90744 9.2666 7.5488C9.77346 7.19015 10.3791 6.99756 11 6.99756C11.6209 6.99756 12.2265 7.19015 12.7334 7.5488C13.2403 7.90744 13.6234 8.41448 13.83 9.00001H15C15.2652 9.00001 15.5196 9.10537 15.7071 9.2929C15.8946 9.48044 16 9.73479 16 10C16 10.2652 15.8946 10.5196 15.7071 10.7071C15.5196 10.8947 15.2652 11 15 11H13.83C13.6234 11.5855 13.2403 12.0926 12.7334 12.4512C12.2265 12.8099 11.6209 13.0025 11 13.0025C10.3791 13.0025 9.77346 12.8099 9.2666 12.4512C8.75974 12.0926 8.3766 11.5855 8.17 11H1C0.734784 11 0.48043 10.8947 0.292893 10.7071C0.105357 10.5196 0 10.2652 0 10C0 9.73479 0.105357 9.48044 0.292893 9.2929C0.48043 9.10537 0.734784 9.00001 1 9.00001H8.17ZM5 15C4.73478 15 4.48043 15.1054 4.29289 15.2929C4.10536 15.4804 4 15.7348 4 16C4 16.2652 4.10536 16.5196 4.29289 16.7071C4.48043 16.8947 4.73478 17 5 17C5.26522 17 5.51957 16.8947 5.70711 16.7071C5.89464 16.5196 6 16.2652 6 16C6 15.7348 5.89464 15.4804 5.70711 15.2929C5.51957 15.1054 5.26522 15 5 15ZM2.17 15C2.3766 14.4145 2.75974 13.9074 3.2666 13.5488C3.77346 13.1902 4.37909 12.9976 5 12.9976C5.62091 12.9976 6.22654 13.1902 6.7334 13.5488C7.24026 13.9074 7.6234 14.4145 7.83 15H15C15.2652 15 15.5196 15.1054 15.7071 15.2929C15.8946 15.4804 16 15.7348 16 16C16 16.2652 15.8946 16.5196 15.7071 16.7071C15.5196 16.8947 15.2652 17 15 17H7.83C7.6234 17.5855 7.24026 18.0926 6.7334 18.4512C6.22654 18.8099 5.62091 19.0025 5 19.0025C4.37909 19.0025 3.77346 18.8099 3.2666 18.4512C2.75974 18.0926 2.3766 17.5855 2.17 17H1C0.734784 17 0.48043 16.8947 0.292893 16.7071C0.105357 16.5196 0 16.2652 0 16C0 15.7348 0.105357 15.4804 0.292893 15.2929C0.48043 15.1054 0.734784 15 1 15H2.17Z"
|
||||
fill="#666666"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Swiper
|
||||
spaceBetween={20}
|
||||
slidesPerView={1.6}
|
||||
onSlideChange={() => console.log("slide change")}
|
||||
onSwiper={(swiper) => console.log(swiper)}
|
||||
>
|
||||
<SwiperSlide>
|
||||
<div className=" bg-white h-[180px] rounded-3xl overflow-hidden relative mt-5">
|
||||
<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">
|
||||
اهمیت بالا{" "}
|
||||
</div>
|
||||
<div className="bg-secondaryLighter-100 w-fit relative px-2 text-[12px] my-2 mx-1 rounded-3xl text-secondary-200">
|
||||
شیفت صبح
|
||||
</div>
|
||||
</div>
|
||||
<div className=" relative m-2 text-white">
|
||||
<div className="text-right">
|
||||
<h4 className="mb-0 text-primary-300 font-semibold text-sm">
|
||||
کارگاه بدنسازی در خانه برای رستوران توگک
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div className="flex">
|
||||
<div className="flex rtl mt-2 w-full">
|
||||
<div className="absolute right-[0px] bg-red-900 w-[40px] h-[40px] rounded-full border-2 z-[1]"></div>
|
||||
<div className="absolute right-[13px] bg-green-900 w-[40px] h-[40px] rounded-full border-2 z-[2]"></div>
|
||||
<div className="absolute right-[26px] bg-sky-900 w-[40px] h-[40px] rounded-full border-2 z-[3]"></div>
|
||||
</div>
|
||||
|
||||
<div className="relative w-full">
|
||||
<p className="text-black text-sm mt-4">
|
||||
+
|
||||
<strong className="mx-1">
|
||||
<PersianNumber number={3} />
|
||||
</strong>
|
||||
نفر دیگر
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex mt-6 relative">
|
||||
<div>
|
||||
<svg
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 14 14"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M11.0833 2.33332H9.91667V1.74999C9.91667 1.59528 9.85522 1.44691 9.74582 1.33751C9.63642 1.22811 9.48805 1.16666 9.33334 1.16666C9.17863 1.16666 9.03026 1.22811 8.92086 1.33751C8.81146 1.44691 8.75001 1.59528 8.75001 1.74999V2.33332H5.25001V1.74999C5.25001 1.59528 5.18855 1.44691 5.07915 1.33751C4.96975 1.22811 4.82138 1.16666 4.66667 1.16666C4.51196 1.16666 4.36359 1.22811 4.25419 1.33751C4.1448 1.44691 4.08334 1.59528 4.08334 1.74999V2.33332H2.91667C2.45254 2.33332 2.00742 2.5177 1.67923 2.84589C1.35105 3.17408 1.16667 3.61919 1.16667 4.08332V11.0833C1.16667 11.5475 1.35105 11.9926 1.67923 12.3208C2.00742 12.6489 2.45254 12.8333 2.91667 12.8333H11.0833C11.5475 12.8333 11.9926 12.6489 12.3208 12.3208C12.649 11.9926 12.8333 11.5475 12.8333 11.0833V4.08332C12.8333 3.61919 12.649 3.17408 12.3208 2.84589C11.9926 2.5177 11.5475 2.33332 11.0833 2.33332ZM11.6667 11.0833C11.6667 11.238 11.6052 11.3864 11.4958 11.4958C11.3864 11.6052 11.238 11.6667 11.0833 11.6667H2.91667C2.76196 11.6667 2.61359 11.6052 2.50419 11.4958C2.3948 11.3864 2.33334 11.238 2.33334 11.0833V6.99999H11.6667V11.0833ZM11.6667 5.83332H2.33334V4.08332C2.33334 3.92861 2.3948 3.78024 2.50419 3.67084C2.61359 3.56145 2.76196 3.49999 2.91667 3.49999H4.08334V4.08332C4.08334 4.23803 4.1448 4.38641 4.25419 4.4958C4.36359 4.6052 4.51196 4.66666 4.66667 4.66666C4.82138 4.66666 4.96975 4.6052 5.07915 4.4958C5.18855 4.38641 5.25001 4.23803 5.25001 4.08332V3.49999H8.75001V4.08332C8.75001 4.23803 8.81146 4.38641 8.92086 4.4958C9.03026 4.6052 9.17863 4.66666 9.33334 4.66666C9.48805 4.66666 9.63642 4.6052 9.74582 4.4958C9.85522 4.38641 9.91667 4.23803 9.91667 4.08332V3.49999H11.0833C11.238 3.49999 11.3864 3.56145 11.4958 3.67084C11.6052 3.78024 11.6667 3.92861 11.6667 4.08332V5.83332Z"
|
||||
fill="#888888"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<p className="mb-0 text-textMain-100 text-sm opacity-70 mr-1">
|
||||
دوشنبه
|
||||
<strong className="mx-1">
|
||||
<PersianNumber number={19} />
|
||||
</strong>
|
||||
اردیبهشت
|
||||
<strong className="mx-1">
|
||||
<PersianNumber number={1401} />
|
||||
</strong>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</SwiperSlide>
|
||||
|
||||
<SwiperSlide>
|
||||
<div className=" bg-white h-[180px] rounded-3xl overflow-hidden relative mt-5">
|
||||
<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">
|
||||
اهمیت بالا{" "}
|
||||
</div>
|
||||
<div className="bg-secondaryLighter-100 w-fit relative px-2 text-[12px] my-2 mx-1 rounded-3xl text-secondary-200">
|
||||
شیفت صبح
|
||||
</div>
|
||||
</div>
|
||||
<div className=" relative m-2 text-white">
|
||||
<div className="text-right">
|
||||
<h4 className="mb-0 text-primary-300 font-semibold text-sm">
|
||||
کارگاه بدنسازی در خانه برای رستوران توگک
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div className="flex">
|
||||
<div className="flex rtl mt-2 w-full">
|
||||
<div className="absolute right-[0px] bg-red-900 w-[40px] h-[40px] rounded-full border-2 z-[1]"></div>
|
||||
<div className="absolute right-[13px] bg-green-900 w-[40px] h-[40px] rounded-full border-2 z-[2]"></div>
|
||||
<div className="absolute right-[26px] bg-sky-900 w-[40px] h-[40px] rounded-full border-2 z-[3]"></div>
|
||||
</div>
|
||||
|
||||
<div className="relative w-full">
|
||||
<p className="text-black text-sm mt-4">
|
||||
+
|
||||
<strong className="mx-1">
|
||||
<PersianNumber number={3} />
|
||||
</strong>
|
||||
نفر دیگر
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex mt-6 relative">
|
||||
<div>
|
||||
<svg
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 14 14"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M11.0833 2.33332H9.91667V1.74999C9.91667 1.59528 9.85522 1.44691 9.74582 1.33751C9.63642 1.22811 9.48805 1.16666 9.33334 1.16666C9.17863 1.16666 9.03026 1.22811 8.92086 1.33751C8.81146 1.44691 8.75001 1.59528 8.75001 1.74999V2.33332H5.25001V1.74999C5.25001 1.59528 5.18855 1.44691 5.07915 1.33751C4.96975 1.22811 4.82138 1.16666 4.66667 1.16666C4.51196 1.16666 4.36359 1.22811 4.25419 1.33751C4.1448 1.44691 4.08334 1.59528 4.08334 1.74999V2.33332H2.91667C2.45254 2.33332 2.00742 2.5177 1.67923 2.84589C1.35105 3.17408 1.16667 3.61919 1.16667 4.08332V11.0833C1.16667 11.5475 1.35105 11.9926 1.67923 12.3208C2.00742 12.6489 2.45254 12.8333 2.91667 12.8333H11.0833C11.5475 12.8333 11.9926 12.6489 12.3208 12.3208C12.649 11.9926 12.8333 11.5475 12.8333 11.0833V4.08332C12.8333 3.61919 12.649 3.17408 12.3208 2.84589C11.9926 2.5177 11.5475 2.33332 11.0833 2.33332ZM11.6667 11.0833C11.6667 11.238 11.6052 11.3864 11.4958 11.4958C11.3864 11.6052 11.238 11.6667 11.0833 11.6667H2.91667C2.76196 11.6667 2.61359 11.6052 2.50419 11.4958C2.3948 11.3864 2.33334 11.238 2.33334 11.0833V6.99999H11.6667V11.0833ZM11.6667 5.83332H2.33334V4.08332C2.33334 3.92861 2.3948 3.78024 2.50419 3.67084C2.61359 3.56145 2.76196 3.49999 2.91667 3.49999H4.08334V4.08332C4.08334 4.23803 4.1448 4.38641 4.25419 4.4958C4.36359 4.6052 4.51196 4.66666 4.66667 4.66666C4.82138 4.66666 4.96975 4.6052 5.07915 4.4958C5.18855 4.38641 5.25001 4.23803 5.25001 4.08332V3.49999H8.75001V4.08332C8.75001 4.23803 8.81146 4.38641 8.92086 4.4958C9.03026 4.6052 9.17863 4.66666 9.33334 4.66666C9.48805 4.66666 9.63642 4.6052 9.74582 4.4958C9.85522 4.38641 9.91667 4.23803 9.91667 4.08332V3.49999H11.0833C11.238 3.49999 11.3864 3.56145 11.4958 3.67084C11.6052 3.78024 11.6667 3.92861 11.6667 4.08332V5.83332Z"
|
||||
fill="#888888"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<p className="mb-0 text-textMain-100 text-sm opacity-70 mr-1">
|
||||
دوشنبه
|
||||
<strong className="mx-1">
|
||||
<PersianNumber number={19} />
|
||||
</strong>
|
||||
اردیبهشت
|
||||
<strong className="mx-1">
|
||||
<PersianNumber number={1401} />
|
||||
</strong>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</SwiperSlide>
|
||||
</Swiper>
|
||||
|
||||
<div className="flex justify-between mt-7">
|
||||
<div>
|
||||
<h4 className="text-base font-bold">تسک های امروز</h4>
|
||||
<p className="mb-0 text-sm">
|
||||
امروز
|
||||
<strong className="mx-1 text-primary-300">
|
||||
<PersianNumber number={24} />
|
||||
</strong>
|
||||
تسک فعال دارید
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="w-[40px] h-[40px] bg-white shadow-sm rounded-xl">
|
||||
<svg
|
||||
width="23"
|
||||
height="27"
|
||||
viewBox="0 0 16 20"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[6px]"
|
||||
>
|
||||
<path
|
||||
d="M5 3.00001C4.73478 3.00001 4.48043 3.10537 4.29289 3.2929C4.10536 3.48044 4 3.73479 4 4.00001C4 4.26523 4.10536 4.51958 4.29289 4.70712C4.48043 4.89465 4.73478 5.00001 5 5.00001C5.26522 5.00001 5.51957 4.89465 5.70711 4.70712C5.89464 4.51958 6 4.26523 6 4.00001C6 3.73479 5.89464 3.48044 5.70711 3.2929C5.51957 3.10537 5.26522 3.00001 5 3.00001ZM2.17 3.00001C2.3766 2.41448 2.75974 1.90744 3.2666 1.5488C3.77346 1.19015 4.37909 0.997559 5 0.997559C5.62091 0.997559 6.22654 1.19015 6.7334 1.5488C7.24026 1.90744 7.6234 2.41448 7.83 3.00001H15C15.2652 3.00001 15.5196 3.10537 15.7071 3.2929C15.8946 3.48044 16 3.73479 16 4.00001C16 4.26523 15.8946 4.51958 15.7071 4.70712C15.5196 4.89465 15.2652 5.00001 15 5.00001H7.83C7.6234 5.58554 7.24026 6.09258 6.7334 6.45122C6.22654 6.80986 5.62091 7.00246 5 7.00246C4.37909 7.00246 3.77346 6.80986 3.2666 6.45122C2.75974 6.09258 2.3766 5.58554 2.17 5.00001H1C0.734784 5.00001 0.48043 4.89465 0.292893 4.70712C0.105357 4.51958 0 4.26523 0 4.00001C0 3.73479 0.105357 3.48044 0.292893 3.2929C0.48043 3.10537 0.734784 3.00001 1 3.00001H2.17ZM11 9.00001C10.7348 9.00001 10.4804 9.10537 10.2929 9.2929C10.1054 9.48044 10 9.73479 10 10C10 10.2652 10.1054 10.5196 10.2929 10.7071C10.4804 10.8947 10.7348 11 11 11C11.2652 11 11.5196 10.8947 11.7071 10.7071C11.8946 10.5196 12 10.2652 12 10C12 9.73479 11.8946 9.48044 11.7071 9.2929C11.5196 9.10537 11.2652 9.00001 11 9.00001ZM8.17 9.00001C8.3766 8.41448 8.75974 7.90744 9.2666 7.5488C9.77346 7.19015 10.3791 6.99756 11 6.99756C11.6209 6.99756 12.2265 7.19015 12.7334 7.5488C13.2403 7.90744 13.6234 8.41448 13.83 9.00001H15C15.2652 9.00001 15.5196 9.10537 15.7071 9.2929C15.8946 9.48044 16 9.73479 16 10C16 10.2652 15.8946 10.5196 15.7071 10.7071C15.5196 10.8947 15.2652 11 15 11H13.83C13.6234 11.5855 13.2403 12.0926 12.7334 12.4512C12.2265 12.8099 11.6209 13.0025 11 13.0025C10.3791 13.0025 9.77346 12.8099 9.2666 12.4512C8.75974 12.0926 8.3766 11.5855 8.17 11H1C0.734784 11 0.48043 10.8947 0.292893 10.7071C0.105357 10.5196 0 10.2652 0 10C0 9.73479 0.105357 9.48044 0.292893 9.2929C0.48043 9.10537 0.734784 9.00001 1 9.00001H8.17ZM5 15C4.73478 15 4.48043 15.1054 4.29289 15.2929C4.10536 15.4804 4 15.7348 4 16C4 16.2652 4.10536 16.5196 4.29289 16.7071C4.48043 16.8947 4.73478 17 5 17C5.26522 17 5.51957 16.8947 5.70711 16.7071C5.89464 16.5196 6 16.2652 6 16C6 15.7348 5.89464 15.4804 5.70711 15.2929C5.51957 15.1054 5.26522 15 5 15ZM2.17 15C2.3766 14.4145 2.75974 13.9074 3.2666 13.5488C3.77346 13.1902 4.37909 12.9976 5 12.9976C5.62091 12.9976 6.22654 13.1902 6.7334 13.5488C7.24026 13.9074 7.6234 14.4145 7.83 15H15C15.2652 15 15.5196 15.1054 15.7071 15.2929C15.8946 15.4804 16 15.7348 16 16C16 16.2652 15.8946 16.5196 15.7071 16.7071C15.5196 16.8947 15.2652 17 15 17H7.83C7.6234 17.5855 7.24026 18.0926 6.7334 18.4512C6.22654 18.8099 5.62091 19.0025 5 19.0025C4.37909 19.0025 3.77346 18.8099 3.2666 18.4512C2.75974 18.0926 2.3766 17.5855 2.17 17H1C0.734784 17 0.48043 16.8947 0.292893 16.7071C0.105357 16.5196 0 16.2652 0 16C0 15.7348 0.105357 15.4804 0.292893 15.2929C0.48043 15.1054 0.734784 15 1 15H2.17Z"
|
||||
fill="#666666"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" mt-3">
|
||||
<TaskCard />
|
||||
</div>
|
||||
اینجا برای مدیریت میشه همون چارت ها و ...
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -38,6 +38,13 @@ export default function RootLayout({ children }) {
|
|||
useState(false);
|
||||
|
||||
const [BottomManageShiftOpen, setBottomManageShiftOpen] = useState(false);
|
||||
const [BottomSheetCreateRoutineOpen, setBottomSheetCreateRoutineOpen] =
|
||||
useState(false);
|
||||
const [BottomSheetCreateSectionOpen, setBottomSheetCreateSectionOpen] =
|
||||
useState(false);
|
||||
|
||||
const [BottomSheetCreatePositionOpen, setBottomSheetCreatePositionOpen] =
|
||||
useState(false);
|
||||
|
||||
// BigPlus
|
||||
const [BigPlusOpen, setBigPlusOpen] = useState(false);
|
||||
|
@ -70,7 +77,28 @@ export default function RootLayout({ children }) {
|
|||
const [goToEditUser, setGoToEditUser] = useState(false);
|
||||
const [idEditUser, setIdEditUser] = useState(null);
|
||||
|
||||
// createsection/ section
|
||||
const [sectionsData, setSectionsData] = useState([]);
|
||||
const [sectionData, setSectionData] = useState([]);
|
||||
const [goToEditSection, setGoToEditSection] = useState(false);
|
||||
const [idEditSection, setIdEditSection] = useState(null);
|
||||
|
||||
// createroutine/ routine
|
||||
const [routinesData, setRoutinesData] = useState([]);
|
||||
const [routineData, setRoutineData] = useState([]);
|
||||
const [goToEditRoutine, setGoToEditRoutine] = useState(false);
|
||||
const [idEditRoutine, setIdEditRoutine] = useState(null);
|
||||
|
||||
// createPosition/ Position
|
||||
const [positionsData, setPositionsData] = useState([]);
|
||||
const [positionData, setPositionData] = useState([]);
|
||||
const [goToEditPosition, setGoToEditPosition] = useState(false);
|
||||
const [idEditPosition, setIdEditPosition] = useState(null);
|
||||
const [sectionIdChoose, setSectionIdChoose] = useState([]);
|
||||
|
||||
// shift
|
||||
const [dayOfWeeksChoose, setDayOfWeeksChoose] = useState([]);
|
||||
|
||||
const [startAtTimeShift, setStartAtTimeShift] = useState(["00", "00"]);
|
||||
const [endAtTimeShift, setEndAtTimeShift] = useState(["00", "00"]);
|
||||
const [shiftsData, setShiftsData] = useState([null]);
|
||||
|
@ -205,6 +233,7 @@ export default function RootLayout({ children }) {
|
|||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const CreateRole = async (body) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
|
@ -333,6 +362,7 @@ export default function RootLayout({ children }) {
|
|||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const CreateUser = async (body) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
|
@ -461,6 +491,7 @@ export default function RootLayout({ children }) {
|
|||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const CreateShift = async (body) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
|
@ -589,6 +620,394 @@ export default function RootLayout({ children }) {
|
|||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const CreateSection = async (body) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.post(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/section`,
|
||||
JSON.stringify(body),
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
toast.success(`سکشن ساخته شد`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setBottomSheetCreateSectionOpen(false);
|
||||
setLoading(false);
|
||||
GetSections();
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const UpdateSection = async (body) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.put(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/section`,
|
||||
body,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
toast.success(`سکشن ویرایش شد`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
|
||||
setBottomSheetCreateSectionOpen(false);
|
||||
setLoading(false);
|
||||
GetSections();
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const GetSections = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.get(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/section?page=0`,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
console.log("GetSection", data);
|
||||
|
||||
setSectionsData(data);
|
||||
setLoading(false);
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const GetSection = async (id) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.get(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/section/${id}`,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
console.log("GetShift", data);
|
||||
|
||||
setSectionData(data);
|
||||
setLoading(false);
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const DeleteSection = async (id) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.delete(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/section/${id}`,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
setBottomSheetCreateSectionOpen(false);
|
||||
|
||||
setLoading(false);
|
||||
GetSections();
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const CreateRoutine = async (body) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.post(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/routine`,
|
||||
JSON.stringify(body),
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
toast.success(`روتین ساخته شد`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setBottomSheetCreateRoutineOpen(false);
|
||||
setLoading(false);
|
||||
GetRoutines();
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const UpdateRoutine = async (body) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.put(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/routine`,
|
||||
body,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
toast.success(`روتین ویرایش شد`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
|
||||
setBottomSheetCreateRoutineOpen(false);
|
||||
setLoading(false);
|
||||
GetRoutines();
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const GetRoutines = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.get(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/routine?page=0`,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
console.log("GetRoutines", GetRoutines);
|
||||
|
||||
setRoutinesData(data);
|
||||
setLoading(false);
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const GetRoutine = async (id) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.get(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/routine/${id}`,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
console.log("GetRoutine", GetRoutine);
|
||||
|
||||
setRoutineData(data);
|
||||
setLoading(false);
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const DeleteRoutine = async (id) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.delete(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/routine/${id}`,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
setBottomSheetCreateRoutineOpen(false);
|
||||
|
||||
setLoading(false);
|
||||
GetRoutines();
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const CreatePosition = async (body) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.post(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/position`,
|
||||
JSON.stringify(body),
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
toast.success(`پوزیشن ساخته شد`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setBottomSheetCreatePositionOpen(false);
|
||||
setLoading(false);
|
||||
GetPositions();
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const UpdatePosition = async (body) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.put(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/position`,
|
||||
body,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
toast.success(`پوزیشن ویرایش شد`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
|
||||
setBottomSheetCreatePositionOpen(false);
|
||||
setLoading(false);
|
||||
GetPositions();
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const GetPositions = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.get(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/position?page=0`,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
console.log("GetPositions", data);
|
||||
|
||||
setPositionsData(data);
|
||||
setLoading(false);
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const GetPosition = async (id) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.get(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/position/${id}`,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
console.log("GetPosition", data);
|
||||
|
||||
setPositionData(data);
|
||||
setLoading(false);
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const DeletePosition = async (id) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const data = await Chapar.delete(
|
||||
`${process.env.NEXT_PUBLIC_API_URL}/position/${id}`,
|
||||
|
||||
{
|
||||
headers: {
|
||||
Authorization: getToken(),
|
||||
},
|
||||
}
|
||||
);
|
||||
setBottomSheetCreatePositionOpen(false);
|
||||
|
||||
setLoading(false);
|
||||
GetPositions();
|
||||
} catch ({ error, status }) {
|
||||
toast.error(`${error.response.data.message}`, {
|
||||
position: "bottom-right",
|
||||
closeOnClick: true,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const CheckUser = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
|
@ -655,6 +1074,23 @@ export default function RootLayout({ children }) {
|
|||
profile,
|
||||
searchUserChoose,
|
||||
BottomManageShiftOpen,
|
||||
idEditSection,
|
||||
goToEditSection,
|
||||
sectionData,
|
||||
sectionsData,
|
||||
BottomSheetCreateSectionOpen,
|
||||
BottomSheetCreateRoutineOpen,
|
||||
idEditRoutine,
|
||||
goToEditRoutine,
|
||||
routineData,
|
||||
routinesData,
|
||||
dayOfWeeksChoose,
|
||||
idEditPosition,
|
||||
goToEditPosition,
|
||||
positionData,
|
||||
positionsData,
|
||||
BottomSheetCreatePositionOpen,
|
||||
sectionIdChoose,
|
||||
},
|
||||
setBottomSheetCreateRoleOpen,
|
||||
setBottomSheetCreateEmployeesOpen,
|
||||
|
@ -694,21 +1130,50 @@ export default function RootLayout({ children }) {
|
|||
UpdateUser,
|
||||
setOpenTimePicker,
|
||||
setEndAtTimeShift,
|
||||
setStartAtTimeShift,
|
||||
setTimePickerOrder,
|
||||
setShiftsData,
|
||||
CreateShift,
|
||||
GetShifts,
|
||||
setIdEditShift,
|
||||
setGoToEditShift,
|
||||
setShiftData,
|
||||
setStartAtTimeShift,
|
||||
setBottomManageShiftOpen,
|
||||
GetShifts,
|
||||
DeleteShift,
|
||||
GetShift,
|
||||
UpdateShift,
|
||||
DeleteShift,
|
||||
setProfile,
|
||||
CheckUser,
|
||||
CreateShift,
|
||||
setIdEditSection,
|
||||
setGoToEditSection,
|
||||
setSectionData,
|
||||
setSectionsData,
|
||||
setBottomSheetCreateSectionOpen,
|
||||
DeleteSection,
|
||||
GetSection,
|
||||
GetSections,
|
||||
UpdateSection,
|
||||
CreateSection,
|
||||
setBottomSheetCreateRoutineOpen,
|
||||
setIdEditRoutine,
|
||||
setGoToEditRoutine,
|
||||
setRoutineData,
|
||||
setRoutinesData,
|
||||
DeleteRoutine,
|
||||
GetRoutine,
|
||||
GetRoutines,
|
||||
UpdateRoutine,
|
||||
CreateRoutine,
|
||||
setDayOfWeeksChoose,
|
||||
setShiftData,
|
||||
setTimePickerOrder,
|
||||
setSearchUserChoose,
|
||||
setBottomManageShiftOpen,
|
||||
setIdEditPosition,
|
||||
setGoToEditPosition,
|
||||
setPositionData,
|
||||
setPositionsData,
|
||||
setBottomSheetCreatePositionOpen,
|
||||
DeletePosition,
|
||||
GetPosition,
|
||||
GetPositions,
|
||||
UpdatePosition,
|
||||
CreatePosition,
|
||||
setSectionIdChoose,
|
||||
}}
|
||||
>
|
||||
<html lang="en">
|
||||
|
|
|
@ -0,0 +1,244 @@
|
|||
"use client";
|
||||
|
||||
import AppHeader from "@comp/AppHeader/page";
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import BottomSheetCreateRoutine from "plugins/BottomSheet/BottomSheetCreateRoutine";
|
||||
import PersianNumber from "plugins/PersianNumber";
|
||||
import React, { useContext } from "react";
|
||||
import { Swiper, SwiperSlide } from "swiper/react";
|
||||
import TaskCard from "@comp/TaskCard/page";
|
||||
import Link from "next/link";
|
||||
|
||||
const page = () => {
|
||||
const CTX = useContext(AppContext);
|
||||
|
||||
const routinesData = CTX.state.routinesData;
|
||||
|
||||
// const goToEditRole = (id) => {
|
||||
// CTX.setGoToEditRole(true);
|
||||
// CTX.setBottomSheetCreateRoleOpen(true);
|
||||
// CTX.setIdEditRole(id);
|
||||
// };
|
||||
|
||||
return (
|
||||
<div className="pb-20">
|
||||
<AppHeader
|
||||
title=" تسک های مجموعه"
|
||||
sub=" شما 12 تسک در مجموعه دارید"
|
||||
icon1={true}
|
||||
iconName1="PLUS"
|
||||
iconHref1="#"
|
||||
// iconEvent1={() => CTX.setBottomSheetCreateRoutineOpen(true)}
|
||||
icon2={true}
|
||||
iconName2="ARROW"
|
||||
iconHref2="/home"
|
||||
iconEvent2={() => {
|
||||
return undefined;
|
||||
}}
|
||||
/>
|
||||
<div className="bg-body-100 relative top-[-30px] rounded-t-3xl overflow-hidden p-5 rtl">
|
||||
<div className="flex justify-between">
|
||||
<div>
|
||||
<h4 className="text-base font-bold">تسک های هفتگی مجموعه</h4>
|
||||
<p className="mb-0 text-sm">
|
||||
امروز
|
||||
<strong className="mx-1 text-primary-300">
|
||||
<PersianNumber number={24} />
|
||||
</strong>
|
||||
تسک فعال دارید
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="w-[40px] h-[40px] bg-white shadow-sm rounded-xl">
|
||||
<svg
|
||||
width="23"
|
||||
height="27"
|
||||
viewBox="0 0 16 20"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[6px]"
|
||||
>
|
||||
<path
|
||||
d="M5 3.00001C4.73478 3.00001 4.48043 3.10537 4.29289 3.2929C4.10536 3.48044 4 3.73479 4 4.00001C4 4.26523 4.10536 4.51958 4.29289 4.70712C4.48043 4.89465 4.73478 5.00001 5 5.00001C5.26522 5.00001 5.51957 4.89465 5.70711 4.70712C5.89464 4.51958 6 4.26523 6 4.00001C6 3.73479 5.89464 3.48044 5.70711 3.2929C5.51957 3.10537 5.26522 3.00001 5 3.00001ZM2.17 3.00001C2.3766 2.41448 2.75974 1.90744 3.2666 1.5488C3.77346 1.19015 4.37909 0.997559 5 0.997559C5.62091 0.997559 6.22654 1.19015 6.7334 1.5488C7.24026 1.90744 7.6234 2.41448 7.83 3.00001H15C15.2652 3.00001 15.5196 3.10537 15.7071 3.2929C15.8946 3.48044 16 3.73479 16 4.00001C16 4.26523 15.8946 4.51958 15.7071 4.70712C15.5196 4.89465 15.2652 5.00001 15 5.00001H7.83C7.6234 5.58554 7.24026 6.09258 6.7334 6.45122C6.22654 6.80986 5.62091 7.00246 5 7.00246C4.37909 7.00246 3.77346 6.80986 3.2666 6.45122C2.75974 6.09258 2.3766 5.58554 2.17 5.00001H1C0.734784 5.00001 0.48043 4.89465 0.292893 4.70712C0.105357 4.51958 0 4.26523 0 4.00001C0 3.73479 0.105357 3.48044 0.292893 3.2929C0.48043 3.10537 0.734784 3.00001 1 3.00001H2.17ZM11 9.00001C10.7348 9.00001 10.4804 9.10537 10.2929 9.2929C10.1054 9.48044 10 9.73479 10 10C10 10.2652 10.1054 10.5196 10.2929 10.7071C10.4804 10.8947 10.7348 11 11 11C11.2652 11 11.5196 10.8947 11.7071 10.7071C11.8946 10.5196 12 10.2652 12 10C12 9.73479 11.8946 9.48044 11.7071 9.2929C11.5196 9.10537 11.2652 9.00001 11 9.00001ZM8.17 9.00001C8.3766 8.41448 8.75974 7.90744 9.2666 7.5488C9.77346 7.19015 10.3791 6.99756 11 6.99756C11.6209 6.99756 12.2265 7.19015 12.7334 7.5488C13.2403 7.90744 13.6234 8.41448 13.83 9.00001H15C15.2652 9.00001 15.5196 9.10537 15.7071 9.2929C15.8946 9.48044 16 9.73479 16 10C16 10.2652 15.8946 10.5196 15.7071 10.7071C15.5196 10.8947 15.2652 11 15 11H13.83C13.6234 11.5855 13.2403 12.0926 12.7334 12.4512C12.2265 12.8099 11.6209 13.0025 11 13.0025C10.3791 13.0025 9.77346 12.8099 9.2666 12.4512C8.75974 12.0926 8.3766 11.5855 8.17 11H1C0.734784 11 0.48043 10.8947 0.292893 10.7071C0.105357 10.5196 0 10.2652 0 10C0 9.73479 0.105357 9.48044 0.292893 9.2929C0.48043 9.10537 0.734784 9.00001 1 9.00001H8.17ZM5 15C4.73478 15 4.48043 15.1054 4.29289 15.2929C4.10536 15.4804 4 15.7348 4 16C4 16.2652 4.10536 16.5196 4.29289 16.7071C4.48043 16.8947 4.73478 17 5 17C5.26522 17 5.51957 16.8947 5.70711 16.7071C5.89464 16.5196 6 16.2652 6 16C6 15.7348 5.89464 15.4804 5.70711 15.2929C5.51957 15.1054 5.26522 15 5 15ZM2.17 15C2.3766 14.4145 2.75974 13.9074 3.2666 13.5488C3.77346 13.1902 4.37909 12.9976 5 12.9976C5.62091 12.9976 6.22654 13.1902 6.7334 13.5488C7.24026 13.9074 7.6234 14.4145 7.83 15H15C15.2652 15 15.5196 15.1054 15.7071 15.2929C15.8946 15.4804 16 15.7348 16 16C16 16.2652 15.8946 16.5196 15.7071 16.7071C15.5196 16.8947 15.2652 17 15 17H7.83C7.6234 17.5855 7.24026 18.0926 6.7334 18.4512C6.22654 18.8099 5.62091 19.0025 5 19.0025C4.37909 19.0025 3.77346 18.8099 3.2666 18.4512C2.75974 18.0926 2.3766 17.5855 2.17 17H1C0.734784 17 0.48043 16.8947 0.292893 16.7071C0.105357 16.5196 0 16.2652 0 16C0 15.7348 0.105357 15.4804 0.292893 15.2929C0.48043 15.1054 0.734784 15 1 15H2.17Z"
|
||||
fill="#666666"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Swiper
|
||||
spaceBetween={20}
|
||||
slidesPerView={1.6}
|
||||
onSlideChange={() => console.log("slide change")}
|
||||
onSwiper={(swiper) => console.log(swiper)}
|
||||
>
|
||||
<SwiperSlide>
|
||||
<div className=" bg-white h-[180px] rounded-3xl overflow-hidden relative mt-5">
|
||||
<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">
|
||||
اهمیت بالا{" "}
|
||||
</div>
|
||||
<div className="bg-secondaryLighter-100 w-fit relative px-2 text-[12px] my-2 mx-1 rounded-3xl text-secondary-200">
|
||||
شیفت صبح
|
||||
</div>
|
||||
</div>
|
||||
<div className=" relative m-2 text-white">
|
||||
<div className="text-right">
|
||||
<h4 className="mb-0 text-primary-300 font-semibold text-sm">
|
||||
کارگاه بدنسازی در خانه برای رستوران توگک
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div className="flex">
|
||||
<div className="flex rtl mt-2 w-full">
|
||||
<div className="absolute right-[0px] bg-red-900 w-[40px] h-[40px] rounded-full border-2 z-[1]"></div>
|
||||
<div className="absolute right-[13px] bg-green-900 w-[40px] h-[40px] rounded-full border-2 z-[2]"></div>
|
||||
<div className="absolute right-[26px] bg-sky-900 w-[40px] h-[40px] rounded-full border-2 z-[3]"></div>
|
||||
</div>
|
||||
|
||||
<div className="relative w-full">
|
||||
<p className="text-black text-sm mt-4">
|
||||
+
|
||||
<strong className="mx-1">
|
||||
<PersianNumber number={3} />
|
||||
</strong>
|
||||
نفر دیگر
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex mt-6 relative">
|
||||
<div>
|
||||
<svg
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 14 14"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M11.0833 2.33332H9.91667V1.74999C9.91667 1.59528 9.85522 1.44691 9.74582 1.33751C9.63642 1.22811 9.48805 1.16666 9.33334 1.16666C9.17863 1.16666 9.03026 1.22811 8.92086 1.33751C8.81146 1.44691 8.75001 1.59528 8.75001 1.74999V2.33332H5.25001V1.74999C5.25001 1.59528 5.18855 1.44691 5.07915 1.33751C4.96975 1.22811 4.82138 1.16666 4.66667 1.16666C4.51196 1.16666 4.36359 1.22811 4.25419 1.33751C4.1448 1.44691 4.08334 1.59528 4.08334 1.74999V2.33332H2.91667C2.45254 2.33332 2.00742 2.5177 1.67923 2.84589C1.35105 3.17408 1.16667 3.61919 1.16667 4.08332V11.0833C1.16667 11.5475 1.35105 11.9926 1.67923 12.3208C2.00742 12.6489 2.45254 12.8333 2.91667 12.8333H11.0833C11.5475 12.8333 11.9926 12.6489 12.3208 12.3208C12.649 11.9926 12.8333 11.5475 12.8333 11.0833V4.08332C12.8333 3.61919 12.649 3.17408 12.3208 2.84589C11.9926 2.5177 11.5475 2.33332 11.0833 2.33332ZM11.6667 11.0833C11.6667 11.238 11.6052 11.3864 11.4958 11.4958C11.3864 11.6052 11.238 11.6667 11.0833 11.6667H2.91667C2.76196 11.6667 2.61359 11.6052 2.50419 11.4958C2.3948 11.3864 2.33334 11.238 2.33334 11.0833V6.99999H11.6667V11.0833ZM11.6667 5.83332H2.33334V4.08332C2.33334 3.92861 2.3948 3.78024 2.50419 3.67084C2.61359 3.56145 2.76196 3.49999 2.91667 3.49999H4.08334V4.08332C4.08334 4.23803 4.1448 4.38641 4.25419 4.4958C4.36359 4.6052 4.51196 4.66666 4.66667 4.66666C4.82138 4.66666 4.96975 4.6052 5.07915 4.4958C5.18855 4.38641 5.25001 4.23803 5.25001 4.08332V3.49999H8.75001V4.08332C8.75001 4.23803 8.81146 4.38641 8.92086 4.4958C9.03026 4.6052 9.17863 4.66666 9.33334 4.66666C9.48805 4.66666 9.63642 4.6052 9.74582 4.4958C9.85522 4.38641 9.91667 4.23803 9.91667 4.08332V3.49999H11.0833C11.238 3.49999 11.3864 3.56145 11.4958 3.67084C11.6052 3.78024 11.6667 3.92861 11.6667 4.08332V5.83332Z"
|
||||
fill="#888888"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<p className="mb-0 text-textMain-100 text-sm opacity-70 mr-1">
|
||||
دوشنبه
|
||||
<strong className="mx-1">
|
||||
<PersianNumber number={19} />
|
||||
</strong>
|
||||
اردیبهشت
|
||||
<strong className="mx-1">
|
||||
<PersianNumber number={1401} />
|
||||
</strong>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</SwiperSlide>
|
||||
|
||||
<SwiperSlide>
|
||||
<div className=" bg-white h-[180px] rounded-3xl overflow-hidden relative mt-5">
|
||||
<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">
|
||||
اهمیت بالا{" "}
|
||||
</div>
|
||||
<div className="bg-secondaryLighter-100 w-fit relative px-2 text-[12px] my-2 mx-1 rounded-3xl text-secondary-200">
|
||||
شیفت صبح
|
||||
</div>
|
||||
</div>
|
||||
<div className=" relative m-2 text-white">
|
||||
<div className="text-right">
|
||||
<h4 className="mb-0 text-primary-300 font-semibold text-sm">
|
||||
کارگاه بدنسازی در خانه برای رستوران توگک
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div className="flex">
|
||||
<div className="flex rtl mt-2 w-full">
|
||||
<div className="absolute right-[0px] bg-red-900 w-[40px] h-[40px] rounded-full border-2 z-[1]"></div>
|
||||
<div className="absolute right-[13px] bg-green-900 w-[40px] h-[40px] rounded-full border-2 z-[2]"></div>
|
||||
<div className="absolute right-[26px] bg-sky-900 w-[40px] h-[40px] rounded-full border-2 z-[3]"></div>
|
||||
</div>
|
||||
|
||||
<div className="relative w-full">
|
||||
<p className="text-black text-sm mt-4">
|
||||
+
|
||||
<strong className="mx-1">
|
||||
<PersianNumber number={3} />
|
||||
</strong>
|
||||
نفر دیگر
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex mt-6 relative">
|
||||
<div>
|
||||
<svg
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 14 14"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M11.0833 2.33332H9.91667V1.74999C9.91667 1.59528 9.85522 1.44691 9.74582 1.33751C9.63642 1.22811 9.48805 1.16666 9.33334 1.16666C9.17863 1.16666 9.03026 1.22811 8.92086 1.33751C8.81146 1.44691 8.75001 1.59528 8.75001 1.74999V2.33332H5.25001V1.74999C5.25001 1.59528 5.18855 1.44691 5.07915 1.33751C4.96975 1.22811 4.82138 1.16666 4.66667 1.16666C4.51196 1.16666 4.36359 1.22811 4.25419 1.33751C4.1448 1.44691 4.08334 1.59528 4.08334 1.74999V2.33332H2.91667C2.45254 2.33332 2.00742 2.5177 1.67923 2.84589C1.35105 3.17408 1.16667 3.61919 1.16667 4.08332V11.0833C1.16667 11.5475 1.35105 11.9926 1.67923 12.3208C2.00742 12.6489 2.45254 12.8333 2.91667 12.8333H11.0833C11.5475 12.8333 11.9926 12.6489 12.3208 12.3208C12.649 11.9926 12.8333 11.5475 12.8333 11.0833V4.08332C12.8333 3.61919 12.649 3.17408 12.3208 2.84589C11.9926 2.5177 11.5475 2.33332 11.0833 2.33332ZM11.6667 11.0833C11.6667 11.238 11.6052 11.3864 11.4958 11.4958C11.3864 11.6052 11.238 11.6667 11.0833 11.6667H2.91667C2.76196 11.6667 2.61359 11.6052 2.50419 11.4958C2.3948 11.3864 2.33334 11.238 2.33334 11.0833V6.99999H11.6667V11.0833ZM11.6667 5.83332H2.33334V4.08332C2.33334 3.92861 2.3948 3.78024 2.50419 3.67084C2.61359 3.56145 2.76196 3.49999 2.91667 3.49999H4.08334V4.08332C4.08334 4.23803 4.1448 4.38641 4.25419 4.4958C4.36359 4.6052 4.51196 4.66666 4.66667 4.66666C4.82138 4.66666 4.96975 4.6052 5.07915 4.4958C5.18855 4.38641 5.25001 4.23803 5.25001 4.08332V3.49999H8.75001V4.08332C8.75001 4.23803 8.81146 4.38641 8.92086 4.4958C9.03026 4.6052 9.17863 4.66666 9.33334 4.66666C9.48805 4.66666 9.63642 4.6052 9.74582 4.4958C9.85522 4.38641 9.91667 4.23803 9.91667 4.08332V3.49999H11.0833C11.238 3.49999 11.3864 3.56145 11.4958 3.67084C11.6052 3.78024 11.6667 3.92861 11.6667 4.08332V5.83332Z"
|
||||
fill="#888888"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<p className="mb-0 text-textMain-100 text-sm opacity-70 mr-1">
|
||||
دوشنبه
|
||||
<strong className="mx-1">
|
||||
<PersianNumber number={19} />
|
||||
</strong>
|
||||
اردیبهشت
|
||||
<strong className="mx-1">
|
||||
<PersianNumber number={1401} />
|
||||
</strong>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</SwiperSlide>
|
||||
</Swiper>
|
||||
|
||||
<div className="flex justify-between mt-7">
|
||||
<div>
|
||||
<h4 className="text-base font-bold">تسک های امروز</h4>
|
||||
<p className="mb-0 text-sm">
|
||||
امروز
|
||||
<strong className="mx-1 text-primary-300">
|
||||
<PersianNumber number={24} />
|
||||
</strong>
|
||||
تسک فعال دارید
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="w-[40px] h-[40px] bg-white shadow-sm rounded-xl">
|
||||
<svg
|
||||
width="23"
|
||||
height="27"
|
||||
viewBox="0 0 16 20"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
className="mx-auto mt-[6px]"
|
||||
>
|
||||
<path
|
||||
d="M5 3.00001C4.73478 3.00001 4.48043 3.10537 4.29289 3.2929C4.10536 3.48044 4 3.73479 4 4.00001C4 4.26523 4.10536 4.51958 4.29289 4.70712C4.48043 4.89465 4.73478 5.00001 5 5.00001C5.26522 5.00001 5.51957 4.89465 5.70711 4.70712C5.89464 4.51958 6 4.26523 6 4.00001C6 3.73479 5.89464 3.48044 5.70711 3.2929C5.51957 3.10537 5.26522 3.00001 5 3.00001ZM2.17 3.00001C2.3766 2.41448 2.75974 1.90744 3.2666 1.5488C3.77346 1.19015 4.37909 0.997559 5 0.997559C5.62091 0.997559 6.22654 1.19015 6.7334 1.5488C7.24026 1.90744 7.6234 2.41448 7.83 3.00001H15C15.2652 3.00001 15.5196 3.10537 15.7071 3.2929C15.8946 3.48044 16 3.73479 16 4.00001C16 4.26523 15.8946 4.51958 15.7071 4.70712C15.5196 4.89465 15.2652 5.00001 15 5.00001H7.83C7.6234 5.58554 7.24026 6.09258 6.7334 6.45122C6.22654 6.80986 5.62091 7.00246 5 7.00246C4.37909 7.00246 3.77346 6.80986 3.2666 6.45122C2.75974 6.09258 2.3766 5.58554 2.17 5.00001H1C0.734784 5.00001 0.48043 4.89465 0.292893 4.70712C0.105357 4.51958 0 4.26523 0 4.00001C0 3.73479 0.105357 3.48044 0.292893 3.2929C0.48043 3.10537 0.734784 3.00001 1 3.00001H2.17ZM11 9.00001C10.7348 9.00001 10.4804 9.10537 10.2929 9.2929C10.1054 9.48044 10 9.73479 10 10C10 10.2652 10.1054 10.5196 10.2929 10.7071C10.4804 10.8947 10.7348 11 11 11C11.2652 11 11.5196 10.8947 11.7071 10.7071C11.8946 10.5196 12 10.2652 12 10C12 9.73479 11.8946 9.48044 11.7071 9.2929C11.5196 9.10537 11.2652 9.00001 11 9.00001ZM8.17 9.00001C8.3766 8.41448 8.75974 7.90744 9.2666 7.5488C9.77346 7.19015 10.3791 6.99756 11 6.99756C11.6209 6.99756 12.2265 7.19015 12.7334 7.5488C13.2403 7.90744 13.6234 8.41448 13.83 9.00001H15C15.2652 9.00001 15.5196 9.10537 15.7071 9.2929C15.8946 9.48044 16 9.73479 16 10C16 10.2652 15.8946 10.5196 15.7071 10.7071C15.5196 10.8947 15.2652 11 15 11H13.83C13.6234 11.5855 13.2403 12.0926 12.7334 12.4512C12.2265 12.8099 11.6209 13.0025 11 13.0025C10.3791 13.0025 9.77346 12.8099 9.2666 12.4512C8.75974 12.0926 8.3766 11.5855 8.17 11H1C0.734784 11 0.48043 10.8947 0.292893 10.7071C0.105357 10.5196 0 10.2652 0 10C0 9.73479 0.105357 9.48044 0.292893 9.2929C0.48043 9.10537 0.734784 9.00001 1 9.00001H8.17ZM5 15C4.73478 15 4.48043 15.1054 4.29289 15.2929C4.10536 15.4804 4 15.7348 4 16C4 16.2652 4.10536 16.5196 4.29289 16.7071C4.48043 16.8947 4.73478 17 5 17C5.26522 17 5.51957 16.8947 5.70711 16.7071C5.89464 16.5196 6 16.2652 6 16C6 15.7348 5.89464 15.4804 5.70711 15.2929C5.51957 15.1054 5.26522 15 5 15ZM2.17 15C2.3766 14.4145 2.75974 13.9074 3.2666 13.5488C3.77346 13.1902 4.37909 12.9976 5 12.9976C5.62091 12.9976 6.22654 13.1902 6.7334 13.5488C7.24026 13.9074 7.6234 14.4145 7.83 15H15C15.2652 15 15.5196 15.1054 15.7071 15.2929C15.8946 15.4804 16 15.7348 16 16C16 16.2652 15.8946 16.5196 15.7071 16.7071C15.5196 16.8947 15.2652 17 15 17H7.83C7.6234 17.5855 7.24026 18.0926 6.7334 18.4512C6.22654 18.8099 5.62091 19.0025 5 19.0025C4.37909 19.0025 3.77346 18.8099 3.2666 18.4512C2.75974 18.0926 2.3766 17.5855 2.17 17H1C0.734784 17 0.48043 16.8947 0.292893 16.7071C0.105357 16.5196 0 16.2652 0 16C0 15.7348 0.105357 15.4804 0.292893 15.2929C0.48043 15.1054 0.734784 15 1 15H2.17Z"
|
||||
fill="#666666"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" mt-3">
|
||||
<TaskCard />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<BottomSheetCreateRoutine />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default page;
|
|
@ -232,14 +232,10 @@ const Calendar = () => {
|
|||
}
|
||||
}}
|
||||
style="text-right"
|
||||
// validatorData={validator.current.message(
|
||||
// "phoneNumber",
|
||||
// phoneNumber,
|
||||
// "required"
|
||||
// )}
|
||||
select={true}
|
||||
selectData={manageShiftEmployeesData}
|
||||
theme={1}
|
||||
defaultValue={"انتخاب کنید"}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -3,13 +3,17 @@
|
|||
import AppHeader from "@comp/AppHeader/page";
|
||||
import ShiftCard from "@comp/ShiftComponent/ShiftCard/page";
|
||||
import AppContext from "@ctx/AppContext";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
import BottomSheetCreateShifts from "plugins/BottomSheet/BottomSheetCreateShifts";
|
||||
import PersianNumber from "plugins/PersianNumber";
|
||||
import React, { useContext, useEffect } from "react";
|
||||
|
||||
const Shifts = (props) => {
|
||||
const CTX = useContext(AppContext);
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
CTX.GetShifts();
|
||||
|
@ -24,7 +28,9 @@ const Shifts = (props) => {
|
|||
icon1={true}
|
||||
iconName1="PLUS"
|
||||
iconHref1="#"
|
||||
iconEvent1={() => CTX.setBottomSheetCreateShiftsOpen(true)}
|
||||
iconEvent1={() => {
|
||||
CTX.setBottomSheetCreateShiftsOpen(true);
|
||||
}}
|
||||
icon2={true}
|
||||
iconName2="ARROW"
|
||||
iconHref2="/home"
|
||||
|
@ -33,32 +39,37 @@ const Shifts = (props) => {
|
|||
}}
|
||||
/>
|
||||
|
||||
<div className="bg-body-100 relative top-[-30px] rounded-t-3xl overflow-hidden p-4 rtl mt-2">
|
||||
<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>
|
||||
<div className="bg-primary-200 p-3 rounded-xl">
|
||||
<h2 className="mb-0 text-white font-bold text-base mt-3">
|
||||
شیفتــــ های مجموعه{" "}
|
||||
<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>
|
||||
<p className="mb-0 text-white text-sm">
|
||||
شما میتوانید به صورت هفتگی شیفت بندی های رستوران خود را تعریف
|
||||
نمایید و با توجه به نیاز های مجموعه خود شیفت بندی کنید .{" "}
|
||||
</p>
|
||||
<div className="flex my-3">
|
||||
<Link href={"/shifts/manage-shift"} className="w-full">
|
||||
<button className="btn btn-secondary text-[12px] w-full">
|
||||
{" "}
|
||||
شیفت بندی هفته
|
||||
</button>
|
||||
</Link>
|
||||
<Link href={"/shifts/manage-shift"} className="w-full">
|
||||
<button className="btn bg-transparent border-[2px] border-white border-dashed text-white text-[12px] mx-2 w-full">
|
||||
{" "}
|
||||
شیفت بندی هغته بعد
|
||||
</button>
|
||||
<div className="flex justify-end">
|
||||
<div className="w-5 h-5 rounded-full bg-secondary-100 opacity-30"></div>
|
||||
</div>{" "}
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="bg-body-100 relative top-[-30px] rounded-t-3xl overflow-hidden p-4 rtl mt-2">
|
||||
<ShiftCard />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -122,6 +122,11 @@ body {
|
|||
}
|
||||
[data-rsbs-header] {
|
||||
background-color: #356859;
|
||||
padding-top: 30px !important;
|
||||
}
|
||||
|
||||
[data-rsbs-header]::before {
|
||||
top: 20px !important;
|
||||
}
|
||||
|
||||
.DatePicker {
|
||||
|
|
Loading…
Reference in New Issue