diff --git a/.env b/.env index 80bfa1c..6ab09ec 100644 --- a/.env +++ b/.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 \ No newline at end of file diff --git a/components/EmployeesComponent/Position/page.jsx b/components/EmployeesComponent/Position/page.jsx new file mode 100644 index 0000000..4e7e1c7 --- /dev/null +++ b/components/EmployeesComponent/Position/page.jsx @@ -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 ? ( +
+ {positionsData.map((e) => ( +
+
+

+ {e.name} +

+
+
goToEditPosition(e.id)} + > + + + + + + + + + + + + + + + +
+
+ ))} +
+ ) : ( +
+
+ چیزی یافت نشد +
+
+ )} + + ); +}; + +export default PositionEmployees; diff --git a/components/EmployeesComponent/Sections/page.jsx b/components/EmployeesComponent/Sections/page.jsx new file mode 100644 index 0000000..1f56575 --- /dev/null +++ b/components/EmployeesComponent/Sections/page.jsx @@ -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 ? ( +
+ {sectionsData.map((e) => ( +
+
+

+ {e.name} +

+
+
goToEditSection(e.id)} + > + + + + + + + + + + + + + + + +
+
+ ))} +
+ ) : ( +
+
+ چیزی یافت نشد +
+
+ )} + + ); +}; + +export default SectionEmployees; diff --git a/components/EmployeesComponent/routine/page.jsx b/components/EmployeesComponent/routine/page.jsx new file mode 100644 index 0000000..47841cc --- /dev/null +++ b/components/EmployeesComponent/routine/page.jsx @@ -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 ? ( +
+ {routinesData.map((e) => ( +
+
+

+ {e.name} +

+
+
goToEditRoutine(e.id)} + > + + + + + + + + + + + + + + + +
+
+ ))} +
+ ) : ( +
+
+ چیزی یافت نشد +
+
+ )} + + ); +}; + +export default RoutineEmployees; diff --git a/components/NavBar/NavBAr.jsx b/components/NavBar/NavBAr.jsx index 3341e12..6249315 100644 --- a/components/NavBar/NavBAr.jsx +++ b/components/NavBar/NavBAr.jsx @@ -180,9 +180,9 @@ const NavBAr = (props) => { - + <> - {usePath.includes("/dashboard") ? ( + {usePath.includes("/routine") ? (
diff --git a/plugins/BottomSheet/BottomManageShift.jsx b/plugins/BottomSheet/BottomManageShift.jsx index e03cffc..9dd4fed 100644 --- a/plugins/BottomSheet/BottomManageShift.jsx +++ b/plugins/BottomSheet/BottomManageShift.jsx @@ -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([]); diff --git a/plugins/BottomSheet/BottomSheetCreateEmployees.jsx b/plugins/BottomSheet/BottomSheetCreateEmployees.jsx index 3b111ee..e692632 100644 --- a/plugins/BottomSheet/BottomSheetCreateEmployees.jsx +++ b/plugins/BottomSheet/BottomSheetCreateEmployees.jsx @@ -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 ( handleBottomSheetCreateEmployeesOpen(e)} @@ -252,11 +271,11 @@ const BottomSheetCreateEmployees = (props) => { />
- setBirthDate(e)} date={birthDate} zindex="z-[1000]" - /> + /> */}
{ />
-
+ {/*
{ }} style="text-right" /> -
+
*/}
{ )} select={true} selectData={roleSelectData} + defaultValue={"انتخاب کنید"} />
@@ -341,6 +361,55 @@ const BottomSheetCreateEmployees = (props) => { ))}
+
+ { + 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={"انتخاب کنید"} + /> +
+ +
+
+ {/*
deleteSection(e)} + >
*/} + +
+

+ {positionsData?.find((b) => b.id == positionId)?.name} +

+
+
+
+ {goToEditUser ? ( { + 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) => ( + <> +
+ {message} +
+ + ), + }) + ); + + 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 ( + handleBottomSheetCreatePositionOpen(e)} + open={CTX.state.BottomSheetCreatePositionOpen} + onDismiss={() => CTX.setBottomSheetCreatePositionOpen(false)} + blocking={false} + > +
+

+ افزودن پوزیشن جدید{" "} +

+
+ +
+
+ { + setTitle(e.target.value); + validator.current.showMessageFor("title"); + }} + style="text-right" + validator={true} + validatorData={validator.current.message( + "title", + title, + "required" + )} + /> +
+
+ { + setDescription(e.target.value); + validator.current.showMessageFor("description"); + }} + textarea={true} + style="text-right" + validator={true} + validatorData={validator.current.message( + "description", + description, + "required" + )} + /> +
+ +
+ { + 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={"انتخاب کنید"} + /> +
+ +
+
+ {/*
deleteSection(e)} + >
*/} + +
+

+ {sectionsData?.find((b) => b.id == sectionId)?.name} +

+
+
+
+ + {goToEditPosition ? ( + handleCreatePosition("UPDATE")} + subButton={true} + subButtonTitle="حذف پوزیشن" + subButtonEvent={() => CTX.DeletePosition(idEditPosition)} + /> + ) : ( + handleCreatePosition()} + /> + )} +
+
+ ); +}; + +export default BottomSheetCreatePosition; diff --git a/plugins/BottomSheet/BottomSheetCreateRoutine.jsx b/plugins/BottomSheet/BottomSheetCreateRoutine.jsx new file mode 100644 index 0000000..7d00fe8 --- /dev/null +++ b/plugins/BottomSheet/BottomSheetCreateRoutine.jsx @@ -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) => ( + <> +
+ {message} +
+ + ), + }) + ); + + 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 ( + handleBottomSheetCreateRoutineOpen(e)} + open={CTX.state.BottomSheetCreateRoutineOpen} + onDismiss={() => CTX.setBottomSheetCreateRoutineOpen(false)} + blocking={false} + > +
+

+ افزودن روتین جدید{" "} +

+
+ +
+
+ { + setTitle(e.target.value); + validator.current.showMessageFor("title"); + }} + style="text-right" + validator={true} + validatorData={validator.current.message( + "title", + title, + "required" + )} + /> +
+
+ { + setDescription(e.target.value); + validator.current.showMessageFor("description"); + }} + textarea={true} + style="text-right" + validator={true} + validatorData={validator.current.message( + "description", + description, + "required" + )} + /> +
+ + {goToEditRoutine ? ( + handleCreateRoutine("UPDATE")} + subButton={true} + subButtonTitle="حذف روتین" + subButtonEvent={() => CTX.DeleteRoutine(idEditRoutine)} + /> + ) : ( + handleCreateRoutine()} + /> + )} +
+
+ ); +}; + +export default BottomSheetCreateRoutine; diff --git a/plugins/BottomSheet/BottomSheetCreateSection.jsx b/plugins/BottomSheet/BottomSheetCreateSection.jsx new file mode 100644 index 0000000..be2a5a2 --- /dev/null +++ b/plugins/BottomSheet/BottomSheetCreateSection.jsx @@ -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) => ( + <> +
+ {message} +
+ + ), + }) + ); + + 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 ( + handleBottomSheetCreateSectionOpen(e)} + open={CTX.state.BottomSheetCreateSectionOpen} + onDismiss={() => CTX.setBottomSheetCreateSectionOpen(false)} + blocking={false} + > +
+

افزودن سکشن جدید

+
+ +
+
+ { + setTitle(e.target.value); + validator.current.showMessageFor("title"); + }} + style="text-right" + validator={true} + validatorData={validator.current.message( + "title", + title, + "required" + )} + /> +
+
+ { + setDescription(e.target.value); + validator.current.showMessageFor("description"); + }} + textarea={true} + style="text-right" + validator={true} + validatorData={validator.current.message( + "description", + description, + "required" + )} + /> +
+ + {goToEditSection ? ( + handleCreateSection("UPDATE")} + subButton={true} + subButtonTitle="حذف سکشن" + subButtonEvent={() => CTX.DeleteSection(idEditSection)} + /> + ) : ( + handleCreateSection()} + /> + )} +
+
+ ); +}; + +export default BottomSheetCreateSection; diff --git a/plugins/BottomSheet/BottomSheetCreateShifts.jsx b/plugins/BottomSheet/BottomSheetCreateShifts.jsx index 669e22a..4d4f2fd 100644 --- a/plugins/BottomSheet/BottomSheetCreateShifts.jsx +++ b/plugins/BottomSheet/BottomSheetCreateShifts.jsx @@ -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={() => { - CTX.setOpenTimePicker(true); - CTX.setBottomSheetCreateShiftsOpen(false); - CTX.setTimePickerOrder("CREATE-SHIFT-START"); + 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={() => { - CTX.setOpenTimePicker(true); - CTX.setBottomSheetCreateShiftsOpen(false); - CTX.setTimePickerOrder("CREATE-SHIFT-END"); + 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} /> +
+ { + 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={"انتخاب کنید"} + /> +
+ +
+ {dayOfWeeksChoose && + dayOfWeeksChoose.map((e) => ( +
+
deleteRole(e)} + >
+ +
+

+ {week?.find((b) => b.value == e).key} +

+
+
+ ))} +
+
{ return (
) : select ? ( @@ -56,7 +64,7 @@ const Input = ({ { 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}`; diff --git a/src/app/employees/page.jsx b/src/app/employees/page.jsx index dca0ddf..d9e7952 100644 --- a/src/app/employees/page.jsx +++ b/src/app/employees/page.jsx @@ -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 (
{ }} /> -
-
+
+
+
setActiveSection(0)} + > +
+
+

+ +

+
+
+

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

+

+ شما + + + + روتین فعال دارید +

+
+
+ + {activeSection == 0 ? ( +
CTX.setBottomSheetCreateRoutineOpen(true)} + > + + + +
+ ) : ( +
+ )} +
+ + {activeSection == 0 && } +
+ + {/*

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

-

+

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

@@ -69,47 +140,169 @@ const Employees = (props) => {
- - -
-
-

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

-

- شما - - - - کارمند فعال دارید -

-
+ */} +
CTX.setBottomSheetCreateEmployeesOpen(true)} + className="flex justify-between mt-7 bg-white rounded-2xl" + onClick={() => setActiveSection(1)} > - - - +
+
+

+ +

+
+
+

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

+

+ شما + + + + سکشن فعال دارید +

+
+
+ {activeSection == 1 ? ( +
CTX.setBottomSheetCreateSectionOpen(true)} + > + + + +
+ ) : ( +
+ )}
+ {activeSection == 1 && }
- +
+
setActiveSection(2)} + > +
+
+

+ +

+
+
+

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

+

+ شما + + + + پوزیشن فعال دارید +

+
+
+ {activeSection == 2 ? ( +
CTX.setBottomSheetCreatePositionOpen(true)} + > + + + +
+ ) : ( +
+ )} +
+ {activeSection == 2 && } +
+ +
+
setActiveSection(3)} + > +
+
+

+ +

+
+
+

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

+

+ شما + + + + کارمند فعال دارید +

+
+
+ + {activeSection == 3 ? ( +
CTX.setBottomSheetCreateEmployeesOpen(true)} + > + + + +
+ ) : ( +
+ )} +
+ {activeSection == 3 && } +
- + {/* */} + + +
); }; diff --git a/src/app/home/page.jsx b/src/app/home/page.jsx index 3208ed5..6f9dc8b 100644 --- a/src/app/home/page.jsx +++ b/src/app/home/page.jsx @@ -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) => { />
-
-
-

تسک های هفتگی مجموعه

-

- امروز - - - - تسک فعال دارید -

-
- -
- - - -
-
- - console.log("slide change")} - onSwiper={(swiper) => console.log(swiper)} - > - -
-
-
- اهمیت بالا{" "} -
-
- شیفت صبح -
-
-
-
-

- کارگاه بدنسازی در خانه برای رستوران توگک -

-
- -
-
-
-
-
-
- -
-

- + - - - - نفر دیگر -

-
-
- -
-
- - - -
-

- دوشنبه - - - - اردیبهشت - - - -

-
-
-
-
- - -
-
-
- اهمیت بالا{" "} -
-
- شیفت صبح -
-
-
-
-

- کارگاه بدنسازی در خانه برای رستوران توگک -

-
- -
-
-
-
-
-
- -
-

- + - - - - نفر دیگر -

-
-
- -
-
- - - -
-

- دوشنبه - - - - اردیبهشت - - - -

-
-
-
-
-
- -
-
-

تسک های امروز

-

- امروز - - - - تسک فعال دارید -

-
- -
- - - -
-
-
- -
+ اینجا برای مدیریت میشه همون چارت ها و ...
); diff --git a/src/app/layout.jsx b/src/app/layout.jsx index 27ecc0c..3dade48 100644 --- a/src/app/layout.jsx +++ b/src/app/layout.jsx @@ -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, }} > diff --git a/src/app/routine/page.jsx b/src/app/routine/page.jsx new file mode 100644 index 0000000..0dbe7db --- /dev/null +++ b/src/app/routine/page.jsx @@ -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 ( +
+ CTX.setBottomSheetCreateRoutineOpen(true)} + icon2={true} + iconName2="ARROW" + iconHref2="/home" + iconEvent2={() => { + return undefined; + }} + /> +
+
+
+

تسک های هفتگی مجموعه

+

+ امروز + + + + تسک فعال دارید +

+
+ +
+ + + +
+
+ + console.log("slide change")} + onSwiper={(swiper) => console.log(swiper)} + > + +
+
+
+ اهمیت بالا{" "} +
+
+ شیفت صبح +
+
+
+
+

+ کارگاه بدنسازی در خانه برای رستوران توگک +

+
+ +
+
+
+
+
+
+ +
+

+ + + + + + نفر دیگر +

+
+
+ +
+
+ + + +
+

+ دوشنبه + + + + اردیبهشت + + + +

+
+
+
+
+ + +
+
+
+ اهمیت بالا{" "} +
+
+ شیفت صبح +
+
+
+
+

+ کارگاه بدنسازی در خانه برای رستوران توگک +

+
+ +
+
+
+
+
+
+ +
+

+ + + + + + نفر دیگر +

+
+
+ +
+
+ + + +
+

+ دوشنبه + + + + اردیبهشت + + + +

+
+
+
+
+
+ +
+
+

تسک های امروز

+

+ امروز + + + + تسک فعال دارید +

+
+ +
+ + + +
+
+
+ +
+
+ + +
+ ); +}; + +export default page; diff --git a/src/app/shifts/manage-shift/page.jsx b/src/app/shifts/manage-shift/page.jsx index 4ddbe5a..9bddff4 100644 --- a/src/app/shifts/manage-shift/page.jsx +++ b/src/app/shifts/manage-shift/page.jsx @@ -232,14 +232,10 @@ const Calendar = () => { } }} style="text-right" - // validatorData={validator.current.message( - // "phoneNumber", - // phoneNumber, - // "required" - // )} select={true} selectData={manageShiftEmployeesData} theme={1} + defaultValue={"انتخاب کنید"} />
diff --git a/src/app/shifts/page.jsx b/src/app/shifts/page.jsx index c7b0cf6..61c060d 100644 --- a/src/app/shifts/page.jsx +++ b/src/app/shifts/page.jsx @@ -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) => { }} /> -
-
-
-

- شیفتــــ های مجموعه{" "} -

-

- شما میتوانید به صورت هفتگی شیفت بندی های رستوران خود را تعریف - نمایید و با توجه به نیاز های مجموعه خود شیفت بندی کنید .{" "} -

-
- - - - - - +
+ +
+

شیفت هفته

+ +
+
-
+ + +
+

+ {" "} + شیفت بعدی + هفته بعد +

+
+
+
{" "} +
+ +
+ +
diff --git a/style/globals.css b/style/globals.css index 1615561..d989a64 100644 --- a/style/globals.css +++ b/style/globals.css @@ -122,6 +122,11 @@ body { } [data-rsbs-header] { background-color: #356859; + padding-top: 30px !important; +} + +[data-rsbs-header]::before { + top: 20px !important; } .DatePicker {