manage shift
parent
d135238885
commit
e059cb7adb
|
@ -10,4 +10,5 @@ COPY next.config.js ./next.config.js
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
ENV PORT 3000
|
ENV PORT 3000
|
||||||
CMD ["node_modules/.bin/next", "start"]
|
CMD ["/app/node_modules/.bin/next", "start"]
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ const ShiftCard = () => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-wrap px-3 pb-4 pt-2">
|
{/* <div className="flex flex-wrap px-3 pb-4 pt-2">
|
||||||
{e?.days.map((e) => (
|
{e?.days.map((e) => (
|
||||||
<div className="bg-secondaryLighter-100 rounded-full py-1 px-4 mx-1 mt-2">
|
<div className="bg-secondaryLighter-100 rounded-full py-1 px-4 mx-1 mt-2">
|
||||||
<p className="mb-0 text-[11px] white text-secondary-200 font-bold ">
|
<p className="mb-0 text-[11px] white text-secondary-200 font-bold ">
|
||||||
|
@ -118,7 +118,7 @@ const ShiftCard = () => {
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
|
|
|
@ -0,0 +1,401 @@
|
||||||
|
export const PersianM = (month) => {
|
||||||
|
console.log("montssh", month);
|
||||||
|
switch (month) {
|
||||||
|
case (month = "1"):
|
||||||
|
return "month";
|
||||||
|
case (month = "2"):
|
||||||
|
return "اردیبهشت";
|
||||||
|
case (month = "3"):
|
||||||
|
return "خرداد";
|
||||||
|
case (month = "4"):
|
||||||
|
return " تیر";
|
||||||
|
case (month = "5"):
|
||||||
|
return "آمرداد";
|
||||||
|
case (month = "6"):
|
||||||
|
return "شهریور";
|
||||||
|
case (month = "7"):
|
||||||
|
return "مهر";
|
||||||
|
case (month = "8"):
|
||||||
|
return "آبان";
|
||||||
|
case (month = "9"):
|
||||||
|
return "آذر";
|
||||||
|
case (month = "10"):
|
||||||
|
return "دی";
|
||||||
|
case (month = "11"):
|
||||||
|
return "بهمن";
|
||||||
|
case (month = "12"):
|
||||||
|
return "اسفند";
|
||||||
|
default:
|
||||||
|
return "ماه";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const PersianDay = (dayOfWeek) => {
|
||||||
|
switch (dayOfWeek) {
|
||||||
|
case (dayOfWeek = "Sunday"):
|
||||||
|
return "یکشنبه";
|
||||||
|
case (dayOfWeek = "Monday"):
|
||||||
|
return "دوشنبه";
|
||||||
|
case (dayOfWeek = "Tuesday"):
|
||||||
|
return "سه شنبه";
|
||||||
|
case (dayOfWeek = "Wednesday"):
|
||||||
|
return "چهار شنبه";
|
||||||
|
case (dayOfWeek = "Thursday"):
|
||||||
|
return "پنج شنبه";
|
||||||
|
case (dayOfWeek = "Friday"):
|
||||||
|
return "جمعه";
|
||||||
|
case (dayOfWeek = "Saturday"):
|
||||||
|
return "شنبه";
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//Solution to find holidays in persian calendar
|
||||||
|
//https://www.time.ir/fa/eventyear-%D8%AA%D9%82%D9%88%DB%8C%D9%85-%D8%B3%D8%A7%D9%84%DB%8C%D8%A7%D9%86%D9%87
|
||||||
|
// Array.from(document.querySelectorAll("li[class='eventHoliday ']"),(node=> ({date:'1402/'+( Array.from(document.querySelectorAll("div[class='col-md-12']>div>div>span>span>span"),node=>node.innerText).findIndex(x=>x === node.innerText.split(" ")[1]) +1).toString() +"/"+node.innerText.split(" ")[0].replace(/[۰-۹]/g, d => '۰۱۲۳۴۵۶۷۸۹'.indexOf(d)),description:node.innerText.split(" ").slice(2).join(" ")}) ))
|
||||||
|
export const holidays = {
|
||||||
|
y1404: [
|
||||||
|
{
|
||||||
|
date: "1404/1/1",
|
||||||
|
description: "جشن نوروز/جشن سال نو",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/1/2",
|
||||||
|
description: "عیدنوروز",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/1/2",
|
||||||
|
description: "شهادت حضرت علی علیه السلام [ ٢١ رمضان ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/1/3",
|
||||||
|
description: "عیدنوروز",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/1/4",
|
||||||
|
description: "عیدنوروز",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/1/11",
|
||||||
|
description: "عید سعید فطر [ ١ شوال ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/1/12",
|
||||||
|
description: "روز جمهوری اسلامی",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/1/12",
|
||||||
|
description: "تعطیل به مناسبت عید سعید فطر [ ٢ شوال ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/1/13",
|
||||||
|
description: "جشن سیزده به در",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/2/4",
|
||||||
|
description: "شهادت امام جعفر صادق علیه السلام [ ٢٥ شوال ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/3/14",
|
||||||
|
description: "رحلت حضرت امام خمینی",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/3/15",
|
||||||
|
description: "قیام 15 خرداد",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/3/17",
|
||||||
|
description: "عید سعید قربان [ ١٠ ذوالحجه ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/3/25",
|
||||||
|
description: "عید سعید غدیر خم [ ١٨ ذوالحجه ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/4/14",
|
||||||
|
description: "تاسوعای حسینی [ ٩ محرم ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/4/15",
|
||||||
|
description: "عاشورای حسینی [ ١٠ محرم ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/5/24",
|
||||||
|
description: "اربعین حسینی [ ٢٠ صفر ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/6/1",
|
||||||
|
description: "رحلت رسول اکرم؛شهادت امام حسن مجتبی علیه السلام [ ٢٨ صفر ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/6/2",
|
||||||
|
description: "شهادت امام رضا علیه السلام [ ٢٩ صفر ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/6/10",
|
||||||
|
description: "شهادت امام حسن عسکری علیه السلام [ ٨ ربيع الاول ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/6/19",
|
||||||
|
description:
|
||||||
|
"میلاد رسول اکرم و امام جعفر صادق علیه السلام [ ١٧ ربيع الاول ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/9/4",
|
||||||
|
description: "شهادت حضرت فاطمه زهرا سلام الله علیها [ ٣ جمادي الثانيه ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/10/13",
|
||||||
|
description: "ولادت امام علی علیه السلام و روز پدر [ ١٣ رجب ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/10/27",
|
||||||
|
description: "مبعث رسول اکرم (ص) [ ٢٧ رجب ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/11/15",
|
||||||
|
description:
|
||||||
|
"ولادت حضرت قائم عجل الله تعالی فرجه و جشن نیمه شعبان [ ١٥ شعبان ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/11/22",
|
||||||
|
description: "پیروزی انقلاب اسلامی",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/12/20",
|
||||||
|
description: "شهادت حضرت علی علیه السلام [ ٢١ رمضان ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1404/12/29",
|
||||||
|
description: "روز ملی شدن صنعت نفت ایران",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
y1403: [
|
||||||
|
{
|
||||||
|
date: "1403/1/1",
|
||||||
|
description: "جشن نوروز/جشن سال نو",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/1/2",
|
||||||
|
description: "عیدنوروز",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/1/3",
|
||||||
|
description: "عیدنوروز",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/1/4",
|
||||||
|
description: "عیدنوروز",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/1/12",
|
||||||
|
description: "روز جمهوری اسلامی",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/1/13",
|
||||||
|
description: "جشن سیزده به در",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/1/13",
|
||||||
|
description: "شهادت حضرت علی علیه السلام [ ٢١ رمضان ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/1/23",
|
||||||
|
description: "عید سعید فطر [ ١ شوال ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/1/24",
|
||||||
|
description: "تعطیل به مناسبت عید سعید فطر [ ٢ شوال ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/2/16",
|
||||||
|
description: "شهادت امام جعفر صادق علیه السلام [ ٢٥ شوال ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/3/14",
|
||||||
|
description: "رحلت حضرت امام خمینی",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/3/15",
|
||||||
|
description: "قیام 15 خرداد",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/3/28",
|
||||||
|
description: "عید سعید قربان [ ١٠ ذوالحجه ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/4/5",
|
||||||
|
description: "عید سعید غدیر خم [ ١٨ ذوالحجه ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/4/26",
|
||||||
|
description: "تاسوعای حسینی [ ٩ محرم ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/4/27",
|
||||||
|
description: "عاشورای حسینی [ ١٠ محرم ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/6/4",
|
||||||
|
description: "اربعین حسینی [ ٢٠ صفر ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/6/12",
|
||||||
|
description: "رحلت رسول اکرم؛شهادت امام حسن مجتبی علیه السلام [ ٢٨ صفر ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/6/14",
|
||||||
|
description: "شهادت امام رضا علیه السلام [ ٣٠ صفر ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/6/22",
|
||||||
|
description: "شهادت امام حسن عسکری علیه السلام [ ٨ ربيع الاول ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/6/31",
|
||||||
|
description:
|
||||||
|
"میلاد رسول اکرم و امام جعفر صادق علیه السلام [ ١٧ ربيع الاول ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/9/15",
|
||||||
|
description: "شهادت حضرت فاطمه زهرا سلام الله علیها [ ٣ جمادي الثانيه ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/10/25",
|
||||||
|
description: "ولادت امام علی علیه السلام و روز پدر [ ١٣ رجب ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/11/9",
|
||||||
|
description: "مبعث رسول اکرم (ص) [ ٢٧ رجب ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/11/22",
|
||||||
|
description: "پیروزی انقلاب اسلامی",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/11/27",
|
||||||
|
description:
|
||||||
|
"ولادت حضرت قائم عجل الله تعالی فرجه و جشن نیمه شعبان [ ١٥ شعبان ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/12/29",
|
||||||
|
description: "روز ملی شدن صنعت نفت ایران",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1403/12/30",
|
||||||
|
description: "آخرین روز سال",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
y1402: [
|
||||||
|
{
|
||||||
|
date: "1402/1/1",
|
||||||
|
description: "جشن نوروز/جشن سال نو",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/1/2",
|
||||||
|
description: "عیدنوروز",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/1/3",
|
||||||
|
description: "عیدنوروز",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/1/4",
|
||||||
|
description: "عیدنوروز",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/1/12",
|
||||||
|
description: "روز جمهوری اسلامی",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/1/13",
|
||||||
|
description: "جشن سیزده به در",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/1/23",
|
||||||
|
description: "شهادت حضرت علی علیه السلام [ ٢١ رمضان ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/2/2",
|
||||||
|
description: "عید سعید فطر [ ١ شوال ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/2/3",
|
||||||
|
description: "تعطیل به مناسبت عید سعید فطر [ ٢ شوال ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/2/26",
|
||||||
|
description: "شهادت امام جعفر صادق علیه السلام [ ٢٥ شوال ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/3/14",
|
||||||
|
description: "رحلت حضرت امام خمینی",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/3/15",
|
||||||
|
description: "قیام 15 خرداد",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/4/8",
|
||||||
|
description: "عید سعید قربان [ ١٠ ذوالحجه ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/4/16",
|
||||||
|
description: "عید سعید غدیر خم [ ١٨ ذوالحجه ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/5/5",
|
||||||
|
description: "تاسوعای حسینی [ ٩ محرم ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/5/6",
|
||||||
|
description: "عاشورای حسینی [ ١٠ محرم ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/6/15",
|
||||||
|
description: "اربعین حسینی [ ٢٠ صفر ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/6/23",
|
||||||
|
description: "رحلت رسول اکرم؛شهادت امام حسن مجتبی علیه السلام [ ٢٨ صفر ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/6/25",
|
||||||
|
description: "شهادت امام رضا علیه السلام [ ٣٠ صفر ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/7/2",
|
||||||
|
description: "شهادت امام حسن عسکری علیه السلام [ ٨ ربيع الاول ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/7/11",
|
||||||
|
description:
|
||||||
|
"میلاد رسول اکرم و امام جعفر صادق علیه السلام [ ١٧ ربيع الاول ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/9/26",
|
||||||
|
description: "شهادت حضرت فاطمه زهرا سلام الله علیها [ ٣ جمادي الثانيه ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/11/5",
|
||||||
|
description: "ولادت امام علی علیه السلام و روز پدر [ ١٣ رجب ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/11/19",
|
||||||
|
description: "مبعث رسول اکرم (ص) [ ٢٧ رجب ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/11/22",
|
||||||
|
description: "پیروزی انقلاب اسلامی",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/12/6",
|
||||||
|
description:
|
||||||
|
"ولادت حضرت قائم عجل الله تعالی فرجه و جشن نیمه شعبان [ ١٥ شعبان ]",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: "1402/12/29",
|
||||||
|
description: "روز ملی شدن صنعت نفت ایران",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "brizco",
|
"name": "brizco",
|
||||||
"version": "0.1.0",
|
"version": "0.1.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
@ -14,6 +14,7 @@
|
||||||
"autoprefixer": "10.4.15",
|
"autoprefixer": "10.4.15",
|
||||||
"axios": "^1.5.1",
|
"axios": "^1.5.1",
|
||||||
"boring-avatars": "^1.10.1",
|
"boring-avatars": "^1.10.1",
|
||||||
|
"core-util-is": "^1.0.3",
|
||||||
"framer-motion": "^10.16.1",
|
"framer-motion": "^10.16.1",
|
||||||
"jalali-moment": "^3.3.11",
|
"jalali-moment": "^3.3.11",
|
||||||
"next": "13.4.19",
|
"next": "13.4.19",
|
||||||
|
|
|
@ -0,0 +1,221 @@
|
||||||
|
"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";
|
||||||
|
import DatePickerIran from "plugins/DatePickerIran/page";
|
||||||
|
import moment from "jalali-moment";
|
||||||
|
import validateIranPhone from "plugins/IranPhoneRegex";
|
||||||
|
const jalaliMoment = require("jalali-moment");
|
||||||
|
|
||||||
|
const BottomManageShift = (props) => {
|
||||||
|
const CTX = useContext(AppContext);
|
||||||
|
const [firstName, setFirstName] = useState("");
|
||||||
|
const [lastName, setLastName] = useState("");
|
||||||
|
const [phoneNumber, setPhoneNumber] = useState("");
|
||||||
|
const [nationalId, setNationalId] = useState("");
|
||||||
|
const [gender, setGender] = useState(parseInt(0));
|
||||||
|
const [birthDate, setBirthDate] = useState(null);
|
||||||
|
const [roleSelectCurrntData, setRoleSelectCurrntData] = useState("");
|
||||||
|
const [roleSelectData, setRoleSelectData] = 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 rolesChoose = CTX.state.rolesChoose;
|
||||||
|
const rolesData = CTX.state.rolesData;
|
||||||
|
const goToEditUser = CTX.state.goToEditUser;
|
||||||
|
const idEditUser = CTX.state.idEditUser;
|
||||||
|
const userData = CTX.state.userData;
|
||||||
|
|
||||||
|
const body = {
|
||||||
|
phoneNumber,
|
||||||
|
firstName,
|
||||||
|
lastName,
|
||||||
|
birthDateTimeStamp:
|
||||||
|
birthDate &&
|
||||||
|
moment
|
||||||
|
.utc(
|
||||||
|
[birthDate.year, birthDate.month, birthDate.day],
|
||||||
|
"jYYYY-jMM-jDDTHH"
|
||||||
|
)
|
||||||
|
.unix(),
|
||||||
|
gender: parseInt(gender),
|
||||||
|
nationalId,
|
||||||
|
roleIds: rolesChoose,
|
||||||
|
};
|
||||||
|
|
||||||
|
const bodyUpdate = {
|
||||||
|
phoneNumber,
|
||||||
|
firstName,
|
||||||
|
lastName,
|
||||||
|
birthDateTimeStamp:
|
||||||
|
birthDate &&
|
||||||
|
moment
|
||||||
|
.utc(
|
||||||
|
[birthDate.year, birthDate.month, birthDate.day],
|
||||||
|
"jYYYY-jMM-jDDTHH"
|
||||||
|
)
|
||||||
|
.unix(),
|
||||||
|
gender: parseInt(gender),
|
||||||
|
nationalId,
|
||||||
|
roleIds: rolesChoose,
|
||||||
|
userId: userData.id,
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(bodyUpdate);
|
||||||
|
|
||||||
|
const clear = () => {
|
||||||
|
setFirstName("");
|
||||||
|
setLastName("");
|
||||||
|
setPhoneNumber("");
|
||||||
|
setNationalId("");
|
||||||
|
setGender("");
|
||||||
|
setBirthDate("");
|
||||||
|
setRoleSelectCurrntData("");
|
||||||
|
setRoleSelectData([]);
|
||||||
|
CTX.setRolesChoose([]);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCreateUser = (update) => {
|
||||||
|
if (validateIranPhone(phoneNumber)) {
|
||||||
|
if (validator.current.allValid()) {
|
||||||
|
if (update == "UPDATE") {
|
||||||
|
CTX.UpdateUser(bodyUpdate);
|
||||||
|
} else {
|
||||||
|
CTX.CreateUser(body);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
toast.error("پرکردن همه ی فیلد ها واجب است", {
|
||||||
|
position: "bottom-right",
|
||||||
|
autoClose: 2000,
|
||||||
|
hideProgressBar: false,
|
||||||
|
closeOnClick: true,
|
||||||
|
pauseOnHover: true,
|
||||||
|
draggable: true,
|
||||||
|
progress: undefined,
|
||||||
|
});
|
||||||
|
|
||||||
|
validator.current.showMessages();
|
||||||
|
forceUpdate(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
toast.error("شماره تماس را درست وارد کنید", {
|
||||||
|
position: "bottom-right",
|
||||||
|
autoClose: 2000,
|
||||||
|
hideProgressBar: false,
|
||||||
|
closeOnClick: true,
|
||||||
|
pauseOnHover: true,
|
||||||
|
draggable: true,
|
||||||
|
progress: undefined,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const deleteRole = (id) => {
|
||||||
|
CTX.setRolesChoose(rolesChoose.filter((el) => el !== id));
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleBottomSheetCreateEmployeesOpen = (e) => {
|
||||||
|
setRoleSelectData(
|
||||||
|
rolesData.map((item) => ({
|
||||||
|
key: item.persianName,
|
||||||
|
value: item.id,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(idEditUser);
|
||||||
|
|
||||||
|
if (e.type == "OPEN") {
|
||||||
|
CTX.GetRoles();
|
||||||
|
if (goToEditUser) {
|
||||||
|
CTX.GetUser(idEditUser);
|
||||||
|
}
|
||||||
|
} else if (e.type == "CLOSE") {
|
||||||
|
clear();
|
||||||
|
CTX.setGoToEditUser(false);
|
||||||
|
CTX.setIdEditUser(null);
|
||||||
|
CTX.setUserData([]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (goToEditUser) {
|
||||||
|
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);
|
||||||
|
setGender(userData.gender);
|
||||||
|
setBirthDate({
|
||||||
|
day: parseInt(date[2]),
|
||||||
|
month: parseInt(date[1]),
|
||||||
|
year: parseInt(date[0]),
|
||||||
|
});
|
||||||
|
// setRoleSelectCurrntData("");
|
||||||
|
CTX.setRolesChoose(userData.roleIds);
|
||||||
|
console.log("userData2", userData);
|
||||||
|
}
|
||||||
|
}, [userData]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<BottomSheet
|
||||||
|
onSpringStart={(e) => handleBottomSheetCreateEmployeesOpen(e)}
|
||||||
|
open={CTX.state.BottomManageShiftOpen}
|
||||||
|
onDismiss={() => CTX.setBottomManageShiftOpen(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="firstName-id"
|
||||||
|
name="firstName"
|
||||||
|
type={"text"}
|
||||||
|
value={firstName}
|
||||||
|
inputEvent={(e) => {
|
||||||
|
setFirstName(e.target.value);
|
||||||
|
validator.current.showMessageFor("firstName");
|
||||||
|
}}
|
||||||
|
style="text-right"
|
||||||
|
validator={true}
|
||||||
|
validatorData={validator.current.message(
|
||||||
|
"firstName",
|
||||||
|
firstName,
|
||||||
|
"required"
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</BottomSheet>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default BottomManageShift;
|
|
@ -15,23 +15,12 @@ const BottomSheetCreateShifts = (props) => {
|
||||||
const [dayOfWeeksCurrent, setDayOfWeeksCurrent] = useState("");
|
const [dayOfWeeksCurrent, setDayOfWeeksCurrent] = useState("");
|
||||||
const [, forceUpdate] = useState();
|
const [, forceUpdate] = useState();
|
||||||
|
|
||||||
const dayOfWeeksChoose = CTX.state.dayOfWeeksChoose;
|
|
||||||
const startAtTimeShift = CTX.state.startAtTimeShift;
|
const startAtTimeShift = CTX.state.startAtTimeShift;
|
||||||
const endAtTimeShift = CTX.state.endAtTimeShift;
|
const endAtTimeShift = CTX.state.endAtTimeShift;
|
||||||
const goToEditShift = CTX.state.goToEditShift;
|
const goToEditShift = CTX.state.goToEditShift;
|
||||||
const idEditShift = CTX.state.idEditShift;
|
const idEditShift = CTX.state.idEditShift;
|
||||||
const shiftData = CTX.state.shiftData;
|
const shiftData = CTX.state.shiftData;
|
||||||
|
|
||||||
const week = [
|
|
||||||
{ key: "شنبه", value: 6 },
|
|
||||||
{ key: "یکشنبه", value: 0 },
|
|
||||||
{ key: "دوشنبه", value: 1 },
|
|
||||||
{ key: "سه شنبه", value: 2 },
|
|
||||||
{ key: "چهار شنبه", value: 3 },
|
|
||||||
{ key: "پنج شنبه", value: 4 },
|
|
||||||
{ key: "جمعه", value: 5 },
|
|
||||||
];
|
|
||||||
|
|
||||||
const validator = useRef(
|
const validator = useRef(
|
||||||
new SimpleReactValidator({
|
new SimpleReactValidator({
|
||||||
messages: {
|
messages: {
|
||||||
|
@ -53,7 +42,6 @@ const BottomSheetCreateShifts = (props) => {
|
||||||
setTitle("");
|
setTitle("");
|
||||||
// CTX.setEndAtTimeShift(["00", "00"]);
|
// CTX.setEndAtTimeShift(["00", "00"]);
|
||||||
// CTX.setStartAtTimeShift(["00", "00"]);
|
// CTX.setStartAtTimeShift(["00", "00"]);
|
||||||
CTX.setdayOfWeeksChoose([]);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
|
@ -61,7 +49,6 @@ const BottomSheetCreateShifts = (props) => {
|
||||||
description,
|
description,
|
||||||
endAt: endAtTimeShift[0] + ":" + endAtTimeShift[1] + ":00",
|
endAt: endAtTimeShift[0] + ":" + endAtTimeShift[1] + ":00",
|
||||||
startAt: startAtTimeShift[0] + ":" + startAtTimeShift[1] + ":00",
|
startAt: startAtTimeShift[0] + ":" + startAtTimeShift[1] + ":00",
|
||||||
dayOfWeeks: dayOfWeeksChoose,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const bodyUpdate = {
|
const bodyUpdate = {
|
||||||
|
@ -69,7 +56,6 @@ const BottomSheetCreateShifts = (props) => {
|
||||||
description,
|
description,
|
||||||
endAt: endAtTimeShift[0] + ":" + endAtTimeShift[1] + ":00",
|
endAt: endAtTimeShift[0] + ":" + endAtTimeShift[1] + ":00",
|
||||||
startAt: startAtTimeShift[0] + ":" + startAtTimeShift[1] + ":00",
|
startAt: startAtTimeShift[0] + ":" + startAtTimeShift[1] + ":00",
|
||||||
dayOfWeeks: dayOfWeeksChoose,
|
|
||||||
id: shiftData.id,
|
id: shiftData.id,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -96,11 +82,6 @@ const BottomSheetCreateShifts = (props) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteRole = (value) => {
|
|
||||||
console.log(value);
|
|
||||||
CTX.setDayOfWeeksChoose(dayOfWeeksChoose.filter((el) => el !== value));
|
|
||||||
};
|
|
||||||
|
|
||||||
console.log(body);
|
console.log(body);
|
||||||
|
|
||||||
const handleBottomSheetCreateShift = (e) => {
|
const handleBottomSheetCreateShift = (e) => {
|
||||||
|
@ -128,8 +109,6 @@ const BottomSheetCreateShifts = (props) => {
|
||||||
shiftData.endAt.split(":")[0],
|
shiftData.endAt.split(":")[0],
|
||||||
shiftData.endAt.split(":")[1],
|
shiftData.endAt.split(":")[1],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
CTX.setDayOfWeeksChoose(shiftData.days);
|
|
||||||
}
|
}
|
||||||
}, [shiftData]);
|
}, [shiftData]);
|
||||||
|
|
||||||
|
@ -218,60 +197,6 @@ const BottomSheetCreateShifts = (props) => {
|
||||||
/>
|
/>
|
||||||
</div>
|
</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 },
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<div className="">
|
<div className="">
|
||||||
<Input
|
<Input
|
||||||
lable=" توضیحات"
|
lable=" توضیحات"
|
||||||
|
|
190
pnpm-lock.yaml
190
pnpm-lock.yaml
|
@ -20,6 +20,9 @@ dependencies:
|
||||||
boring-avatars:
|
boring-avatars:
|
||||||
specifier: ^1.10.1
|
specifier: ^1.10.1
|
||||||
version: 1.10.1
|
version: 1.10.1
|
||||||
|
core-util-is:
|
||||||
|
specifier: ^1.0.3
|
||||||
|
version: 1.0.3
|
||||||
framer-motion:
|
framer-motion:
|
||||||
specifier: ^10.16.1
|
specifier: ^10.16.1
|
||||||
version: 10.16.1(react-dom@18.2.0)(react@18.2.0)
|
version: 10.16.1(react-dom@18.2.0)(react@18.2.0)
|
||||||
|
@ -38,15 +41,9 @@ dependencies:
|
||||||
react-dom:
|
react-dom:
|
||||||
specifier: 18.2.0
|
specifier: 18.2.0
|
||||||
version: 18.2.0(react@18.2.0)
|
version: 18.2.0(react@18.2.0)
|
||||||
react-duration-picker:
|
|
||||||
specifier: ^1.1.1
|
|
||||||
version: 1.1.1(react@18.2.0)
|
|
||||||
react-modern-calendar-datepicker:
|
react-modern-calendar-datepicker:
|
||||||
specifier: ^3.1.6
|
specifier: ^3.1.6
|
||||||
version: 3.1.6(react-dom@18.2.0)(react@18.2.0)
|
version: 3.1.6(react-dom@18.2.0)(react@18.2.0)
|
||||||
react-persian-datepicker:
|
|
||||||
specifier: ^3.0.2
|
|
||||||
version: 3.0.2(react-dom@18.2.0)(react@18.2.0)
|
|
||||||
react-spring-bottom-sheet:
|
react-spring-bottom-sheet:
|
||||||
specifier: ^3.4.1
|
specifier: ^3.4.1
|
||||||
version: 3.4.1(react-dom@18.2.0)(react@18.2.0)
|
version: 3.4.1(react-dom@18.2.0)(react@18.2.0)
|
||||||
|
@ -474,12 +471,6 @@ packages:
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/add-dom-event-listener@1.1.0:
|
|
||||||
resolution: {integrity: sha512-WCxx1ixHT0GQU9hb0KI/mhgRQhnU+U3GvwY6ZvVjYq8rsihIGoaIOUbY0yMPBxLH5MDtr0kz3fisWGNcbWW7Jw==}
|
|
||||||
dependencies:
|
|
||||||
object-assign: 4.1.1
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/ajv-keywords@3.5.2(ajv@6.12.6):
|
/ajv-keywords@3.5.2(ajv@6.12.6):
|
||||||
resolution: {integrity: sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==}
|
resolution: {integrity: sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
|
@ -562,13 +553,6 @@ packages:
|
||||||
- debug
|
- debug
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/babel-runtime@6.26.0:
|
|
||||||
resolution: {integrity: sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==}
|
|
||||||
dependencies:
|
|
||||||
core-js: 2.6.12
|
|
||||||
regenerator-runtime: 0.11.1
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/balanced-match@1.0.2:
|
/balanced-match@1.0.2:
|
||||||
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
|
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
|
||||||
dev: false
|
dev: false
|
||||||
|
@ -680,10 +664,6 @@ packages:
|
||||||
engines: {node: '>=6.0'}
|
engines: {node: '>=6.0'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/classnames@2.3.2:
|
|
||||||
resolution: {integrity: sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/cli-cursor@3.1.0:
|
/cli-cursor@3.1.0:
|
||||||
resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==}
|
resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
|
@ -747,38 +727,12 @@ packages:
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/component-classes@1.2.6:
|
|
||||||
resolution: {integrity: sha512-hPFGULxdwugu1QWW3SvVOCUHLzO34+a2J6Wqy0c5ASQkfi9/8nZcBB0ZohaEbXOQlCflMAEMmEWk7u7BVs4koA==}
|
|
||||||
dependencies:
|
|
||||||
component-indexof: 0.0.3
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/component-indexof@0.0.3:
|
|
||||||
resolution: {integrity: sha512-puDQKvx/64HZXb4hBwIcvQLaLgux8o1CbWl39s41hrIIZDl1lJiD5jc22gj3RBeGK0ovxALDYpIbyjqDUUl0rw==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/concat-map@0.0.1:
|
/concat-map@0.0.1:
|
||||||
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/core-js@2.6.12:
|
/core-util-is@1.0.3:
|
||||||
resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==}
|
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
|
||||||
deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
|
|
||||||
requiresBuild: true
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/create-react-class@15.7.0:
|
|
||||||
resolution: {integrity: sha512-QZv4sFWG9S5RUvkTYWbflxeZX+JG7Cz0Tn33rQBJ+WFQTqTfUTjMjiv9tnfXazjsO5r0KhPs+AqCjyrQX6h2ng==}
|
|
||||||
dependencies:
|
|
||||||
loose-envify: 1.4.0
|
|
||||||
object-assign: 4.1.1
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/css-animation@1.6.1:
|
|
||||||
resolution: {integrity: sha512-/48+/BaEaHRY6kNQ2OIPzKf9A6g8WjZYjhiNDNuIVbsm5tXCGIAsHDjB4Xu1C4vXJtUWZo26O68OQkDpNBaPog==}
|
|
||||||
dependencies:
|
|
||||||
babel-runtime: 6.26.0
|
|
||||||
component-classes: 1.2.6
|
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/css-loader@6.8.1(webpack@5.89.0):
|
/css-loader@6.8.1(webpack@5.89.0):
|
||||||
|
@ -822,10 +776,6 @@ packages:
|
||||||
resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
|
resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/dom-align@1.12.4:
|
|
||||||
resolution: {integrity: sha512-R8LUSEay/68zE5c8/3BDxiTEvgb4xZTF0RKmAHfiEVN3klfIpXfi2/QCoiWPccVQ0J/ZGdz9OjzL4uJEP/MRAw==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/electron-to-chromium@1.4.503:
|
/electron-to-chromium@1.4.503:
|
||||||
resolution: {integrity: sha512-LF2IQit4B0VrUHFeQkWhZm97KuJSGF2WJqq1InpY+ECpFRkXd8yTIaTtJxsO0OKDmiBYwWqcrNaXOurn2T2wiA==}
|
resolution: {integrity: sha512-LF2IQit4B0VrUHFeQkWhZm97KuJSGF2WJqq1InpY+ECpFRkXd8yTIaTtJxsO0OKDmiBYwWqcrNaXOurn2T2wiA==}
|
||||||
|
|
||||||
|
@ -1134,10 +1084,6 @@ packages:
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/jalaali-js@0.2.0:
|
|
||||||
resolution: {integrity: sha512-NnJVmUbesh1v3GXZsjPd18sGvxKaNmHQ7svwULNvYBSVQKdsEatUmXiUQZd7HzU10Ur2eX/83ZT5rEzc746dJw==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/jalaali-js@1.2.6:
|
/jalaali-js@1.2.6:
|
||||||
resolution: {integrity: sha512-io974va+Qyu+UfuVX3UIAgJlxLhAMx9Y8VMfh+IG00Js7hXQo1qNQuwSiSa0xxco0SVgx5HWNkaiCcV+aZ8WPw==}
|
resolution: {integrity: sha512-io974va+Qyu+UfuVX3UIAgJlxLhAMx9Y8VMfh+IG00Js7hXQo1qNQuwSiSa0xxco0SVgx5HWNkaiCcV+aZ8WPw==}
|
||||||
dev: false
|
dev: false
|
||||||
|
@ -1255,13 +1201,6 @@ packages:
|
||||||
brace-expansion: 1.1.11
|
brace-expansion: 1.1.11
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/moment-jalali@0.3.9:
|
|
||||||
resolution: {integrity: sha512-ffHEHJbyYsHImjABoVIq309nnNjMSnapnoTcLRIDsxNQNdrkqiAVmjTFn1EiQdts6XDwhKg9d/06vurVoChMyA==}
|
|
||||||
dependencies:
|
|
||||||
jalaali-js: 0.2.0
|
|
||||||
moment: 2.29.4
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/moment@2.29.4:
|
/moment@2.29.4:
|
||||||
resolution: {integrity: sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==}
|
resolution: {integrity: sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==}
|
||||||
dev: false
|
dev: false
|
||||||
|
@ -1392,10 +1331,6 @@ packages:
|
||||||
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
|
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/performance-now@2.1.0:
|
|
||||||
resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/picocolors@1.0.0:
|
/picocolors@1.0.0:
|
||||||
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
|
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
|
||||||
|
|
||||||
|
@ -1552,68 +1487,12 @@ packages:
|
||||||
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
|
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/raf@3.4.1:
|
|
||||||
resolution: {integrity: sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==}
|
|
||||||
dependencies:
|
|
||||||
performance-now: 2.1.0
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/randombytes@2.1.0:
|
/randombytes@2.1.0:
|
||||||
resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==}
|
resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==}
|
||||||
dependencies:
|
dependencies:
|
||||||
safe-buffer: 5.2.1
|
safe-buffer: 5.2.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/rc-align@2.4.5:
|
|
||||||
resolution: {integrity: sha512-nv9wYUYdfyfK+qskThf4BQUSIadeI/dCsfaMZfNEoxm9HwOIioQ+LyqmMK6jWHAZQgOzMLaqawhuBXlF63vgjw==}
|
|
||||||
dependencies:
|
|
||||||
babel-runtime: 6.26.0
|
|
||||||
dom-align: 1.12.4
|
|
||||||
prop-types: 15.8.1
|
|
||||||
rc-util: 4.21.1
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/rc-animate@2.11.1(react-dom@18.2.0)(react@18.2.0):
|
|
||||||
resolution: {integrity: sha512-1NyuCGFJG/0Y+9RKh5y/i/AalUCA51opyyS/jO2seELpgymZm2u9QV3xwODwEuzkmeQ1BDPxMLmYLcTJedPlkQ==}
|
|
||||||
peerDependencies:
|
|
||||||
react: '>=16.9.0'
|
|
||||||
react-dom: '>=16.9.0'
|
|
||||||
dependencies:
|
|
||||||
babel-runtime: 6.26.0
|
|
||||||
classnames: 2.3.2
|
|
||||||
css-animation: 1.6.1
|
|
||||||
prop-types: 15.8.1
|
|
||||||
raf: 3.4.1
|
|
||||||
rc-util: 4.21.1
|
|
||||||
react: 18.2.0
|
|
||||||
react-dom: 18.2.0(react@18.2.0)
|
|
||||||
react-lifecycles-compat: 3.0.4
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/rc-trigger@1.11.5(react-dom@18.2.0)(react@18.2.0):
|
|
||||||
resolution: {integrity: sha512-MBuUPw1nFzA4K7jQOwb7uvFaZFjXGd00EofUYiZ+l/fgKVq8wnLC0lkv36kwqM7vfKyftRo2sh7cWVpdPuNnnw==}
|
|
||||||
dependencies:
|
|
||||||
babel-runtime: 6.26.0
|
|
||||||
create-react-class: 15.7.0
|
|
||||||
prop-types: 15.8.1
|
|
||||||
rc-align: 2.4.5
|
|
||||||
rc-animate: 2.11.1(react-dom@18.2.0)(react@18.2.0)
|
|
||||||
rc-util: 4.21.1
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- react
|
|
||||||
- react-dom
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/rc-util@4.21.1:
|
|
||||||
resolution: {integrity: sha512-Z+vlkSQVc1l8O2UjR3WQ+XdWlhj5q9BMQNLk2iOBch75CqPfrJyGtcWMcnhRlNuDu0Ndtt4kLVO8JI8BrABobg==}
|
|
||||||
dependencies:
|
|
||||||
add-dom-event-listener: 1.1.0
|
|
||||||
prop-types: 15.8.1
|
|
||||||
react-is: 16.13.1
|
|
||||||
react-lifecycles-compat: 3.0.4
|
|
||||||
shallowequal: 1.1.0
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/react-dom@18.2.0(react@18.2.0):
|
/react-dom@18.2.0(react@18.2.0):
|
||||||
resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==}
|
resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
|
@ -1624,23 +1503,10 @@ packages:
|
||||||
scheduler: 0.23.0
|
scheduler: 0.23.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/react-duration-picker@1.1.1(react@18.2.0):
|
|
||||||
resolution: {integrity: sha512-1yzIjfpoSbRgJm88h8RF5VkTA0wa+sBRMmH9dudxzs7A8BC4LFvQiku51atx//JI5Yb4iwAelB9jjuWyxbkcqg==}
|
|
||||||
peerDependencies:
|
|
||||||
react: '>=16.8.0'
|
|
||||||
dependencies:
|
|
||||||
prop-types: 15.8.1
|
|
||||||
react: 18.2.0
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/react-is@16.13.1:
|
/react-is@16.13.1:
|
||||||
resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
|
resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/react-lifecycles-compat@3.0.4:
|
|
||||||
resolution: {integrity: sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/react-modern-calendar-datepicker@3.1.6(react-dom@18.2.0)(react@18.2.0):
|
/react-modern-calendar-datepicker@3.1.6(react-dom@18.2.0)(react@18.2.0):
|
||||||
resolution: {integrity: sha512-lnMqEMj9Wn32/sm119tjCl5lOkq4u9vJE7wggi7hdXV4s8rPdKlH56FVVehlBi0dfYeWQVZ9npY384Zprjn4WA==}
|
resolution: {integrity: sha512-lnMqEMj9Wn32/sm119tjCl5lOkq4u9vJE7wggi7hdXV4s8rPdKlH56FVVehlBi0dfYeWQVZ9npY384Zprjn4WA==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
|
@ -1652,28 +1518,6 @@ packages:
|
||||||
react-dom: 18.2.0(react@18.2.0)
|
react-dom: 18.2.0(react@18.2.0)
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/react-onclickoutside@5.11.1:
|
|
||||||
resolution: {integrity: sha512-iZKK+qUsGuqz+O3O/LtvDWkwmoqagC0EtRybhCJ3hawi9PF0ZaVrLnR24lqovbuvvUeA+cd1cWALOw+l1tfeaQ==}
|
|
||||||
dependencies:
|
|
||||||
create-react-class: 15.7.0
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/react-persian-datepicker@3.0.2(react-dom@18.2.0)(react@18.2.0):
|
|
||||||
resolution: {integrity: sha512-Kg6eQlBqQOv+j8g3MTv5WOD+fpsBgfbWolrlQH2DLCiUnypWD/qLi5c+UptYjXNoQiCjo6ikN/gFiOb5eHb3lA==}
|
|
||||||
peerDependencies:
|
|
||||||
react: ^15.2.1
|
|
||||||
react-dom: ^15.2.1
|
|
||||||
dependencies:
|
|
||||||
classnames: 2.3.2
|
|
||||||
moment-jalali: 0.3.9
|
|
||||||
prop-types: 15.8.1
|
|
||||||
rc-trigger: 1.11.5(react-dom@18.2.0)(react@18.2.0)
|
|
||||||
react: 18.2.0
|
|
||||||
react-dom: 18.2.0(react@18.2.0)
|
|
||||||
react-onclickoutside: 5.11.1
|
|
||||||
react-tether: 0.5.7(react-dom@18.2.0)(react@18.2.0)
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/react-spring-bottom-sheet@3.4.1(react-dom@18.2.0)(react@18.2.0):
|
/react-spring-bottom-sheet@3.4.1(react-dom@18.2.0)(react@18.2.0):
|
||||||
resolution: {integrity: sha512-yDFqiPMm/fjefjnOe6Q9zxccbCl6HMUKsK5bWgfGHJIj4zmXVKio5d4icQvmOLuwpuCA2pwv4J6nGWS6fUZidQ==}
|
resolution: {integrity: sha512-yDFqiPMm/fjefjnOe6Q9zxccbCl6HMUKsK5bWgfGHJIj4zmXVKio5d4icQvmOLuwpuCA2pwv4J6nGWS6fUZidQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
|
@ -1706,18 +1550,6 @@ packages:
|
||||||
react-dom: 18.2.0(react@18.2.0)
|
react-dom: 18.2.0(react@18.2.0)
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/react-tether@0.5.7(react-dom@18.2.0)(react@18.2.0):
|
|
||||||
resolution: {integrity: sha512-oAZQLcABWpFXSV2El6WqFMoUuYdG8iKnE+CJcBI+WMPkvMGnguMC0lHx/cmyIcOxm/6JetTEmq2Q7T2bpoe69w==}
|
|
||||||
peerDependencies:
|
|
||||||
react: ^0.14.0 || ^15.0.0
|
|
||||||
react-dom: ^0.14.0 || ^15.0.0
|
|
||||||
dependencies:
|
|
||||||
prop-types: 15.8.1
|
|
||||||
react: 18.2.0
|
|
||||||
react-dom: 18.2.0(react@18.2.0)
|
|
||||||
tether: 1.4.7
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/react-toastify@9.1.3(react-dom@18.2.0)(react@18.2.0):
|
/react-toastify@9.1.3(react-dom@18.2.0)(react@18.2.0):
|
||||||
resolution: {integrity: sha512-fPfb8ghtn/XMxw3LkxQBk3IyagNpF/LIKjOBflbexr2AWxAH1MJgvnESwEwBn9liLFXgTKWgBSdZpw9m4OTHTg==}
|
resolution: {integrity: sha512-fPfb8ghtn/XMxw3LkxQBk3IyagNpF/LIKjOBflbexr2AWxAH1MJgvnESwEwBn9liLFXgTKWgBSdZpw9m4OTHTg==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
|
@ -1767,10 +1599,6 @@ packages:
|
||||||
picomatch: 2.3.1
|
picomatch: 2.3.1
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/regenerator-runtime@0.11.1:
|
|
||||||
resolution: {integrity: sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/regenerator-runtime@0.14.0:
|
/regenerator-runtime@0.14.0:
|
||||||
resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==}
|
resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==}
|
||||||
dev: false
|
dev: false
|
||||||
|
@ -1850,10 +1678,6 @@ packages:
|
||||||
randombytes: 2.1.0
|
randombytes: 2.1.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/shallowequal@1.1.0:
|
|
||||||
resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/signal-exit@3.0.7:
|
/signal-exit@3.0.7:
|
||||||
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
|
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
|
||||||
dev: false
|
dev: false
|
||||||
|
@ -2035,10 +1859,6 @@ packages:
|
||||||
source-map-support: 0.5.21
|
source-map-support: 0.5.21
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/tether@1.4.7:
|
|
||||||
resolution: {integrity: sha512-Z0J1aExjoFU8pybVkQAo/vD2wfSO63r+XOPfWQMC5qtf1bI7IWqNk4MiyBcgvvnY8kqnY06dVdvwTK2S3PU/Fw==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/thenify-all@1.6.0:
|
/thenify-all@1.6.0:
|
||||||
resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==}
|
resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==}
|
||||||
engines: {node: '>=0.8'}
|
engines: {node: '>=0.8'}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import "react-toastify/dist/ReactToastify.css";
|
||||||
import Loading from "plugins/Loading/page";
|
import Loading from "plugins/Loading/page";
|
||||||
import Chapar, { getToken } from "plugins/Chapar";
|
import Chapar, { getToken } from "plugins/Chapar";
|
||||||
import TimePicker from "plugins/TimePicker/page";
|
import TimePicker from "plugins/TimePicker/page";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
const inter = Inter({ subsets: ["latin"] });
|
const inter = Inter({ subsets: ["latin"] });
|
||||||
|
|
||||||
|
@ -36,6 +37,8 @@ export default function RootLayout({ children }) {
|
||||||
const [BottomSheetCreateShiftsOpen, setBottomSheetCreateShiftsOpen] =
|
const [BottomSheetCreateShiftsOpen, setBottomSheetCreateShiftsOpen] =
|
||||||
useState(false);
|
useState(false);
|
||||||
|
|
||||||
|
const [BottomManageShiftOpen, setBottomManageShiftOpen] = useState(false);
|
||||||
|
|
||||||
// BigPlus
|
// BigPlus
|
||||||
const [BigPlusOpen, setBigPlusOpen] = useState(false);
|
const [BigPlusOpen, setBigPlusOpen] = useState(false);
|
||||||
const [BigPlusRotateIcon, setBigPlusRotateIcon] = useState(false);
|
const [BigPlusRotateIcon, setBigPlusRotateIcon] = useState(false);
|
||||||
|
@ -68,7 +71,6 @@ export default function RootLayout({ children }) {
|
||||||
const [idEditUser, setIdEditUser] = useState(null);
|
const [idEditUser, setIdEditUser] = useState(null);
|
||||||
|
|
||||||
// shift
|
// shift
|
||||||
const [dayOfWeeksChoose, setDayOfWeeksChoose] = useState([]);
|
|
||||||
const [startAtTimeShift, setStartAtTimeShift] = useState(["00", "00"]);
|
const [startAtTimeShift, setStartAtTimeShift] = useState(["00", "00"]);
|
||||||
const [endAtTimeShift, setEndAtTimeShift] = useState(["00", "00"]);
|
const [endAtTimeShift, setEndAtTimeShift] = useState(["00", "00"]);
|
||||||
const [shiftsData, setShiftsData] = useState([null]);
|
const [shiftsData, setShiftsData] = useState([null]);
|
||||||
|
@ -76,6 +78,9 @@ export default function RootLayout({ children }) {
|
||||||
const [goToEditShift, setGoToEditShift] = useState(false);
|
const [goToEditShift, setGoToEditShift] = useState(false);
|
||||||
const [idEditShift, setIdEditShift] = useState(null);
|
const [idEditShift, setIdEditShift] = useState(null);
|
||||||
|
|
||||||
|
// shift manage-shift
|
||||||
|
const [searchUserChoose, setSearchUserChoose] = useState([]);
|
||||||
|
|
||||||
// TimePicker
|
// TimePicker
|
||||||
const [openTimePicker, setOpenTimePicker] = useState(false);
|
const [openTimePicker, setOpenTimePicker] = useState(false);
|
||||||
const [TimePickerOrder, setTimePickerOrder] = useState(null);
|
const [TimePickerOrder, setTimePickerOrder] = useState(null);
|
||||||
|
@ -639,7 +644,6 @@ export default function RootLayout({ children }) {
|
||||||
idEditUser,
|
idEditUser,
|
||||||
goToEditUser,
|
goToEditUser,
|
||||||
userData,
|
userData,
|
||||||
dayOfWeeksChoose,
|
|
||||||
openTimePicker,
|
openTimePicker,
|
||||||
endAtTimeShift,
|
endAtTimeShift,
|
||||||
startAtTimeShift,
|
startAtTimeShift,
|
||||||
|
@ -649,6 +653,8 @@ export default function RootLayout({ children }) {
|
||||||
goToEditShift,
|
goToEditShift,
|
||||||
shiftData,
|
shiftData,
|
||||||
profile,
|
profile,
|
||||||
|
searchUserChoose,
|
||||||
|
BottomManageShiftOpen,
|
||||||
},
|
},
|
||||||
setBottomSheetCreateRoleOpen,
|
setBottomSheetCreateRoleOpen,
|
||||||
setBottomSheetCreateEmployeesOpen,
|
setBottomSheetCreateEmployeesOpen,
|
||||||
|
@ -686,7 +692,6 @@ export default function RootLayout({ children }) {
|
||||||
DeleteUser,
|
DeleteUser,
|
||||||
GetUser,
|
GetUser,
|
||||||
UpdateUser,
|
UpdateUser,
|
||||||
setDayOfWeeksChoose,
|
|
||||||
setOpenTimePicker,
|
setOpenTimePicker,
|
||||||
setEndAtTimeShift,
|
setEndAtTimeShift,
|
||||||
setStartAtTimeShift,
|
setStartAtTimeShift,
|
||||||
|
@ -702,6 +707,8 @@ export default function RootLayout({ children }) {
|
||||||
DeleteShift,
|
DeleteShift,
|
||||||
setProfile,
|
setProfile,
|
||||||
CheckUser,
|
CheckUser,
|
||||||
|
setSearchUserChoose,
|
||||||
|
setBottomManageShiftOpen,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
|
@ -10,6 +10,8 @@ import core from "../../public/images/core.png";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import PersianNumber from "../../plugins/PersianNumber";
|
import PersianNumber from "../../plugins/PersianNumber";
|
||||||
import UnderDevelopeTimer from "../../components/UnderDevelopeTimer";
|
import UnderDevelopeTimer from "../../components/UnderDevelopeTimer";
|
||||||
|
import { version } from "../../package.json";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
const [state, setstate] = useState(false);
|
const [state, setstate] = useState(false);
|
||||||
|
@ -19,7 +21,7 @@ export default function Home() {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-[100vh] overflow-hidden relative ">
|
<div className="h-[100vh] overflow-hidden relative bg-info-100">
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<div
|
<div
|
||||||
className={`relative z-50 ${
|
className={`relative z-50 ${
|
||||||
|
@ -66,15 +68,16 @@ export default function Home() {
|
||||||
</div>
|
</div>
|
||||||
<motion.div animate={{ y: [0, -130] }} transition={{ duration: 3 }}>
|
<motion.div animate={{ y: [0, -130] }} transition={{ duration: 3 }}>
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<h3 className="font-bold text-2xl text-gray-700 rtl">
|
<h3 className="font-bold text-2xl text-gray-700 rtl text-white">
|
||||||
کارگران مشغول کارند
|
تا اینجا ورژن <br />
|
||||||
<br />
|
|
||||||
<PersianNumber number={30} size={30} />
|
|
||||||
{" "}
|
{" "}
|
||||||
شهریــــــــــــــــــــــور میبینمتون
|
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<UnderDevelopeTimer />
|
<Link href={"/login"}>
|
||||||
|
<p className="mb-0 mt-5 text-white ">
|
||||||
|
<PersianNumber number={version} style="text-[40px] font-bold" />
|
||||||
|
</p>
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,337 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import React, { useContext, useEffect, useState } from "react";
|
||||||
|
import moment from "jalali-moment";
|
||||||
|
import "moment/locale/fa"; // Set the locale to Farsi (Persian)
|
||||||
|
import AppHeader from "@comp/AppHeader/page";
|
||||||
|
import { Swiper, SwiperSlide } from "swiper/react";
|
||||||
|
import PersianNumber from "plugins/PersianNumber";
|
||||||
|
import { PersianD, PersianDay, PersianM, holidays } from "datacalender";
|
||||||
|
import AppContext from "@ctx/AppContext";
|
||||||
|
import Input from "plugins/Input/page";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
import Avatar from "boring-avatars";
|
||||||
|
import BottomManageShift from "plugins/BottomSheet/BottomManageShift";
|
||||||
|
|
||||||
|
const Calendar = () => {
|
||||||
|
const CTX = useContext(AppContext);
|
||||||
|
const shiftsData = CTX.state.shiftsData;
|
||||||
|
const searchUserChoose = CTX.state.searchUserChoose;
|
||||||
|
const usersData = CTX.state.usersData;
|
||||||
|
|
||||||
|
console.log("usersData", usersData);
|
||||||
|
|
||||||
|
const [searchUserCurrntData, setSearchUserCurrntData] = useState([]);
|
||||||
|
const [daysUntilEnd, setDaysUntilEnd] = useState([]);
|
||||||
|
const [selectDay, setSelectDay] = useState(null);
|
||||||
|
const [selectShift, setselectShift] = useState(0);
|
||||||
|
const [manageShiftEmployeesData, setManageShiftEmployeesData] = useState([]);
|
||||||
|
|
||||||
|
const today = moment().format("jYYYY/jM/jD"); // Get the current Jalali date
|
||||||
|
const todayJustDay = moment().format("jD"); // Get the current Jalali date
|
||||||
|
|
||||||
|
// Find the end of the current month
|
||||||
|
const endOfMonth = moment(today, "jYYYY/jM/jD").endOf("jMonth");
|
||||||
|
|
||||||
|
const daysInCurrentMonth = moment(today, "jYYYY/jM/jD")
|
||||||
|
.endOf("jMonth")
|
||||||
|
.jDate();
|
||||||
|
|
||||||
|
const daysEndOfMonth = () => {
|
||||||
|
const days = [];
|
||||||
|
for (let i = -1; i < daysInCurrentMonth - todayJustDay + 1; i++) {
|
||||||
|
const currentDate = moment(today, "jYYYY/jM/jD").add(i, "days");
|
||||||
|
const isToday = currentDate.isSame(moment(), "day");
|
||||||
|
days.push({
|
||||||
|
checkDay: currentDate.format("jYYYY/jM/jD"),
|
||||||
|
date: currentDate.format("jD / jM"),
|
||||||
|
dayOfWeek: currentDate.format("dddd"),
|
||||||
|
today: isToday, // Set today: true if it's the current date
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return setDaysUntilEnd(days);
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log("daysUntilEnd", daysUntilEnd[selectDay]);
|
||||||
|
|
||||||
|
const handleManageShiftEmployeesOpen = (e) => {
|
||||||
|
setManageShiftEmployeesData(
|
||||||
|
usersData.map((item) => ({
|
||||||
|
key:
|
||||||
|
item.firstName +
|
||||||
|
" " +
|
||||||
|
item.lastName +
|
||||||
|
"( " +
|
||||||
|
item.roleNames[0] +
|
||||||
|
" )",
|
||||||
|
|
||||||
|
value: item.userId,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const deleteSearchUser = (id) => {
|
||||||
|
CTX.setSearchUserChoose(searchUserChoose.filter((el) => el !== id));
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
daysEndOfMonth();
|
||||||
|
setSelectDay(1);
|
||||||
|
CTX.GetShifts();
|
||||||
|
CTX.GetUsers();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
// if (!!CTX.GetUsers()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
handleManageShiftEmployeesOpen();
|
||||||
|
}, [usersData]);
|
||||||
|
|
||||||
|
console.log("searchUserChooseqqqqqqqqqqqqqqqqqqqqqqqqq", searchUserChoose);
|
||||||
|
|
||||||
|
console.log(daysUntilEnd);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="pb-20">
|
||||||
|
<AppHeader
|
||||||
|
title=" شیفت بندی های هفتگی"
|
||||||
|
sub={`شیفت بندی
|
||||||
|
تا
|
||||||
|
${daysInCurrentMonth}
|
||||||
|
${PersianM(moment().format("jM"))}
|
||||||
|
|
||||||
|
`}
|
||||||
|
icon2={true}
|
||||||
|
iconName2="ARROW"
|
||||||
|
iconHref2="/home"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div className="bg-body-100 relative top-[-30px] rounded-t-3xl overflow-hidden p-4 rtl">
|
||||||
|
<Swiper
|
||||||
|
spaceBetween={10}
|
||||||
|
slidesPerView={4.3}
|
||||||
|
onSlideChange={() => console.log("slide change")}
|
||||||
|
onSwiper={(swiper) => console.log(swiper)}
|
||||||
|
>
|
||||||
|
{daysUntilEnd?.map((e, index) => (
|
||||||
|
<SwiperSlide>
|
||||||
|
<div
|
||||||
|
className={`h-[70px] tr03 ${
|
||||||
|
selectDay == index ? "bg-white rounded-xl" : " opacity-70"
|
||||||
|
}`}
|
||||||
|
key={index}
|
||||||
|
onClick={() => {
|
||||||
|
setSelectDay(index);
|
||||||
|
console.log(index);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className="py-2">
|
||||||
|
<p className="mb-0 text-center ">
|
||||||
|
<PersianNumber
|
||||||
|
number={e.date}
|
||||||
|
style={`text-[20px] ${
|
||||||
|
selectDay == index
|
||||||
|
? "font-bold"
|
||||||
|
: !!holidays.y1402?.find((b) => b.date == e.checkDay)
|
||||||
|
? "text-red-500"
|
||||||
|
: ""
|
||||||
|
} `}
|
||||||
|
/>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
className={`w-fit mx-auto sahdow px-1 rounded-full ${
|
||||||
|
selectDay == index
|
||||||
|
? "bg-secondary-100 text-gray-100"
|
||||||
|
: !!holidays.y1402?.find((b) => b.date == e.checkDay)
|
||||||
|
? "bg-transparent text-red-500"
|
||||||
|
: "bg-white text-gray-500"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<p className="mb-0 text-center text-sm ">
|
||||||
|
{/* {PersianD.find((i) => i == e.dayOfWeek)} */}
|
||||||
|
{PersianDay(e.dayOfWeek)}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</SwiperSlide>
|
||||||
|
))}
|
||||||
|
</Swiper>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bg-body-100 relative top-[-30px] rounded-t-3xl overflow-hidden rtl">
|
||||||
|
{shiftsData.length > 0 ? (
|
||||||
|
<div
|
||||||
|
className="flex overflow-auto whitespace-nowrap"
|
||||||
|
id="swich-shifts"
|
||||||
|
>
|
||||||
|
{shiftsData.map((e, index) => (
|
||||||
|
<div
|
||||||
|
className={` shadow-sm relative block max-w-max mx-2 rounded-full mt-2 px-4 py-2 ${
|
||||||
|
selectShift == index
|
||||||
|
? "bg-secondary-100 text-white"
|
||||||
|
: "bg-white opacity-60"
|
||||||
|
}`}
|
||||||
|
onClick={() => setselectShift(index)}
|
||||||
|
>
|
||||||
|
<p className="mb-0">{e?.title}</p>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="flex justify-center py-5">
|
||||||
|
<div className="bg-white shadow mt-5 w-fit rounded-full p-4">
|
||||||
|
چیزی یافت نشد
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="bg-white relative top-[15px] rounded-t-3xl p-4 rtl pt-6 h-screen sm:h-auto ">
|
||||||
|
<div className="mx-3 flex justify-center">
|
||||||
|
<div className=" bg-gray-100 rounded-xl w-fit mr-0 p-3">
|
||||||
|
<p className="mb-0 text-right text-sm rtl opacity-80">
|
||||||
|
ویرایش برای{" "}
|
||||||
|
<small className=" text-sm font-bold">
|
||||||
|
{shiftsData && shiftsData[selectShift]?.title}
|
||||||
|
</small>{" "}
|
||||||
|
تاریخ{" "}
|
||||||
|
<small className=" text-sm font-bold text-primary-300 bg-white px-2 rounded-full">
|
||||||
|
<PersianNumber
|
||||||
|
number={daysUntilEnd && daysUntilEnd[selectDay]?.checkDay}
|
||||||
|
/>
|
||||||
|
</small>{" "}
|
||||||
|
میباشد
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className=" m-1">
|
||||||
|
<Input
|
||||||
|
lable="جستجوی افراد"
|
||||||
|
id="SearchUser-id"
|
||||||
|
name="SearchUser"
|
||||||
|
type={"text"}
|
||||||
|
value={searchUserCurrntData}
|
||||||
|
inputEvent={(e) => {
|
||||||
|
setSearchUserCurrntData(e.target.value);
|
||||||
|
|
||||||
|
if (!!searchUserChoose.find((b) => b == e.target.value)) {
|
||||||
|
toast.error("نقش تکراری است", {
|
||||||
|
position: "bottom-right",
|
||||||
|
closeOnClick: true,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
CTX.setSearchUserChoose((current) => [
|
||||||
|
...current,
|
||||||
|
e.target.value,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
style="text-right"
|
||||||
|
// validatorData={validator.current.message(
|
||||||
|
// "phoneNumber",
|
||||||
|
// phoneNumber,
|
||||||
|
// "required"
|
||||||
|
// )}
|
||||||
|
select={true}
|
||||||
|
selectData={manageShiftEmployeesData}
|
||||||
|
theme={1}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
className={`flex j flex-wrap mt-3 rtl ${
|
||||||
|
searchUserChoose.length > 0 ? "" : "justify-center"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{searchUserChoose.length > 0 ? (
|
||||||
|
searchUserChoose.map((e) => (
|
||||||
|
<div className="flex bg-gray-100 p-1 rounded-full m-1 justify-start">
|
||||||
|
<div
|
||||||
|
className="w-[30px] h-[30px] rounded-full bg-gray-400 "
|
||||||
|
onClick={() => deleteSearchUser(e)}
|
||||||
|
>
|
||||||
|
<Avatar
|
||||||
|
size={30}
|
||||||
|
name={usersData.find((b) => b.userId == e)?.firstName}
|
||||||
|
variant="beam"
|
||||||
|
colors={["#9d9f88", "#83af96", "#b2de93"]}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p className="mb-0 px-3 text-sm mt-1">
|
||||||
|
{usersData.find((b) => b.userId == e)?.firstName}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<div className="flex justify-center py-5">
|
||||||
|
<div className="bg-white shadow mt-5 w-fit rounded-full p-4">
|
||||||
|
چیزی یافت نشد
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex jc mt-10">
|
||||||
|
<button className="btn btn-primary inline-block w-full">
|
||||||
|
{" "}
|
||||||
|
ثبت نهایی شیفت
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="btn bg-transparent border-[2px] border-info-100 border-dashed text-info-100 text-[12px] mx-2 w-full"
|
||||||
|
onClick={() => CTX.setBottomManageShiftOpen(true)}
|
||||||
|
>
|
||||||
|
تغییر حالت تسک ها{" "}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<BottomManageShift />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Calendar;
|
||||||
|
|
||||||
|
{
|
||||||
|
/* {shiftsData.map((e, index) => (
|
||||||
|
<div
|
||||||
|
className={`bg-gray-200 p-5 rounded-3xl relative w-full pb-20 border-[4px] border-white !z-[${index}] `}
|
||||||
|
style={{ top: `${27 * (shiftsData.length - 1 - index)}px` }}
|
||||||
|
>
|
||||||
|
<div className="flex rtl">
|
||||||
|
<div className="w-[40px] h-[40px] bg-primary-300 rounded-full">
|
||||||
|
<svg
|
||||||
|
width="15"
|
||||||
|
height="15"
|
||||||
|
viewBox="0 0 150 88"
|
||||||
|
fill="none"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
className="mx-auto mt-[10px]"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M137.5 75L75 12.5L12.5 75"
|
||||||
|
stroke="white"
|
||||||
|
stroke-width="25"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="mx-3 ">
|
||||||
|
<p className="mb-0 font-bold text-xl text-right">{e?.title}</p>
|
||||||
|
<p className="mb-0 text-sm text-right">
|
||||||
|
{e?.title} {}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))} */
|
||||||
|
}
|
|
@ -3,6 +3,7 @@
|
||||||
import AppHeader from "@comp/AppHeader/page";
|
import AppHeader from "@comp/AppHeader/page";
|
||||||
import ShiftCard from "@comp/ShiftComponent/ShiftCard/page";
|
import ShiftCard from "@comp/ShiftComponent/ShiftCard/page";
|
||||||
import AppContext from "@ctx/AppContext";
|
import AppContext from "@ctx/AppContext";
|
||||||
|
import Link from "next/link";
|
||||||
import BottomSheetCreateShifts from "plugins/BottomSheet/BottomSheetCreateShifts";
|
import BottomSheetCreateShifts from "plugins/BottomSheet/BottomSheetCreateShifts";
|
||||||
import PersianNumber from "plugins/PersianNumber";
|
import PersianNumber from "plugins/PersianNumber";
|
||||||
import React, { useContext, useEffect } from "react";
|
import React, { useContext, useEffect } from "react";
|
||||||
|
@ -43,14 +44,18 @@ const Shifts = (props) => {
|
||||||
نمایید و با توجه به نیاز های مجموعه خود شیفت بندی کنید .{" "}
|
نمایید و با توجه به نیاز های مجموعه خود شیفت بندی کنید .{" "}
|
||||||
</p>
|
</p>
|
||||||
<div className="flex my-3">
|
<div className="flex my-3">
|
||||||
|
<Link href={"/shifts/manage-shift"} className="w-full">
|
||||||
<button className="btn btn-secondary text-[12px] w-full">
|
<button className="btn btn-secondary text-[12px] w-full">
|
||||||
{" "}
|
{" "}
|
||||||
شیفت بندی هفته
|
شیفت بندی هفته
|
||||||
</button>
|
</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 className="btn bg-transparent border-[2px] border-white border-dashed text-white text-[12px] mx-2 w-full">
|
||||||
{" "}
|
{" "}
|
||||||
شیفت بندی هغته بعد
|
شیفت بندی هغته بعد
|
||||||
</button>
|
</button>
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -204,3 +204,13 @@ body {
|
||||||
inherits: true;
|
inherits: true;
|
||||||
initial-value: 0turn;
|
initial-value: 0turn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#swich-shifts::-webkit-scrollbar {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide scrollbar for IE, Edge and Firefox */
|
||||||
|
#swich-shifts {
|
||||||
|
-ms-overflow-style: none; /* IE and Edge */
|
||||||
|
scrollbar-width: none; /* Firefox */
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue