Compare commits
3 Commits
b7af07794a
...
02e0bf8ecd
| Author | SHA1 | Date |
|---|---|---|
|
|
02e0bf8ecd | |
|
|
009ef6eb79 | |
|
|
4179845f8c |
|
|
@ -7,6 +7,7 @@ export default function RootLayout({
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
||||||
<NavbarPanel />
|
<NavbarPanel />
|
||||||
{children}
|
{children}
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,5 @@ import React from 'react'
|
||||||
export default function page() {
|
export default function page() {
|
||||||
return (
|
return (
|
||||||
<TabController />
|
<TabController />
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import ReportsController from '@/components/ReportsController'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export default function page() {
|
export default function page() {
|
||||||
|
const a = useMut
|
||||||
return (
|
return (
|
||||||
<ReportsController />
|
<ReportsController />
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "./globals.css";
|
||||||
import { Toaster } from "@/components/ui/toaster";
|
import { Toaster } from "@/components/ui/toaster";
|
||||||
import Navbar from "@/components/Navbar";
|
import Navbar from "@/components/Navbar";
|
||||||
import NavbarSm from "@/components/NavbarSm";
|
import NavbarSm from "@/components/NavbarSm";
|
||||||
|
import Provider from "../utils/Provider";
|
||||||
|
|
||||||
const inter = Inter({ subsets: ["latin"] });
|
const inter = Inter({ subsets: ["latin"] });
|
||||||
|
|
||||||
|
|
@ -18,20 +18,18 @@ export default function RootLayout({
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<html lang="fa" dir="rtl">
|
<html lang="fa" dir="rtl">
|
||||||
|
<Provider>
|
||||||
<body className="font-[yekan-m] ">
|
<body className="font-[yekan-m] ">
|
||||||
<Navbar />
|
<Navbar />
|
||||||
<NavbarSm />
|
<NavbarSm />
|
||||||
|
|
||||||
<div className="flex justify-center " >
|
<div className="flex justify-center ">{children}</div>
|
||||||
{children}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Toaster />
|
<Toaster />
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
</Provider>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ import { Input } from "@/components/ui/input";
|
||||||
import { toast } from "@/components/ui/use-toast";
|
import { toast } from "@/components/ui/use-toast";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import LoginIcon from "../public/img/login-icon.svg";
|
import LoginIcon from "../public/img/login-icon.svg";
|
||||||
|
import { useMutation } from "@tanstack/react-query";
|
||||||
|
import { loginStaff } from "@/utils/authenticateApi";
|
||||||
|
|
||||||
const FormSchema = z.object({
|
const FormSchema = z.object({
|
||||||
username: z.string().min(2, {
|
username: z.string().min(2, {
|
||||||
|
|
@ -31,6 +33,21 @@ const FormSchema = z.object({
|
||||||
});
|
});
|
||||||
|
|
||||||
export default function Login() {
|
export default function Login() {
|
||||||
|
const LoginMutation = useMutation({
|
||||||
|
mutationFn: loginStaff,
|
||||||
|
onSuccess: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
// localStorage.setItem("roles", res.roles[0]);
|
||||||
|
// setCookie("token", res.token);
|
||||||
|
// if (res.roles[0] == "Operator") {
|
||||||
|
// router.push("/MainPage/Prescriptions");
|
||||||
|
// } else {
|
||||||
|
// router.push("/MainPage");
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
onError: (err) => {},
|
||||||
|
});
|
||||||
|
|
||||||
const form = useForm<z.infer<typeof FormSchema>>({
|
const form = useForm<z.infer<typeof FormSchema>>({
|
||||||
resolver: zodResolver(FormSchema),
|
resolver: zodResolver(FormSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
|
|
@ -52,8 +69,10 @@ export default function Login() {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
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]
|
<div
|
||||||
h-full max-md:p-8 pt-12">
|
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]
|
||||||
|
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">
|
<div className="space-y-3 md:space-y-4 flex flex-col md:py-12 md:px-20 h-full justify-center">
|
||||||
<Image alt="icon" src={LoginIcon} className="self-center w-1/3 " />
|
<Image alt="icon" src={LoginIcon} className="self-center w-1/3 " />
|
||||||
|
|
||||||
|
|
@ -71,16 +90,21 @@ export default function Login() {
|
||||||
name="username"
|
name="username"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel className="text-[#7C838A] text-sm font-medium">نام کاربری</FormLabel>
|
<FormLabel className="text-[#7C838A] text-sm font-medium">
|
||||||
|
نام کاربری
|
||||||
|
</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input className="mb-4" placeholder="نام کاربری خود را وارد نمایید" {...field} />
|
<Input
|
||||||
|
className="mb-4"
|
||||||
|
placeholder="نام کاربری خود را وارد نمایید"
|
||||||
|
{...field}
|
||||||
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
{/* <FormDescription>
|
{/* <FormDescription>
|
||||||
This is your public display name.
|
This is your public display name.
|
||||||
</FormDescription> */}
|
</FormDescription> */}
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
@ -89,18 +113,24 @@ export default function Login() {
|
||||||
name="password"
|
name="password"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7">رمز عبور</FormLabel>
|
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7">
|
||||||
|
رمز عبور
|
||||||
|
</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder="رمز عبور خود را وارد کنید" {...field} />
|
<Input placeholder="رمز عبور خود را وارد کنید" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="flex justify-end gap-2 w-full mt-14">
|
<div className="flex justify-end gap-2 w-full mt-14">
|
||||||
<Button type="submit" className="bg-blue text-white w-1/2 md:w-1/3 p-2 rounded-xl">ورود</Button>
|
<Button
|
||||||
|
type="submit"
|
||||||
|
className="bg-blue text-white w-1/2 md:w-1/3 p-2 rounded-xl"
|
||||||
|
>
|
||||||
|
ورود
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
||||||
|
|
@ -22,23 +22,6 @@ export default function NavbarSm() {
|
||||||
const [isOpen, setOpen] = useState(false);
|
const [isOpen, setOpen] = useState(false);
|
||||||
const ref = useRef(null);
|
const ref = useRef(null);
|
||||||
|
|
||||||
// resize
|
|
||||||
function getSize() {
|
|
||||||
return {
|
|
||||||
width: window.innerWidth,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const [windowSize, setWindowSize] = useState(getSize);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
function handleResize() {
|
|
||||||
setWindowSize(getSize());
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("resize", handleResize);
|
|
||||||
return () => window.removeEventListener("resize", handleResize);
|
|
||||||
}, [windowSize]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
|
|
@ -54,7 +37,9 @@ export default function NavbarSm() {
|
||||||
ورود به پنل کاربری
|
ورود به پنل کاربری
|
||||||
</Button>
|
</Button>
|
||||||
</Link> */}
|
</Link> */}
|
||||||
{window.innerWidth <= 768 ? <TopNav /> : <></>}
|
<div className="md:hidden">
|
||||||
|
<TopNav />
|
||||||
|
</div>
|
||||||
|
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
{isOpen && (
|
{isOpen && (
|
||||||
|
|
|
||||||
|
|
@ -19,26 +19,10 @@ import {
|
||||||
import { IoMdClose } from "react-icons/io";
|
import { IoMdClose } from "react-icons/io";
|
||||||
|
|
||||||
export default function Search({ mode }: { mode: string }) {
|
export default function Search({ mode }: { mode: string }) {
|
||||||
// resize
|
|
||||||
function getSize() {
|
|
||||||
return {
|
|
||||||
width: window.innerWidth,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const [windowSize, setWindowSize] = useState(getSize);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
function handleResize() {
|
|
||||||
setWindowSize(getSize());
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("resize", handleResize);
|
|
||||||
return () => window.removeEventListener("resize", handleResize);
|
|
||||||
}, [windowSize]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{window.innerWidth >= 768 || mode === 'controller' || mode === 'admin'? (
|
{mode === "controller" || mode === "admin" || mode == "landing" ? (
|
||||||
<div className=" relative flex bg-gray-300 rounded-xl items-center">
|
<div className=" relative flex bg-gray-300 rounded-xl items-center">
|
||||||
<Input
|
<Input
|
||||||
// type="search"
|
// type="search"
|
||||||
|
|
@ -46,11 +30,12 @@ export default function Search({mode}:{mode:string}) {
|
||||||
className={`mb-0 h-8 bg-[#D6D8DE66] border-none focus-visible:none rounded-lg
|
className={`mb-0 h-8 bg-[#D6D8DE66] border-none focus-visible:none rounded-lg
|
||||||
block w-full min-w-[13rem] lg:min-w-[16rem] text-xs text-black
|
block w-full min-w-[13rem] lg:min-w-[16rem] text-xs text-black
|
||||||
text-opacity-60 dark:text-white
|
text-opacity-60 dark:text-white
|
||||||
${mode === 'controller' && 'h-12 max-lg:min-w-[95vw]'}
|
${mode === "controller" && "h-12 max-lg:min-w-[95vw]"}
|
||||||
${mode === 'admin' && 'w-full min-w-full bg-white lg:min-w-full h-11'}
|
${
|
||||||
|
mode === "admin" &&
|
||||||
|
"w-full min-w-full bg-white lg:min-w-full h-11"
|
||||||
|
}
|
||||||
`}
|
`}
|
||||||
|
|
||||||
placeholder="جستجو..."
|
placeholder="جستجو..."
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
|
|
@ -64,7 +49,7 @@ export default function Search({mode}:{mode:string}) {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="">
|
<div className=" md:hidden">
|
||||||
<AlertDialog>
|
<AlertDialog>
|
||||||
<AlertDialogTrigger asChild>
|
<AlertDialogTrigger asChild>
|
||||||
<button
|
<button
|
||||||
|
|
@ -88,7 +73,6 @@ export default function Search({mode}:{mode:string}) {
|
||||||
</AlertDialogTitle>
|
</AlertDialogTitle>
|
||||||
|
|
||||||
<AlertDialogDescription className="justify-center sm:px-14 sm:py-6">
|
<AlertDialogDescription className="justify-center sm:px-14 sm:py-6">
|
||||||
|
|
||||||
<Input
|
<Input
|
||||||
// type="search"
|
// type="search"
|
||||||
id="default-search"
|
id="default-search"
|
||||||
|
|
@ -102,7 +86,6 @@ export default function Search({mode}:{mode:string}) {
|
||||||
<CiSearch />
|
<CiSearch />
|
||||||
</button>
|
</button>
|
||||||
</AlertDialogDescription>
|
</AlertDialogDescription>
|
||||||
|
|
||||||
</AlertDialogHeader>
|
</AlertDialogHeader>
|
||||||
</AlertDialogContent>
|
</AlertDialogContent>
|
||||||
</AlertDialog>
|
</AlertDialog>
|
||||||
|
|
|
||||||
|
|
@ -4,26 +4,23 @@ import React from "react";
|
||||||
import { Input } from "./ui/input";
|
import { Input } from "./ui/input";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import Search from "./Search";
|
import Search from "./Search";
|
||||||
import { usePathname } from 'next/navigation'
|
import { usePathname } from "next/navigation";
|
||||||
|
|
||||||
export default function TopNav() {
|
export default function TopNav() {
|
||||||
const pathname = usePathname()
|
const pathname = usePathname();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`flex justify-between items-center w-full px-8 py-2 z-10 border-b-[#C9CFD7] border-b-[1px] border-solid
|
<div
|
||||||
max-md:bg-gray max-md:bg-transparent max-md:px-0 max-md:justify-end max-md:border-b-0
|
className={`flex justify-between items-center w-full px-8 py-2 z-10 border-b-[#C9CFD7] border-b-[1px] border-solid max-md:bg-gray max-md:bg-transparent max-md:px-0 max-md:justify-end max-md:border-b-0 ${
|
||||||
${pathname === "/" ? "bg-transparent" : "bg-white"} `}>
|
pathname === "/" ? "bg-transparent" : "bg-white"
|
||||||
|
} `}
|
||||||
<h1 className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text
|
>
|
||||||
max-md:hidden">
|
<h1 className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text max-md:hidden">
|
||||||
سال 1402 | مهارم تورم، رشد تولید
|
سال 1402 | مهارم تورم، رشد تولید
|
||||||
</h1>
|
</h1>
|
||||||
{/* <p>Current pathname: {pathname}</p> */}
|
{/* <p>Current pathname: {pathname}</p> */}
|
||||||
<div className="flex items-center gap-10">
|
<div className="flex items-center gap-10">
|
||||||
|
|
||||||
|
|
||||||
<div className=" flex items-center gap-3 md:ml-4">
|
<div className=" flex items-center gap-3 md:ml-4">
|
||||||
|
|
||||||
<p className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text text-sm max-md:text-xs">
|
<p className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text text-sm max-md:text-xs">
|
||||||
امروز: چهارشنبه 24 آبان 1402
|
امروز: چهارشنبه 24 آبان 1402
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -57,8 +54,7 @@ export default function TopNav() {
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Search/>
|
<Search mode="landing" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
"use client";
|
||||||
|
import Image from "next/image";
|
||||||
|
import React from "react";
|
||||||
|
import LoginIcon from "../public/img/login-icon.svg";
|
||||||
|
export default function Verify() {
|
||||||
|
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]
|
||||||
|
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">
|
||||||
|
<Image alt="icon" src={LoginIcon} className="self-center w-1/3 " />
|
||||||
|
|
||||||
|
<p className="text-lg font-bold leading-tight tracking-tight text-blue dark:text-white">
|
||||||
|
تایید کد
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{/* <Form {...form}>
|
||||||
|
<form
|
||||||
|
onSubmit={form.handleSubmit(onSubmit)}
|
||||||
|
className="w-full flex flex-col "
|
||||||
|
>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="username"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel className="text-[#7C838A] text-sm font-medium">
|
||||||
|
نام کاربری
|
||||||
|
</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input
|
||||||
|
className="mb-4"
|
||||||
|
placeholder="نام کاربری خود را وارد نمایید"
|
||||||
|
{...field}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormDescription>
|
||||||
|
This is your public display name.
|
||||||
|
</FormDescription>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="password"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7">
|
||||||
|
رمز عبور
|
||||||
|
</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input placeholder="رمز عبور خود را وارد کنید" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div className="flex justify-end gap-2 w-full mt-14">
|
||||||
|
<Button
|
||||||
|
type="submit"
|
||||||
|
className="bg-blue text-white w-1/2 md:w-1/3 p-2 rounded-xl"
|
||||||
|
>
|
||||||
|
ورود
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</Form> */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
"@radix-ui/react-tabs": "^1.0.4",
|
"@radix-ui/react-tabs": "^1.0.4",
|
||||||
"@radix-ui/react-toast": "^1.1.5",
|
"@radix-ui/react-toast": "^1.1.5",
|
||||||
"@tanstack/react-query": "^5.8.7",
|
"@tanstack/react-query": "^5.8.7",
|
||||||
|
"@tanstack/react-query-devtools": "^5.14.7",
|
||||||
"@uidotdev/usehooks": "^2.4.1",
|
"@uidotdev/usehooks": "^2.4.1",
|
||||||
"axios": "^1.6.2",
|
"axios": "^1.6.2",
|
||||||
"chart.js": "^4.4.1",
|
"chart.js": "^4.4.1",
|
||||||
|
|
@ -35,6 +36,7 @@
|
||||||
"react-hook-form": "^7.48.2",
|
"react-hook-form": "^7.48.2",
|
||||||
"react-icons": "^4.12.0",
|
"react-icons": "^4.12.0",
|
||||||
"react-leaflet": "^4.2.1",
|
"react-leaflet": "^4.2.1",
|
||||||
|
"react-otp-input": "^3.1.1",
|
||||||
"react-use": "^17.4.2",
|
"react-use": "^17.4.2",
|
||||||
"swiper": "^11.0.5",
|
"swiper": "^11.0.5",
|
||||||
"tailwind-merge": "^2.1.0",
|
"tailwind-merge": "^2.1.0",
|
||||||
|
|
@ -1222,37 +1224,52 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tanstack/query-core": {
|
"node_modules/@tanstack/query-core": {
|
||||||
"version": "5.8.7",
|
"version": "5.14.2",
|
||||||
"resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.8.7.tgz",
|
"resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.14.2.tgz",
|
||||||
"integrity": "sha512-58xOSkxxZK4SGQ/uzX8MDZHLGZCkxlgkPxnfhxUOL2uchnNHyay2UVcR3mQNMgaMwH1e2l+0n+zfS7+UJ/MAJw==",
|
"integrity": "sha512-QmoJvC72sSWs3hgGis8JdmlDvqLfYGWUK4UG6OR9Q6t28JMN9m2FDwKPqoSJ9YVocELCSjMt/FGjEiLfk8000Q==",
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/tannerlinsley"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tanstack/query-devtools": {
|
||||||
|
"version": "5.14.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.14.7.tgz",
|
||||||
|
"integrity": "sha512-pLATV0VOGR0UrnxiA/yw0DACvCxTnH3Y1MNb61NOMfsuHOXw9W96tUqo2wlXaK7fWgIjA+SPb+YcjUsp5geAYQ==",
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/tannerlinsley"
|
"url": "https://github.com/sponsors/tannerlinsley"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tanstack/react-query": {
|
"node_modules/@tanstack/react-query": {
|
||||||
"version": "5.8.7",
|
"version": "5.14.6",
|
||||||
"resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.8.7.tgz",
|
"resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.14.6.tgz",
|
||||||
"integrity": "sha512-RYSSMmkhbJ7tPkf8w+MSRIXQLoUCm7DRnTLDcdf+uampupnriEsob3fVWTt9oaEj+AJWEKeCErDBdZeNcAzURQ==",
|
"integrity": "sha512-+INnJdq/904d+K2XQjqdIC58glpNGfQ8Xz93M6WBeJs5FPGFV8SEuFVzPtW/bKZ/Hu7hAiJpbFLDg5Lysvwmuw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tanstack/query-core": "5.8.7"
|
"@tanstack/query-core": "5.14.2"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "github",
|
"type": "github",
|
||||||
"url": "https://github.com/sponsors/tannerlinsley"
|
"url": "https://github.com/sponsors/tannerlinsley"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^18.0.0",
|
"react": "^18.0.0"
|
||||||
"react-dom": "^18.0.0",
|
|
||||||
"react-native": "*"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"react-dom": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"react-native": {
|
|
||||||
"optional": true
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@tanstack/react-query-devtools": {
|
||||||
|
"version": "5.14.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.14.7.tgz",
|
||||||
|
"integrity": "sha512-nZeKPB66AZJJYqxybV5fEs3VsKwxCtpxGcXJXxEILmhnd3RHEoNLWRLW9Uv1E38C7Vgncv0DZHGrnYM1EARYTg==",
|
||||||
|
"dependencies": {
|
||||||
|
"@tanstack/query-devtools": "5.14.7"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/tannerlinsley"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@tanstack/react-query": "^5.14.6",
|
||||||
|
"react": "^18.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/cookie": {
|
"node_modules/@types/cookie": {
|
||||||
|
|
@ -4666,6 +4683,15 @@
|
||||||
"react-dom": "^18.0.0"
|
"react-dom": "^18.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/react-otp-input": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-otp-input/-/react-otp-input-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-bjPavgJ0/Zmf/AYi4onj8FbH93IjeD+e8pWwxIJreDEWsU1ILR5fs8jEJmMGWSBe/yyvPP6X/W6Mk9UkOCkTPw==",
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": ">=16.8.6 || ^17.0.0 || ^18.0.0",
|
||||||
|
"react-dom": ">=16.8.6 || ^17.0.0 || ^18.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/react-remove-scroll": {
|
"node_modules/react-remove-scroll": {
|
||||||
"version": "2.5.5",
|
"version": "2.5.5",
|
||||||
"resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz",
|
"resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz",
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
"@radix-ui/react-tabs": "^1.0.4",
|
"@radix-ui/react-tabs": "^1.0.4",
|
||||||
"@radix-ui/react-toast": "^1.1.5",
|
"@radix-ui/react-toast": "^1.1.5",
|
||||||
"@tanstack/react-query": "^5.8.7",
|
"@tanstack/react-query": "^5.8.7",
|
||||||
|
"@tanstack/react-query-devtools": "^5.14.7",
|
||||||
"@uidotdev/usehooks": "^2.4.1",
|
"@uidotdev/usehooks": "^2.4.1",
|
||||||
"axios": "^1.6.2",
|
"axios": "^1.6.2",
|
||||||
"chart.js": "^4.4.1",
|
"chart.js": "^4.4.1",
|
||||||
|
|
@ -36,6 +37,7 @@
|
||||||
"react-hook-form": "^7.48.2",
|
"react-hook-form": "^7.48.2",
|
||||||
"react-icons": "^4.12.0",
|
"react-icons": "^4.12.0",
|
||||||
"react-leaflet": "^4.2.1",
|
"react-leaflet": "^4.2.1",
|
||||||
|
"react-otp-input": "^3.1.1",
|
||||||
"react-use": "^17.4.2",
|
"react-use": "^17.4.2",
|
||||||
"swiper": "^11.0.5",
|
"swiper": "^11.0.5",
|
||||||
"tailwind-merge": "^2.1.0",
|
"tailwind-merge": "^2.1.0",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
import axios from "axios";
|
||||||
|
import { CookieValueTypes } from "cookies-next";
|
||||||
|
|
||||||
|
axios.defaults.baseURL = "https://sootzaniapi.shetabdahi.ir/";
|
||||||
|
|
||||||
|
export async function loginStaff({
|
||||||
|
token,
|
||||||
|
Data,
|
||||||
|
}: {
|
||||||
|
token: CookieValueTypes;
|
||||||
|
Data: {
|
||||||
|
userName: string;
|
||||||
|
password: string;
|
||||||
|
captcha: {
|
||||||
|
key: string;
|
||||||
|
value: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}) {
|
||||||
|
const data = await axios.post("api/Authenticate/LoginStaff", Data, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
return data.data;
|
||||||
|
}
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
import axios from "axios";
|
|
||||||
|
|
||||||
axios.defaults.baseURL = "https://ticketingapi.shahrbincenter.ir/";
|
|
||||||
|
|
||||||
export async function openTicket({ Token, Data }) {
|
|
||||||
const data = await axios.post("ClientTicket/Open", Data, {
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${Token}`,
|
|
||||||
"Content-Type": "multipart/form-data",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getAllTickets(Token) {
|
|
||||||
const data = await axios.get("ClientTicket/Get?PageNumber=1&PageSize=20", {
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${Token}`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getTicket({ Token, id }) {
|
|
||||||
const data = await axios.get(`ClientTicket/Get/${id}`, {
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${Token}`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function replyTicket({ id, Data, Token }) {
|
|
||||||
const data = await axios.post(`ClientTicket/Reply/${id}`, Data, {
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${Token}`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function closeTicket({ id, Data, Token }) {
|
|
||||||
const data = await axios.put(`ClientTicket/Close/${id}`, Data, {
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${Token}`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
import axios from "axios";
|
|
||||||
|
|
||||||
axios.defaults.baseURL = "https://ticketingapi.shahrbincenter.ir/";
|
|
||||||
|
|
||||||
export async function getCaptcha() {
|
|
||||||
const data = await axios.get("api/Authenticate/Captcha");
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function login(Data) {
|
|
||||||
const data = await axios.post("api/Authenticate/LogisterAppUser", Data);
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function LoginCode(Data) {
|
|
||||||
const data = await axios.post("api/Authenticate/LoginCode", Data);
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getCategories(Token) {
|
|
||||||
const data = await axios.get("CommonCategory/Get", {
|
|
||||||
headers: { Authorization: `Bearer ${Token}` },
|
|
||||||
});
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue