Bugs After Test Fixed
parent
600e6be7ee
commit
7a070545dd
|
|
@ -3,5 +3,9 @@ import React from "react";
|
|||
|
||||
export default function page({ params }: { params: any }) {
|
||||
const id = params.id;
|
||||
return <ComplainsDetails role="Inspector" id={id} />;
|
||||
return (
|
||||
<div className="w-[90vw] sm:w-[90vw] lg:w-[85vw] xl:w-[75vw] 3xl:w-[70vw] mt-3 sm:mt-6 mx-auto mb-10">
|
||||
<ComplainsDetails role="Inspector" id={id} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
import Profile from "@/components/Profile";
|
||||
import React from "react";
|
||||
|
||||
export default function page() {
|
||||
return <Profile />;
|
||||
}
|
||||
|
|
@ -7,8 +7,8 @@ import React from "react";
|
|||
export default function page() {
|
||||
const cookieStore = cookies();
|
||||
const token = cookieStore.get("Sootzani_Token");
|
||||
if (token) {
|
||||
redirect("/");
|
||||
}
|
||||
// if (!token) {
|
||||
// redirect("/");
|
||||
// }
|
||||
return <CitizenLogin />;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { boxItems, newsItems } from "@/constants";
|
|||
import Image from "next/image";
|
||||
import { cn } from "@/lib/utils";
|
||||
import Link from "next/link";
|
||||
import bgimg from "../../public/img/bg.png";
|
||||
import bgimg from "../../public/img/bg-slide.jpg";
|
||||
import Footer from "@/components/Footer";
|
||||
|
||||
// Import Swiper React components
|
||||
|
|
@ -18,10 +18,20 @@ import "swiper/css/pagination";
|
|||
// import required modules
|
||||
import { Autoplay, Pagination, Navigation } from "swiper/modules";
|
||||
import { sliderItems } from "@/constants";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getSliders } from "@/utils/commonApi";
|
||||
|
||||
export default function Landing() {
|
||||
const { data, isLoading, refetch } = useQuery({
|
||||
queryKey: ["Sliders"],
|
||||
queryFn: () => getSliders(),
|
||||
refetchOnWindowFocus: false,
|
||||
});
|
||||
|
||||
console.log(data);
|
||||
|
||||
return (
|
||||
<div className="overflow-x-hidden">
|
||||
<div className="overflow-x-hidden max-md:-mt-8">
|
||||
<div className="w-screen bg-top lg:bg-center bg-no-repeat h-[13rem] sm:h-[20rem] md:h-[24rem] xl:h-[33rem]">
|
||||
<Swiper
|
||||
slidesPerView={1}
|
||||
|
|
@ -37,20 +47,56 @@ export default function Landing() {
|
|||
modules={[Autoplay]}
|
||||
className="mySwiper w-full h-full"
|
||||
>
|
||||
{sliderItems.map((item) => {
|
||||
return (
|
||||
<SwiperSlide key={item.id}>
|
||||
<Image
|
||||
alt="bg"
|
||||
src={bgimg}
|
||||
// width={20}
|
||||
// height={20}
|
||||
quality={100}
|
||||
className=" w-full h-full object-cover max-sm:object-[70%]"
|
||||
/>
|
||||
</SwiperSlide>
|
||||
);
|
||||
})}
|
||||
{data?.length > 0 ? (
|
||||
<>
|
||||
{data.map((item: any, index: number) => {
|
||||
console.log(item);
|
||||
return (
|
||||
<SwiperSlide key={item.id}>
|
||||
<Image
|
||||
alt="bg"
|
||||
src={`${process.env.NEXT_PUBLIC_BASE_URL_APP}${item?.image?.url}`}
|
||||
// width={100}
|
||||
// height={100}
|
||||
layout="fill"
|
||||
quality={100}
|
||||
className=" w-full h-full object-cover max-sm:object-[70%]"
|
||||
/>
|
||||
</SwiperSlide>
|
||||
);
|
||||
})}
|
||||
{data?.length == 1 && (
|
||||
<SwiperSlide>
|
||||
<Image
|
||||
alt="bg"
|
||||
src={`${process.env.NEXT_PUBLIC_BASE_URL_APP}${data[0]?.image?.url}`}
|
||||
// width={20}
|
||||
// height={20}
|
||||
layout="fill"
|
||||
quality={100}
|
||||
className=" w-full h-full object-cover max-sm:object-[70%]"
|
||||
/>
|
||||
</SwiperSlide>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
{sliderItems.map((item) => {
|
||||
return (
|
||||
<SwiperSlide key={item.id}>
|
||||
<Image
|
||||
alt="bg"
|
||||
src={bgimg}
|
||||
// width={20}
|
||||
// height={20}
|
||||
quality={100}
|
||||
className=" w-full h-full object-cover max-sm:object-[70%]"
|
||||
/>
|
||||
</SwiperSlide>
|
||||
);
|
||||
})}
|
||||
</>
|
||||
)}
|
||||
</Swiper>
|
||||
</div>
|
||||
|
||||
|
|
@ -68,6 +114,7 @@ export default function Landing() {
|
|||
"
|
||||
key={index}
|
||||
href={item.link}
|
||||
onClick={() => localStorage.removeItem("Sootzani_Login_State")}
|
||||
>
|
||||
<p className="text-xs text-center font-medium text-gray hidden group-hover:flex ">
|
||||
{item.description}
|
||||
|
|
@ -124,7 +171,7 @@ export default function Landing() {
|
|||
height={500}
|
||||
width={500}
|
||||
quality={100}
|
||||
className="w-full h-full rounded-r-lg bg-cover object-cover object-top"
|
||||
className="w-full h-full rounded-r-lg bg-cover object-cover object-center"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -139,7 +186,7 @@ export default function Landing() {
|
|||
شروع به کار سامانه عیون
|
||||
</p>
|
||||
<p className="text-sm font-normal text-justify text-[#3C3C43D9] line-clamp-5 max-md:line-clamp-2">
|
||||
این سامانه با هدف نظارت بر عملکرد پرستل و نهادهای مرتبط با امور
|
||||
این سامانه با هدف نظارت بر عملکرد پرسنل و نهادهای مرتبط با امور
|
||||
مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده
|
||||
است ...
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ export default function RootLayout({
|
|||
<body className="font-[yekan] ">
|
||||
<Provider>
|
||||
<Navbar />
|
||||
<NavbarSm />
|
||||
{/* <NavbarSm /> */}
|
||||
|
||||
<div className="flex justify-center">{children}</div>
|
||||
<div className="flex justify-center mt-20 sm:mt-10">{children}</div>
|
||||
|
||||
<Toaster />
|
||||
<SonnerToaster />
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import { useRouter } from "next/navigation";
|
|||
import { Oval, ThreeDots } from "react-loader-spinner";
|
||||
import useData from "@/store/useData";
|
||||
import { getCookie } from "cookies-next";
|
||||
import { RefreshCcw } from "lucide-react";
|
||||
const FormSchema = z.object({
|
||||
phoneNumber: z.string().min(1, {
|
||||
message: "لطفا شماره موبایل خود را وارد نمایید.",
|
||||
|
|
@ -88,7 +89,7 @@ export default function CitizenLogin() {
|
|||
|
||||
return (
|
||||
<div
|
||||
className="w-full mt-12 sm:w-2/3 md:w-2/4 xl:w-1/3 bg-white rounded-lg dark:border xl:p-0 dark:bg-gray-800 dark:border-gray-700 shadow-[0px_0px_15px_0px_#00000040]
|
||||
className="w-full mt-14 sm:w-2/3 md:w-2/4 xl:w-1/3 bg-white rounded-lg dark:border xl:p-0 dark:bg-gray-800 dark:border-gray-700 shadow-[0px_0px_15px_0px_#00000040]
|
||||
h-full max-md:p-8 pt-12 mb-10"
|
||||
>
|
||||
<div className="space-y-3 md:space-y-4 flex flex-col md:py-10 md:px-12 lg:px-16 h-full justify-center">
|
||||
|
|
@ -157,7 +158,7 @@ export default function CitizenLogin() {
|
|||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className=" flex justify-center text-center">
|
||||
<div className=" flex justify-center items-center text-center gap-2">
|
||||
<Image
|
||||
alt="icon"
|
||||
src={srcForImage as string}
|
||||
|
|
@ -166,6 +167,11 @@ export default function CitizenLogin() {
|
|||
height={20}
|
||||
quality={100}
|
||||
/>
|
||||
<RefreshCcw
|
||||
className=" cursor-pointer"
|
||||
onClick={() => refetch()}
|
||||
color="#003778"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -12,33 +12,104 @@ import InspectorOperations from "./InspectorOperations";
|
|||
import { postComplaintTracking } from "@/utils/citizenApi";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
DialogClose,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogTrigger,
|
||||
} from "@/components/ui/dialog";
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
AlertDialogTrigger,
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import { Input } from "./ui/input";
|
||||
import { toast } from "sonner";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Triangle } from "react-loader-spinner";
|
||||
import { ArrowDownToLine, ArrowRight, File } from "lucide-react";
|
||||
export default function ComplainsDetails({
|
||||
id,
|
||||
role,
|
||||
Data,
|
||||
state,
|
||||
}: {
|
||||
id?: number;
|
||||
role: string;
|
||||
Data?: any;
|
||||
state?: string;
|
||||
}) {
|
||||
const [open, setOpen] = useState<boolean>(true);
|
||||
const [open, setOpen] = useState<boolean>(
|
||||
state == "FollowResult" ? false : true
|
||||
);
|
||||
const [password, setPassword] = useState<any>(true);
|
||||
const router = useRouter();
|
||||
const storeData = useData((state) => state.data);
|
||||
let data;
|
||||
|
||||
const openFileInNewTab = (base64Data: any, fileType: any) => {
|
||||
const blob = b64toBlob(base64Data, fileType);
|
||||
const blobUrl = URL.createObjectURL(blob);
|
||||
const newTab = window.open();
|
||||
if (newTab) {
|
||||
newTab.document.write(
|
||||
'<html style="height: 100%;"><head><title>File Preview</title></head><body style="margin: 0; padding: 0; height: 100%; overflow: hidden;">'
|
||||
);
|
||||
|
||||
// Check the file type and handle accordingly
|
||||
if (fileType.includes("image")) {
|
||||
newTab.document.write(
|
||||
`<img src="data:${fileType};base64,${base64Data}" alt="File Preview"/>`
|
||||
);
|
||||
} else if (fileType === "application/pdf") {
|
||||
newTab.document.write(
|
||||
`<iframe width="100%" height="100%" src="${blobUrl}"></iframe>`
|
||||
);
|
||||
} else {
|
||||
newTab.document.write(
|
||||
`<a href="${blobUrl}" target="_blank">Open in New Tab</a>`
|
||||
);
|
||||
}
|
||||
|
||||
newTab.document.write("</body></html>");
|
||||
newTab.document.close();
|
||||
|
||||
URL.revokeObjectURL(blobUrl);
|
||||
} else {
|
||||
console.error("Unable to open a new tab.");
|
||||
}
|
||||
};
|
||||
|
||||
const downloadFile = (base64Data: any, fileName: any, fileType: any) => {
|
||||
const blob = b64toBlob(base64Data, fileType);
|
||||
const blobUrl = URL.createObjectURL(blob);
|
||||
|
||||
const link = document.createElement("a");
|
||||
link.href = blobUrl;
|
||||
link.download = fileName;
|
||||
link.click();
|
||||
|
||||
URL.revokeObjectURL(blobUrl);
|
||||
};
|
||||
|
||||
const b64toBlob = (b64Data: any, contentType = "", sliceSize = 512) => {
|
||||
const byteCharacters = atob(b64Data);
|
||||
const byteArrays = [];
|
||||
|
||||
for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
|
||||
const slice = byteCharacters.slice(offset, offset + sliceSize);
|
||||
|
||||
const byteNumbers = new Array(slice.length);
|
||||
for (let i = 0; i < slice.length; i++) {
|
||||
byteNumbers[i] = slice.charCodeAt(i);
|
||||
}
|
||||
|
||||
const byteArray = new Uint8Array(byteNumbers);
|
||||
byteArrays.push(byteArray);
|
||||
}
|
||||
|
||||
return new Blob(byteArrays, { type: contentType });
|
||||
};
|
||||
|
||||
const getComplaintMutation = useMutation({
|
||||
mutationKey: ["Complaint", id],
|
||||
mutationFn: postComplaintTracking,
|
||||
|
|
@ -59,6 +130,9 @@ export default function ComplainsDetails({
|
|||
console.log(storeData);
|
||||
useEffect(() => {
|
||||
useData.persist.rehydrate();
|
||||
if (state == "FollowResult") {
|
||||
setOpen(false);
|
||||
}
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
// if (storeData && role == "Inspector") {
|
||||
|
|
@ -66,33 +140,37 @@ export default function ComplainsDetails({
|
|||
// }
|
||||
}, [storeData]);
|
||||
|
||||
if (getComplaintMutation.isSuccess) {
|
||||
if (getComplaintMutation.isSuccess && !Data) {
|
||||
data = getComplaintMutation.data;
|
||||
} else {
|
||||
data = Data;
|
||||
}
|
||||
if (open) {
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={setOpen}>
|
||||
<DialogContent dir="rtl" className="sm:max-w-[425px]">
|
||||
<DialogHeader dir="rtl">
|
||||
<DialogTitle dir="rtl">رمز عبور</DialogTitle>
|
||||
<DialogDescription>
|
||||
|
||||
return (
|
||||
<>
|
||||
<AlertDialog open={open} onOpenChange={setOpen}>
|
||||
<AlertDialogContent dir="rtl" className="">
|
||||
<AlertDialogHeader dir="rtl">
|
||||
<AlertDialogTitle dir="rtl">رمز عبور</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
برای مشاهده درخواست پسورد خود را وارد نمایید.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<div className="grid w-full max-w-sm items-center gap-1.5">
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<div className="grid items-center gap-1.5 w-full max-w-sm mx-auto">
|
||||
{/* <Label htmlFor="picture">Picture</Label> */}
|
||||
<Input
|
||||
dir="rtl"
|
||||
id="picture"
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
className=" bg-white hover:bg-white focus:bg-white"
|
||||
/>
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<AlertDialogFooter className=" gap-y-2 max-md:w-full max-md:flex max-md:flex-col">
|
||||
<Button
|
||||
onClick={() => router.push("/Account/Complaints")}
|
||||
type="button"
|
||||
variant="outline"
|
||||
className=" ml-2"
|
||||
className=" md:ml-2"
|
||||
>
|
||||
بازگشت
|
||||
</Button>
|
||||
|
|
@ -101,60 +179,149 @@ export default function ComplainsDetails({
|
|||
تایید
|
||||
</Button>
|
||||
{/* </DialogClose> */}
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
{data ? (
|
||||
<div className=" w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] flex max-lg:flex-col gap-3 items-start mt-5">
|
||||
<div className="flex flex-col w-full lg:w-1/3 lg:order-2 gap-3 lg:sticky top-40">
|
||||
<div className=" bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col">
|
||||
<p className="text-[#464646] text-base font-bold">گزارش شکایت</p>
|
||||
<div className="mt-2">
|
||||
<p className="text-[#2e2a2a] text-sm font-medium">
|
||||
موضوع شکایت:{" "}
|
||||
<span className="text-[#7C838A] text-sm font-medium">
|
||||
{data.title}
|
||||
</span>
|
||||
<>
|
||||
{state !== "FollowResult" && (
|
||||
<button
|
||||
onClick={() => router.push("/Account/Complaints")}
|
||||
className=" my-2 flex gap-1 cursor-pointer text-blue "
|
||||
>
|
||||
<span>
|
||||
<ArrowRight />
|
||||
</span>
|
||||
<p>بازگشت</p>
|
||||
</button>
|
||||
)}
|
||||
|
||||
<div className="flex max-lg:flex-col gap-3 items-start">
|
||||
<div className="flex flex-col w-full lg:w-1/3 lg:order-2 gap-3 lg:sticky top-40">
|
||||
<div className=" bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col">
|
||||
<p className="text-[#464646] text-base font-bold">
|
||||
گزارش شکایت
|
||||
</p>
|
||||
<p className="text-[#464646] text-sm font-medium">
|
||||
دستگاه مربوطه:{" "}
|
||||
<span className="text-[#7C838A] text-sm font-medium">
|
||||
{data?.complaintOrganization
|
||||
? data?.complaintOrganization.title
|
||||
: "-"}
|
||||
</span>
|
||||
</p>
|
||||
<p className="text-[#464646] text-sm font-medium">
|
||||
پرسنل مربوطه:{" "}
|
||||
<span className="text-[#7C838A] text-sm font-medium">
|
||||
{/* {data.title} */}
|
||||
</span>
|
||||
</p>
|
||||
<p className="text-[#464646] text-sm font-medium">
|
||||
زمان ثبت:{" "}
|
||||
<span className="text-[#7C838A] text-sm font-medium">
|
||||
{convertDate(data.registeredAt)}
|
||||
</span>
|
||||
</p>
|
||||
{/* <p className="text-[#464646] text-sm font-medium">
|
||||
<div className="mt-2">
|
||||
<p className="text-[#2e2a2a] text-sm font-medium">
|
||||
موضوع شکایت:{" "}
|
||||
<span className="text-[#7C838A] text-sm font-medium">
|
||||
{data.title}
|
||||
</span>
|
||||
</p>
|
||||
<p className="text-[#464646] text-sm font-medium">
|
||||
دستگاه مربوطه:{" "}
|
||||
<span className="text-[#7C838A] text-sm font-medium">
|
||||
{data?.complaintOrganization
|
||||
? data?.complaintOrganization.title
|
||||
: "-"}
|
||||
</span>
|
||||
</p>
|
||||
<p className="text-[#464646] text-sm font-medium">
|
||||
پرسنل مربوطه:{" "}
|
||||
<span className="text-[#7C838A] text-sm font-medium">
|
||||
{data.complaining ? data.complaining : "-"}
|
||||
</span>
|
||||
</p>
|
||||
<p className="text-[#464646] text-sm font-medium">
|
||||
زمان ثبت:{" "}
|
||||
<span className="text-[#7C838A] text-sm font-medium">
|
||||
{convertDate(data.registeredAt)}
|
||||
</span>
|
||||
</p>
|
||||
{/* <p className="text-[#464646] text-sm font-medium">
|
||||
{" "}
|
||||
موضوع شکایت:{" "}
|
||||
<span className="text-[#7C838A] text-sm font-medium">
|
||||
متن تستی
|
||||
</span>
|
||||
</p> */}
|
||||
</div>
|
||||
{/* <p className="text-[#464646] text-sm font-medium text-justify">
|
||||
</div>
|
||||
{/* <p className="text-[#464646] text-sm font-medium text-justify">
|
||||
درخواست شما با کد رهگیری {data.trackingNumber} و رمز عبور 12422 در
|
||||
دست بررسی و اقدام می باشد. در صورت تمایل می توانید با شماره تلفن
|
||||
0353286545 جهت پشتیبانی تماس حاصل کنید.{" "}
|
||||
</p> */}
|
||||
</div>
|
||||
<div className=" max-lg:hidden order-2 bg-[#E9E9E9] rounded-md p-4 px-10 flex flex-col">
|
||||
<p className="text-[#464646] text-base font-bold mb-1">
|
||||
انجام عملیات
|
||||
</p>
|
||||
<InspectorOperations
|
||||
updateData={() => getComplaintMutation.mutate(storeData)}
|
||||
role={role}
|
||||
complaintData={data}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" max-lg:hidden order-2 bg-[#E9E9E9] rounded-md p-4 px-10 flex flex-col">
|
||||
<div className="w-full lg:w-2/3 self-stretch bg-[#E9E9E9] p-4 px-10 rounded-lg">
|
||||
<p className="text-[#464646] text-base font-bold">روند شکایت</p>
|
||||
<div className=" flex flex-col gap-y-4 mt-4">
|
||||
{data.contents?.map((item: any) => {
|
||||
return (
|
||||
<div
|
||||
key={item.id}
|
||||
className=" bg-white p-4 rounded-lg shadow-md"
|
||||
>
|
||||
<div className=" flex gap-4 items-center">
|
||||
<p className="">
|
||||
<Badge>{item.sender == 0 ? "شهروند" : "بازرس"}</Badge>
|
||||
</p>
|
||||
<p className="">
|
||||
تاریخ :
|
||||
<span className="text-[#7C838A]">
|
||||
{convertDate(item.dateTime)}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<div className=" text-[#464646] mt-2">
|
||||
<span className="text-[#7C838A]">
|
||||
{item.text ? item.text : "-"}
|
||||
</span>
|
||||
</div>
|
||||
{/* {item.media.length !== 0 && (
|
||||
<Separator className=" mt-2 mb-1" />
|
||||
)} */}
|
||||
<div className=" text-[#464646] mt-2">
|
||||
<div className=" flex flex-wrap max-md:flex-col w-full items-center gap-2 text-xs mt-2">
|
||||
{item?.media.map((item: any, index: number) => {
|
||||
return (
|
||||
<div
|
||||
key={index}
|
||||
className=" bg-gray-100 text-[#7C838A] w-full md:w-[30%] rounded-md h-12 p-2 flex justify-between gap-3 items-center"
|
||||
>
|
||||
<a
|
||||
onClick={() =>
|
||||
openFileInNewTab(item.data, item.mimeType)
|
||||
}
|
||||
className=" cursor-pointer flex gap-2 truncate items-center"
|
||||
>
|
||||
<File className=" w-6 h-6" />
|
||||
<p className=" max-w-[5rem] truncate">
|
||||
{item.title}
|
||||
</p>
|
||||
</a>
|
||||
<ArrowDownToLine
|
||||
className=" cursor-pointer"
|
||||
onClick={() =>
|
||||
downloadFile(
|
||||
item.data,
|
||||
item.title,
|
||||
item.mimeType
|
||||
)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
<div className=" lg:hidden order-2 w-full bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col">
|
||||
<p className="text-[#464646] text-base font-bold mb-1">
|
||||
انجام عملیات
|
||||
</p>
|
||||
|
|
@ -164,50 +331,8 @@ export default function ComplainsDetails({
|
|||
complaintData={data}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full lg:w-2/3 self-stretch bg-[#E9E9E9] p-4 px-10 rounded-lg">
|
||||
<p className="text-[#464646] text-base font-bold">روند شکایت</p>
|
||||
<div className=" flex flex-col gap-y-4 mt-4">
|
||||
{data.contents?.map((item: any) => {
|
||||
return (
|
||||
<div
|
||||
key={item.id}
|
||||
className=" bg-white p-4 rounded-lg shadow-md"
|
||||
>
|
||||
<div className=" flex gap-4 items-center">
|
||||
<p className="">
|
||||
<Badge>{item.sender == 0 ? "شهروند" : "بازرس"}</Badge>
|
||||
</p>
|
||||
<p className="">
|
||||
تاریخ :
|
||||
<span className="text-[#7C838A]">
|
||||
{convertDate(item.dateTime)}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<div className=" text-[#464646] mt-2">
|
||||
متن:{" "}
|
||||
<span className="text-[#7C838A]">
|
||||
{item.text ? item.text : "-"}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
<div className=" lg:hidden order-2 w-full bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col">
|
||||
<p className="text-[#464646] text-base font-bold mb-1">
|
||||
انجام عملیات
|
||||
</p>
|
||||
<InspectorOperations
|
||||
updateData={() => getComplaintMutation.mutate(storeData)}
|
||||
role={role}
|
||||
complaintData={data}
|
||||
/>
|
||||
</div>
|
||||
{/* Left */}
|
||||
{/* <div className="w-full md:w-1/3 bg-white shadow-lg rounded-md pt-3 px-4 flex flex-row md:flex-col max-md:flex-wrap">
|
||||
{/* Left */}
|
||||
{/* <div className="w-full md:w-1/3 bg-white shadow-lg rounded-md pt-3 px-4 flex flex-row md:flex-col max-md:flex-wrap">
|
||||
<p className="text-[#464646] text-base font-bold mb-3">
|
||||
وضعیت درخواست
|
||||
</p>
|
||||
|
|
@ -245,9 +370,24 @@ export default function ComplainsDetails({
|
|||
);
|
||||
})}
|
||||
</div> */}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
""
|
||||
<>
|
||||
{getComplaintMutation.isPending && (
|
||||
<div className="w-full h-full flex justify-center mt-20">
|
||||
<Triangle
|
||||
visible={true}
|
||||
height="100"
|
||||
width="100"
|
||||
color="#003778"
|
||||
ariaLabel="triangle-loading"
|
||||
wrapperStyle={{}}
|
||||
wrapperClass=""
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -87,18 +87,6 @@ export default function FollowResult() {
|
|||
return (
|
||||
<>
|
||||
<div className="w-[90vw] sm:w-[90vw] lg:w-[85vw] xl:w-[75vw] 3xl:w-[70vw] max-sm:mt-16 pt-4 mx-auto mb-10">
|
||||
{/* <div className="h-full flex flex-col justify-center"> */}
|
||||
{/* <p
|
||||
className="text-sm font-medium leading-6 tracking-wide text-[#7C838A] dark:text-white
|
||||
3xl:text-base 3xl:font-bold"
|
||||
>
|
||||
درخواست شما با کد رهگیری
|
||||
<span className="text-slate-500 mx-2">{`${trackingNumber}`}</span>و
|
||||
رمز عبور
|
||||
<span className="text-slate-500 mx-2">{`${password}`}</span>
|
||||
در دست بررسی و اقدام می باشد. در صورت تمایل می توانید با شماره تلفن
|
||||
0353286545 جهت پشتیبانی تماس حاصل کنید.
|
||||
</p> */}
|
||||
{complaintPrintMutation?.data ? (
|
||||
<>
|
||||
<div className="flex justify-center sm:justify-end gap-2 mb-2">
|
||||
|
|
@ -195,7 +183,8 @@ export default function FollowResult() {
|
|||
</div>
|
||||
<ComplainsDetails
|
||||
role="Citizen"
|
||||
// Data={complaintPrintMutation?.data}
|
||||
state="FollowResult"
|
||||
Data={complaintPrintMutation?.data}
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
|
|
|
|||
|
|
@ -52,11 +52,6 @@ export default function InspectorOperations({
|
|||
.max(260, {
|
||||
message: "Bio must not be longer than 30 characters.",
|
||||
}),
|
||||
...(role == "Inspector" && {
|
||||
type: z.enum(["private", "public"], {
|
||||
required_error: "لطفا وضعیت عملیات را انتخاب نمایید.",
|
||||
}),
|
||||
}),
|
||||
operation: z.string({
|
||||
required_error: "Please select an email to display.",
|
||||
}),
|
||||
|
|
@ -213,6 +208,7 @@ export default function InspectorOperations({
|
|||
<SelectTrigger
|
||||
className=" bg-white h-10 !placeholder:text-xs text-xs"
|
||||
dir="rtl"
|
||||
disabled={possibleOperations.length == 0}
|
||||
>
|
||||
<SelectValue
|
||||
className=" text-xs"
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import { useRouter } from "next/navigation";
|
|||
import { Oval, ThreeDots } from "react-loader-spinner";
|
||||
import useData from "@/store/useData";
|
||||
import useToken from "@/store/useToken";
|
||||
import { RefreshCcw } from "lucide-react";
|
||||
const FormSchema = z.object({
|
||||
username: z.string().min(1, {
|
||||
message: "لطفا نام کاربری را وارد نمایید.",
|
||||
|
|
@ -183,7 +184,7 @@ export default function Login() {
|
|||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className=" flex justify-center text-center">
|
||||
<div className=" flex justify-center text-center gap-2">
|
||||
<Image
|
||||
alt="icon"
|
||||
src={srcForImage as string}
|
||||
|
|
@ -192,6 +193,11 @@ export default function Login() {
|
|||
height={20}
|
||||
quality={100}
|
||||
/>
|
||||
<RefreshCcw
|
||||
className=" cursor-pointer"
|
||||
onClick={() => refetch()}
|
||||
color="#003778"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -13,25 +13,82 @@ import { isAuthorized } from "@/lib/utils";
|
|||
import useToken from "@/store/useToken";
|
||||
import { DropdownMenu } from "@radix-ui/react-dropdown-menu";
|
||||
import ProfileDropDown from "./ProfileDropDown";
|
||||
|
||||
import { getCookie } from "cookies-next";
|
||||
import Hamburger from "hamburger-react";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
export default function Navbar() {
|
||||
const pathname = usePathname();
|
||||
const isAuth = useToken((state) => state.token);
|
||||
const [auth, setAuth] = useState<boolean>(isAuth);
|
||||
const [auth, setAuth] = useState<boolean>();
|
||||
const [isOpen, setOpen] = useState<boolean>(false);
|
||||
const token = getCookie("Sootzani_Token");
|
||||
useEffect(() => {
|
||||
useToken.persist.rehydrate();
|
||||
setAuth(isAuth);
|
||||
}, [isAuth]);
|
||||
const token = getCookie("Sootzani_Token");
|
||||
if (token) {
|
||||
setAuth(true);
|
||||
} else {
|
||||
setAuth(false);
|
||||
}
|
||||
}, [isAuth ,token]);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`max-md:hidden left-0 right-0 top-0 z-10 ${
|
||||
pathname === "/" ? "absolute" : "sticky"
|
||||
}`}
|
||||
>
|
||||
<TopNav />
|
||||
<div className=" bg-white h-16 shadow-md flex items-center justify-between py-2 px-8">
|
||||
<div className={` left-0 right-0 top-0 z-20 fixed`}>
|
||||
{/* <TopNav /> */}
|
||||
<div className=" bg-white h-16 shadow-md flex items-center justify-between py-2 px-6">
|
||||
<div className=" flex ">
|
||||
<div className=" flex items-center ">
|
||||
<div className=" md:hidden -mr-4">
|
||||
<Hamburger
|
||||
toggled={isOpen}
|
||||
size={20}
|
||||
toggle={setOpen}
|
||||
direction="right"
|
||||
/>
|
||||
<AnimatePresence>
|
||||
{isOpen && (
|
||||
<motion.div
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={{ opacity: 0 }}
|
||||
transition={{ duration: 0.2 }}
|
||||
className="fixed z-[100] left-0 shadow-4xl right-0 top-[4rem] p-5 bg-white border-b-2 shadow-md"
|
||||
>
|
||||
<ul className="grid gap-2 ">
|
||||
{menuItems.map((item, idx, array) => {
|
||||
// const { Icon } = item;
|
||||
const lastItem = array.length - 1;
|
||||
return (
|
||||
<motion.li
|
||||
initial={{ scale: 0, opacity: 0 }}
|
||||
animate={{ scale: 1, opacity: 1 }}
|
||||
transition={{
|
||||
type: "spring",
|
||||
stiffness: 260,
|
||||
damping: 20,
|
||||
delay: 0.1 + idx / 10,
|
||||
}}
|
||||
key={item.name}
|
||||
className=" w-full p-[0.08rem] rounded-xl bg-gradient-to-tr from-neutral-800 via-white to-neutral-700"
|
||||
>
|
||||
<Link
|
||||
onClick={() => setOpen((prev) => !prev)}
|
||||
className={`flex items-center justify-between w-full p-3 rounded-xl text-white
|
||||
${lastItem === idx ? "bg-yellow" : "bg-blue"} `}
|
||||
href={item.href}
|
||||
>
|
||||
<span className="flex gap-1 text-sm">
|
||||
{item.name}
|
||||
</span>
|
||||
{/* <Icon className="text-xl" /> */}
|
||||
</Link>
|
||||
</motion.li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
</motion.div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
<div className=" flex items-center max-md:mr-1 ">
|
||||
<Image
|
||||
src="/img/logo.png"
|
||||
quality={100}
|
||||
|
|
@ -41,10 +98,10 @@ export default function Navbar() {
|
|||
/>
|
||||
<div className=" text-brown flex flex-col text-center w-40">
|
||||
<h1 className="text-[23px] w-full">عیــون</h1>
|
||||
<h1 className="text-[9px]">سامانه افشار فساد شهرداری</h1>
|
||||
<h1 className="text-[9px]">سامانه افشای فساد شهرداری</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" flex gap-5 items-center mr-8">
|
||||
<div className=" flex gap-5 items-center mr-8 max-md:hidden">
|
||||
{menuItems.map((item, index, array) => {
|
||||
if (array.length - 1 !== index) {
|
||||
return (
|
||||
|
|
@ -66,7 +123,7 @@ export default function Navbar() {
|
|||
onClick={() =>
|
||||
localStorage.setItem("Sootzani_Login_State", "true")
|
||||
}
|
||||
className=" bg-blue hover:bg-blue/90 rounded-lg"
|
||||
className=" bg-blue hover:bg-blue/90 rounded-lg max-sm:text-xs"
|
||||
>
|
||||
ورود به پنل کاربری
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,175 @@
|
|||
"use client";
|
||||
import React, { useEffect } from "react";
|
||||
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useForm } from "react-hook-form";
|
||||
import * as z from "zod";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
FormDescription,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { toast } from "@/components/ui/use-toast";
|
||||
import Link from "next/link";
|
||||
import RequestStep2 from "./RequestStep2";
|
||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import { editProfile, getProfile } from "@/utils/authenticateApi";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
const FormSchema = z.object({
|
||||
firstName: z.string().min(1, {
|
||||
message: "لطفا نام خود را وارد نمایید.",
|
||||
}),
|
||||
lastName: z.string().min(1, {
|
||||
message: "لطفا نام خانوادگی خود را وارد نمایید.",
|
||||
}),
|
||||
nationalId: z
|
||||
.string()
|
||||
.length(10, { message: "کد ملی معتبر نمی باشد." })
|
||||
.transform((value) => {
|
||||
const parsedNumber = Number(value);
|
||||
if (Number.isNaN(parsedNumber)) {
|
||||
throw new Error("کد ملی معتبر نمی باشد.");
|
||||
} else if (
|
||||
Number(parsedNumber) > 100000000 &&
|
||||
Number(parsedNumber) < 999999999
|
||||
) {
|
||||
throw new Error("کد ملی معتبر نمی باشد.");
|
||||
}
|
||||
return parsedNumber;
|
||||
}),
|
||||
});
|
||||
|
||||
export default function Profile() {
|
||||
const router = useRouter();
|
||||
const {
|
||||
data: profileData,
|
||||
isLoading,
|
||||
refetch,
|
||||
} = useQuery({
|
||||
queryKey: ["Profile"],
|
||||
queryFn: () => getProfile(),
|
||||
refetchOnWindowFocus: false,
|
||||
});
|
||||
|
||||
const editProfileMutation = useMutation({
|
||||
mutationKey: ["editProfile"],
|
||||
mutationFn: editProfile,
|
||||
onSuccess: (res) => {
|
||||
router.push("/RequestStep2");
|
||||
localStorage.setItem("authorized", "true");
|
||||
},
|
||||
onError: (error) => {},
|
||||
});
|
||||
|
||||
const form = useForm<z.infer<typeof FormSchema>>({
|
||||
resolver: zodResolver(FormSchema),
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (profileData) {
|
||||
form.setValue("firstName", profileData.firstName);
|
||||
form.setValue("lastName", profileData.lastName);
|
||||
form.setValue("nationalId", profileData.nationalId);
|
||||
}
|
||||
}, [profileData]);
|
||||
|
||||
console.log(form.getValues());
|
||||
function onSubmit(data: z.infer<typeof FormSchema>) {
|
||||
// toast({
|
||||
// title: "You submitted the following values:",
|
||||
// description: (
|
||||
// <pre className="mt-2 w-[340px] rounded-md bg-slate-950 p-4">
|
||||
// <code className="text-white">{JSON.stringify(data, null, 2)}</code>
|
||||
// </pre>
|
||||
// ),
|
||||
// });
|
||||
const strNationalId = String(data.nationalId);
|
||||
const payload = { ...data, nationalId: strNationalId };
|
||||
console.log(data);
|
||||
editProfileMutation.mutate(payload);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="w-full h-full sm:w-2/3 md:w-2/4 max-sm:p-8 pt-12">
|
||||
<div className="space-y-4 md:space-y-4 h-full flex flex-col justify-center">
|
||||
{profileData && (
|
||||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="w-full flex flex-col mt-6 "
|
||||
>
|
||||
<div className="flex flex-row flex-wrap justify-between">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="firstName"
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full sm:w-[48%]">
|
||||
<FormLabel className="text-[#7C838A] text-sm font-medium">
|
||||
نام
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="نام خود را وارد نمایید"
|
||||
{...field}
|
||||
readOnly={true}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="lastName"
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full sm:w-[48%] ">
|
||||
<FormLabel className="text-[#7C838A] text-sm font-medium">
|
||||
نام خانوادگی
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="نام خانوادگی خود را وارد نمایید"
|
||||
{...field}
|
||||
readOnly={true}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="nationalId"
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full sm:w-[48%]">
|
||||
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7">
|
||||
کد ملی
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="text"
|
||||
placeholder="کد ملی خود را وارد نمایید "
|
||||
{...field}
|
||||
readOnly={true}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -58,13 +58,13 @@ export default function ProfileDropDown() {
|
|||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent className="w-56 sm:ml-10">
|
||||
<DropdownMenuGroup>
|
||||
<DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => router.push("/Account/Profile")}>
|
||||
<User className="ml-2 h-4 w-4" />
|
||||
<span>مشاهده پروفایل</span>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => router.push("/Account/Complaints")}>
|
||||
<CreditCard className="ml-2 h-4 w-4" />
|
||||
<span>درخواست های اخیر</span>
|
||||
<span>درخواست های من</span>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
<DropdownMenuSeparator />
|
||||
|
|
@ -72,7 +72,7 @@ export default function ProfileDropDown() {
|
|||
onClick={() => {
|
||||
saveToken(false);
|
||||
deleteCookie("Sootzani_Token");
|
||||
router.replace("/");
|
||||
router.push("/");
|
||||
}}
|
||||
>
|
||||
<LogOut className="ml-2 h-4 w-4" />
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
"use client";
|
||||
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import Image from "next/image";
|
||||
import Resultimg from "../public/img/result.png";
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Button } from "./ui/button";
|
||||
import { useReactToPrint } from "react-to-print";
|
||||
|
||||
export default function Result() {
|
||||
const [trackingNumber, setTrackingNumber] = useState<any>();
|
||||
const [password, setPassword] = useState<any>();
|
||||
|
||||
const componentRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const router = useRouter();
|
||||
useEffect(() => {
|
||||
const tn = localStorage.getItem("trackingNumber");
|
||||
|
|
@ -19,6 +21,15 @@ export default function Result() {
|
|||
setPassword(pw);
|
||||
}, []);
|
||||
|
||||
const handlePrint = useReactToPrint({
|
||||
content: () => componentRef.current,
|
||||
// onBeforePrint() {
|
||||
// setPrintStyle(!printStyle);
|
||||
// },
|
||||
// onAfterPrint() {
|
||||
// setPrintStyle(!printStyle)
|
||||
// },
|
||||
});
|
||||
return (
|
||||
<div className="w-full h-full sm:w-2/3 md:w-3/4 lg:w-1/2 max-sm:p-8 pt-12 ">
|
||||
<div className="h-full flex flex-col justify-center">
|
||||
|
|
@ -40,12 +51,23 @@ export default function Result() {
|
|||
در سامانه عیون ثبت شده و شما می توانید نتیجه درخواست خود را از صفحه
|
||||
پیگیری درخواست، با استفاده از کد رهگیری و رمز عبور مشاهده کنید.
|
||||
</p>
|
||||
{/* <div className=" w-full flex justify-end mt-2">
|
||||
<Button
|
||||
variant="outline"
|
||||
type="submit"
|
||||
onClick={handlePrint}
|
||||
className="w-fit bg-blue text-white p-2 rounded-xl text-center"
|
||||
>
|
||||
پرینت درخواست
|
||||
</Button>
|
||||
</div> */}
|
||||
<Image
|
||||
alt="icon"
|
||||
src={Resultimg}
|
||||
className="self-center w-3/5 mt-5 sm:w-[23em] sm:h-[20em] 3xl:w-3/5 3xl:h-[30em] object-contain"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,10 +105,6 @@ export default function RequestStep1() {
|
|||
<p className="text-sm md:text-base font-bold leading-tight tracking-tight text-blue dark:text-white">
|
||||
لطفا جهت ارسال درخواست فرم زیر را تکمیل نمایید.
|
||||
</p>
|
||||
{/* <p className="text-sm md:text-base font-bold leading-tight tracking-tight text-red-500 dark:text-white">
|
||||
در صورت عدم تمایل به ثبت مشخصات شخصی می توانید به صفحه ی بعد مراجعه
|
||||
کنید.
|
||||
</p> */}
|
||||
{profileData && (
|
||||
<Form {...form}>
|
||||
<form
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import {
|
|||
} from "@/components/ui/select";
|
||||
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { toast } from "@/components/ui/use-toast";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import Link from "next/link";
|
||||
|
|
@ -44,6 +43,8 @@ import { useRouter } from "next/navigation";
|
|||
import { getCaptcha, getCategory, getOrganizations } from "@/utils/commonApi";
|
||||
import { ThreeDots } from "react-loader-spinner";
|
||||
import useToken from "@/store/useToken";
|
||||
import { toast } from "sonner";
|
||||
import { RefreshCcw } from "lucide-react";
|
||||
|
||||
const MAX_IMAGE_SIZE = 5242880; // 5 MB
|
||||
const ALLOWED_IMAGE_TYPES = [
|
||||
|
|
@ -89,7 +90,7 @@ const FormSchema = z.object({
|
|||
required_error: "لطفا دسته بندی را انتخاب نمایید.",
|
||||
}),
|
||||
captchaValue: z.string().min(1, {
|
||||
message: "لطفا کد امنیتی را وارد نمایید.ئ",
|
||||
message: "لطفا کد امنیتی را وارد نمایید.",
|
||||
}),
|
||||
});
|
||||
|
||||
|
|
@ -116,7 +117,9 @@ export default function RequestStep2() {
|
|||
localStorage.setItem("password", res.password);
|
||||
router.push("/RequestResult");
|
||||
},
|
||||
onError: (error) => {},
|
||||
onError: (error) => { toast("مشکلی در ارسال درخواست به وجود آمد.", {
|
||||
className: "!bg-red-500 !text-white",
|
||||
});},
|
||||
});
|
||||
|
||||
const authorizedComplaintSubmitMutation = useMutation({
|
||||
|
|
@ -125,10 +128,15 @@ export default function RequestStep2() {
|
|||
onSuccess: (res) => {
|
||||
localStorage.setItem("trackingNumber", res.trackingNumber);
|
||||
localStorage.setItem("password", res.password);
|
||||
localStorage.setItem("registeredAt", res.registeredAt);
|
||||
localStorage.removeItem("authorized");
|
||||
router.push("/RequestResult");
|
||||
},
|
||||
onError: (error) => {},
|
||||
onError: (error) => {
|
||||
toast("مشکلی در ارسال درخواست به وجود آمد.", {
|
||||
className: "!bg-red-500 !text-white",
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
// All Category
|
||||
|
|
@ -418,7 +426,7 @@ export default function RequestStep2() {
|
|||
control={form.control}
|
||||
name="captchaValue"
|
||||
render={({ field }) => (
|
||||
<FormItem className="w-full ">
|
||||
<FormItem className="w-1/2 ">
|
||||
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7">
|
||||
*کد امنیتی
|
||||
</FormLabel>
|
||||
|
|
@ -434,7 +442,7 @@ export default function RequestStep2() {
|
|||
/>
|
||||
|
||||
{isLoading ? (
|
||||
<div className=" w-2/3 max-w[11rem] flex justify-center text-center">
|
||||
<div className=" w-1/2 max-w[11rem] flex justify-center text-center">
|
||||
<ThreeDots
|
||||
visible={true}
|
||||
height="50"
|
||||
|
|
@ -447,7 +455,7 @@ export default function RequestStep2() {
|
|||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className=" w-2/3 max-w[11rem] flex justify-end text-center">
|
||||
<div className=" w-1/2 max-w[11rem] flex justify-center items-center text-center gap-2">
|
||||
<Image
|
||||
alt="icon"
|
||||
src={srcForImage as string}
|
||||
|
|
@ -456,6 +464,11 @@ export default function RequestStep2() {
|
|||
height={20}
|
||||
quality={100}
|
||||
/>
|
||||
<RefreshCcw
|
||||
className=" cursor-pointer"
|
||||
onClick={() => refetch()}
|
||||
color="#003778"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ export default function TabController() {
|
|||
const finishedComplaints = data?.filter((item: any) => item.status == 4);
|
||||
console.log(newComplaints);
|
||||
return (
|
||||
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-8 pt-9">
|
||||
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-16 pt-9">
|
||||
<Dialog>
|
||||
{/* <DialogTrigger className=" appearance-none" asChild>
|
||||
<Button
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ export default function TableController({
|
|||
<TableRow>
|
||||
<TableHead>ردیف</TableHead>
|
||||
<TableHead>تاریخ</TableHead>
|
||||
<TableHead>کد پیگیری</TableHead>
|
||||
<TableHead>موضوع</TableHead>
|
||||
<TableHead>دستگاه مربوطه</TableHead>
|
||||
</TableRow>
|
||||
|
|
@ -118,10 +119,11 @@ export default function TableController({
|
|||
<TableCell className="w-2/12">
|
||||
{convertDate(item.registeredAt)}
|
||||
</TableCell>
|
||||
<TableCell className="w-2/12">{item.trackingNumber}</TableCell>
|
||||
<TableCell className="w-2/12">
|
||||
{item?.title ? item.title : "-"}
|
||||
</TableCell>
|
||||
<TableCell className="w-7/12">
|
||||
<TableCell className="w-5/12">
|
||||
{item?.complaintOrganization
|
||||
? item?.complaintOrganization.title
|
||||
: "-"}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { JwtPayload, jwtDecode } from "jwt-decode";
|
|||
import { setCookie } from "cookies-next";
|
||||
import { Oval } from "react-loader-spinner";
|
||||
import useToken from "@/store/useToken";
|
||||
import { toast } from "sonner";
|
||||
|
||||
export default function Verify() {
|
||||
const [otp, setOtp] = useState("");
|
||||
|
|
@ -59,7 +60,11 @@ export default function Verify() {
|
|||
router.push("/RequestStep1");
|
||||
}
|
||||
},
|
||||
onError: (err: any) => {},
|
||||
onError: (err: any) => {
|
||||
toast("کد تایید شما صحیح نمیباشد.", {
|
||||
className: "!bg-red-500 !text-white",
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const handelVerify = () => {
|
||||
|
|
@ -73,9 +78,16 @@ export default function Verify() {
|
|||
useData.persist.rehydrate();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (otp.length == 6) {
|
||||
const payload = { ...userData, verificationCode: otp };
|
||||
console.log(userData);
|
||||
CitizenVerifyMutation.mutate(payload);
|
||||
}
|
||||
}, [otp]);
|
||||
return (
|
||||
<div
|
||||
className="w-full my-12 sm:w-2/3 md:w-2/4 xl:w-1/3 bg-white rounded-lg dark:border xl:p-0 dark:bg-gray-800 dark:border-gray-700 shadow-[0px_0px_15px_0px_#00000040]
|
||||
className="w-full mt-28 sm:w-2/3 md:w-2/4 xl:w-1/3 bg-white rounded-lg dark:border xl:p-0 dark:bg-gray-800 dark:border-gray-700 shadow-[0px_0px_15px_0px_#00000040]
|
||||
h-full max-md:p-8 pt-12"
|
||||
>
|
||||
<div className="space-y-3 md:space-y-4 flex flex-col md:py-12 md:px-20 h-full justify-center">
|
||||
|
|
@ -90,11 +102,7 @@ export default function Verify() {
|
|||
numInputs={6}
|
||||
renderSeparator={<span>{space}</span>}
|
||||
renderInput={(props, idx) => (
|
||||
<input
|
||||
autoFocus={idx == 0}
|
||||
pattern="[0-9]*"
|
||||
{...props}
|
||||
/>
|
||||
<input autoFocus={idx == 0} pattern="[0-9]*" {...props} />
|
||||
)}
|
||||
containerStyle=" flex justify-center"
|
||||
inputStyle=" !w-10 rounded-md h-10 bg-[#F5F5F5] border border-blue/30 text-black"
|
||||
|
|
@ -105,7 +113,7 @@ export default function Verify() {
|
|||
کد دریافت شده توسط پیامک را وارد نمایید.
|
||||
</span>
|
||||
</label>
|
||||
<div className="flex justify-end gap-2 w-full mt-14">
|
||||
{/* <div className="flex justify-end gap-2 w-full mt-14">
|
||||
<Button
|
||||
disabled={CitizenVerifyMutation.isPending}
|
||||
onClick={handelVerify}
|
||||
|
|
@ -123,13 +131,12 @@ export default function Verify() {
|
|||
wrapperStyle={{}}
|
||||
wrapperClass=""
|
||||
/>
|
||||
{/* <p>در حال انجام ...</p> */}
|
||||
</div>
|
||||
) : (
|
||||
"تایید"
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</div> */}
|
||||
{/* <Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
|
|
|
|||
|
|
@ -36,11 +36,10 @@ const AlertDialogContent = React.forwardRef<
|
|||
<AlertDialogPrimitive.Content
|
||||
ref={ref}
|
||||
className={cn(
|
||||
`fixed left-[50%] top-[50%] z-50 grid w-full max-w-4xl translate-x-[-50%] translate-y-[-50%] gap-4 border duration-200
|
||||
`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border duration-200
|
||||
data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95
|
||||
data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2
|
||||
data-[state=open]:slide-in-from-top-[48%] rounded-lg
|
||||
h-full max-h-[32em] content-between p-0 bg-opacity-30 bg-[#FFFFF999] filter
|
||||
data-[state=open]:slide-in-from-top-[48%] rounded-lg content-between p-0 bg-opacity-30 bg-[#FFFFF999] filter
|
||||
shadow-[0px_0px_30px_0px_rgba(0,0,0,0.3)]
|
||||
`,
|
||||
className
|
||||
|
|
@ -48,7 +47,7 @@ const AlertDialogContent = React.forwardRef<
|
|||
{...props}
|
||||
/>
|
||||
</AlertDialogPortal>
|
||||
))
|
||||
));
|
||||
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
|
||||
|
||||
const AlertDialogHeader = ({
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
"use client"
|
||||
|
||||
import * as React from "react"
|
||||
import * as SeparatorPrimitive from "@radix-ui/react-separator"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
const Separator = React.forwardRef<
|
||||
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
||||
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
||||
>(
|
||||
(
|
||||
{ className, orientation = "horizontal", decorative = true, ...props },
|
||||
ref
|
||||
) => (
|
||||
<SeparatorPrimitive.Root
|
||||
ref={ref}
|
||||
decorative={decorative}
|
||||
orientation={orientation}
|
||||
className={cn(
|
||||
"shrink-0 bg-border",
|
||||
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
)
|
||||
Separator.displayName = SeparatorPrimitive.Root.displayName
|
||||
|
||||
export { Separator }
|
||||
|
|
@ -8,7 +8,7 @@ export const menuItems = [
|
|||
{ id: 2, name: "اخبار", href: "/" },
|
||||
{ id: 3, name: "درباره ما", href: "/" },
|
||||
{ id: 4, name: "تماس با ما", href: "/CallUs" },
|
||||
{ id: 5, name: "پیگیری", href: "/" },
|
||||
{ id: 5, name: "پیگیری", href: "/FollowUp" },
|
||||
{ id: 6, name: "ورود به پنل کاربری", href: "/Login" },
|
||||
];
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ export const sliderItems = [
|
|||
export const boxItems = [
|
||||
{
|
||||
id: 1,
|
||||
name: "ثبت شکایت",
|
||||
name: "ثبت شکایت(ناشناس)",
|
||||
icon: "/img/box1.svg",
|
||||
icon2: "/img/box1-hover.svg",
|
||||
description: "ارسال درخواست نارضایتی از پرسنل",
|
||||
|
|
@ -29,20 +29,20 @@ export const boxItems = [
|
|||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "ثبت شکایت",
|
||||
icon: "/img/box1.svg",
|
||||
icon2: "/img/box1-hover.svg",
|
||||
description: "ارسال درخواست نارضایتی از پرسنل",
|
||||
link: "/CitizenLogin",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "پیگیری شکایت",
|
||||
icon: "/img/box2.svg",
|
||||
icon2: "/img/box2-hover.svg",
|
||||
description: "پیگیری درخواست ارسال شده",
|
||||
link: "/FollowUp",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "ثبت شکایت(شناس)",
|
||||
icon: "/img/box1.svg",
|
||||
icon2: "/img/box1-hover.svg",
|
||||
description: "ارسال درخواست نارضایتی از پرسنل",
|
||||
link: "/CitizenLogin",
|
||||
},
|
||||
// {
|
||||
// id: 3,
|
||||
// name: "مشاهده آمار",
|
||||
|
|
@ -58,21 +58,21 @@ export const newsItems = [
|
|||
id: 1,
|
||||
title: "شروع به کار سامانه عیون",
|
||||
content:
|
||||
"این سامانه با هدف نظارت بر عملکرد پرستل و نهادهای مرتبط با امور مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده است ...",
|
||||
"این سامانه با هدف نظارت بر عملکرد پرسنل و نهادهای مرتبط با امور مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده است ...",
|
||||
date: "24 آذر ماه 1402",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "شروع به کار سامانه عیون",
|
||||
content:
|
||||
"این سامانه با هدف نظارت بر عملکرد پرستل و نهادهای مرتبط با امور مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده است ...",
|
||||
"این سامانه با هدف نظارت بر عملکرد پرسنل و نهادهای مرتبط با امور مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده است ...",
|
||||
date: "24 آذر ماه 1402",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "شروع به کار سامانه عیون ",
|
||||
content:
|
||||
"این سامانه با هدف نظارت بر عملکرد پرستل و نهادهای مرتبط با امور مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده است ...",
|
||||
"این سامانه با هدف نظارت بر عملکرد پرسنل و نهادهای مرتبط با امور مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده است ...",
|
||||
date: "24 آذر ماه 1402",
|
||||
},
|
||||
];
|
||||
|
|
@ -244,10 +244,9 @@ export const Operations = [
|
|||
{ value: 7, name: "شروع مجدد درخواست" },
|
||||
];
|
||||
|
||||
|
||||
export const errorMessages = {
|
||||
500: "خطایی رخ داد. لطفا از اتصال اینترنت خود اطمینان حاصل نمایید.",
|
||||
400: "مشکلی در ارسال درخواست به وجود آمد.",
|
||||
480: "لطفا تمام اطلاعات خواسته شده را وارد نمایید.",
|
||||
428: "کد فعالسازی را وارد نمایید.",
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,9 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = { output: "standalone" };
|
||||
const nextConfig = {
|
||||
output: "standalone",
|
||||
images: {
|
||||
domains: ["sootzaniapi.shetabdahi.ir"],
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "sootzani",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "sootzani",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"dependencies": {
|
||||
"@hookform/resolvers": "^3.3.2",
|
||||
"@radix-ui/react-alert-dialog": "^1.0.5",
|
||||
|
|
@ -16,6 +16,7 @@
|
|||
"@radix-ui/react-label": "^2.0.2",
|
||||
"@radix-ui/react-radio-group": "^1.1.3",
|
||||
"@radix-ui/react-select": "^2.0.0",
|
||||
"@radix-ui/react-separator": "^1.0.3",
|
||||
"@radix-ui/react-slot": "^1.0.2",
|
||||
"@radix-ui/react-tabs": "^1.0.4",
|
||||
"@radix-ui/react-toast": "^1.1.5",
|
||||
|
|
@ -1084,6 +1085,29 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@radix-ui/react-separator": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.0.3.tgz",
|
||||
"integrity": "sha512-itYmTy/kokS21aiV5+Z56MZB54KrhPgn6eHDKkFeOLR34HMN2s8PaN47qZZAGnvupcjxHaFZnW4pQEh0BvvVuw==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.13.10",
|
||||
"@radix-ui/react-primitive": "1.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "*",
|
||||
"@types/react-dom": "*",
|
||||
"react": "^16.8 || ^17.0 || ^18.0",
|
||||
"react-dom": "^16.8 || ^17.0 || ^18.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
},
|
||||
"@types/react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/@radix-ui/react-slot": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.2.tgz",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "sootzani",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
"@radix-ui/react-label": "^2.0.2",
|
||||
"@radix-ui/react-radio-group": "^1.1.3",
|
||||
"@radix-ui/react-select": "^2.0.0",
|
||||
"@radix-ui/react-separator": "^1.0.3",
|
||||
"@radix-ui/react-slot": "^1.0.2",
|
||||
"@radix-ui/react-tabs": "^1.0.4",
|
||||
"@radix-ui/react-toast": "^1.1.5",
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 645 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
|
|
@ -10,6 +10,7 @@ axios.interceptors.request.use(function (config) {
|
|||
});
|
||||
// Post Complaints
|
||||
export async function postComplaintSubmit({ Data }: { Data: FormData }) {
|
||||
delete axios.defaults.headers.common["Authorization"];
|
||||
const data = await axios.post(`api/Citizen`, Data);
|
||||
return data.data;
|
||||
}
|
||||
|
|
@ -31,7 +32,9 @@ export async function postComplaintTracking({
|
|||
}: {
|
||||
Data: { trackingNumber: string; password: string };
|
||||
}) {
|
||||
const data = await axios.post(`api/Citizen/Get`, Data);
|
||||
const data = await axios.post(`api/Citizen/Get`, Data, {
|
||||
headers: { Authorization: "" },
|
||||
});
|
||||
return data.data;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,3 +18,9 @@ export async function getCaptcha() {
|
|||
console.log(data);
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function getSliders() {
|
||||
const data = await axios.get("api/Common/Sliders");
|
||||
console.log(data);
|
||||
return data.data;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue