From 40eb9fab20d814856b7c071e1b22e86d2635f3d7 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Thu, 27 Feb 2025 08:21:05 +0000 Subject: [PATCH] Resolve #86c24bd8t "Feature/fast react operator " --- .../dashboard/fast-react/operator/page.js | 12 + .../fast-react/supervisor/loading.jsx | 7 - .../RowActions/ReferList/ReferListContent.jsx | 81 +++++ .../RowActions/ReferList/index.jsx | 43 +++ .../complaintList/RowActions/index.jsx | 7 +- .../fastReact/operator/ExcelPrint/index.jsx | 75 +++++ .../fastReact/operator/OperatorList.jsx | 305 ++++++++++++++++++ .../RowActions/DescriptionDialog/index.jsx | 50 +++ .../ImageDialog/ImageFormContent.jsx | 44 +++ .../operator/RowActions/ImageDialog/index.jsx | 46 +++ .../LocationDialog/LocationFormContent.jsx | 30 ++ .../RowActions/LocationDialog/index.jsx | 36 +++ .../fastReact/operator/RowActions/index.jsx | 6 + .../dashboard/fastReact/operator/Toolbar.jsx | 13 + .../dashboard/fastReact/operator/index.jsx | 15 + .../fastReact/supervisor/RowActions/index.jsx | 16 +- src/core/utils/pageMenu.js | 12 +- src/core/utils/routes.js | 2 + 18 files changed, 774 insertions(+), 26 deletions(-) create mode 100644 src/app/(withAuth)/dashboard/fast-react/operator/page.js delete mode 100644 src/app/(withAuth)/dashboard/fast-react/supervisor/loading.jsx create mode 100644 src/components/dashboard/fastReact/complaintList/RowActions/ReferList/ReferListContent.jsx create mode 100644 src/components/dashboard/fastReact/complaintList/RowActions/ReferList/index.jsx create mode 100644 src/components/dashboard/fastReact/operator/ExcelPrint/index.jsx create mode 100644 src/components/dashboard/fastReact/operator/OperatorList.jsx create mode 100644 src/components/dashboard/fastReact/operator/RowActions/DescriptionDialog/index.jsx create mode 100644 src/components/dashboard/fastReact/operator/RowActions/ImageDialog/ImageFormContent.jsx create mode 100644 src/components/dashboard/fastReact/operator/RowActions/ImageDialog/index.jsx create mode 100644 src/components/dashboard/fastReact/operator/RowActions/LocationDialog/LocationFormContent.jsx create mode 100644 src/components/dashboard/fastReact/operator/RowActions/LocationDialog/index.jsx create mode 100644 src/components/dashboard/fastReact/operator/RowActions/index.jsx create mode 100644 src/components/dashboard/fastReact/operator/Toolbar.jsx create mode 100644 src/components/dashboard/fastReact/operator/index.jsx diff --git a/src/app/(withAuth)/dashboard/fast-react/operator/page.js b/src/app/(withAuth)/dashboard/fast-react/operator/page.js new file mode 100644 index 0000000..89fe922 --- /dev/null +++ b/src/app/(withAuth)/dashboard/fast-react/operator/page.js @@ -0,0 +1,12 @@ +import OperatorPage from "@/components/dashboard/fastReact/operator"; +import WithPermission from "@/core/middlewares/withPermission"; +const Page = () => { + return ( + + + {/* */} + + ); +}; + +export default Page; diff --git a/src/app/(withAuth)/dashboard/fast-react/supervisor/loading.jsx b/src/app/(withAuth)/dashboard/fast-react/supervisor/loading.jsx deleted file mode 100644 index 4535a8d..0000000 --- a/src/app/(withAuth)/dashboard/fast-react/supervisor/loading.jsx +++ /dev/null @@ -1,7 +0,0 @@ -"use client"; -import PageLoading from "@/core/components/PageLoading"; - -const Loading = () => { - return ; -}; -export default Loading; diff --git a/src/components/dashboard/fastReact/complaintList/RowActions/ReferList/ReferListContent.jsx b/src/components/dashboard/fastReact/complaintList/RowActions/ReferList/ReferListContent.jsx new file mode 100644 index 0000000..31a1e4c --- /dev/null +++ b/src/components/dashboard/fastReact/complaintList/RowActions/ReferList/ReferListContent.jsx @@ -0,0 +1,81 @@ +import DialogLoading from "@/core/components/DialogLoading"; +import { GET_FAST_REACT_REFER_LIST } from "@/core/utils/routes"; +import useRequest from "@/lib/hooks/useRequest"; +import { + DialogContent, + Table, + TableBody, + TableCell, + TableContainer, + TableHead, + TableRow, + Typography, +} from "@mui/material"; +import moment from "jalali-moment"; +import { useEffect, useState } from "react"; + +const ReferListContent = ({ rowId }) => { + const [loading, setLoading] = useState(true); + const [data, setData] = useState(null); + const request = useRequest(); + + useEffect(() => { + const fetchData = async () => { + try { + setLoading(true); + const response = await request(`${GET_FAST_REACT_REFER_LIST}/${rowId}`); + setData(response.data.data); + } catch (error) { + } finally { + setLoading(false); + } + }; + + fetchData(); + }, [rowId]); + + return ( + <> + + {loading ? ( + + ) : data.length !== 0 ? ( + + + + + کاربر + از اداره + از اداره + تاریخ + توضیحات + + + + {data.map((refer, index) => { + return ( + + {refer.user} + {`${refer.from_province} | ${refer.from_edareh}`} + {`${refer.to_province} | ${refer.to_edareh}`} + + {moment(refer.created_at).locale("fa").format("HH:mm | yyyy/MM/DD")} + + {refer.description} + + ); + })} + +
+
+ ) : ( + ارجاعی در سامانه یافت نشد + )} +
+ + ); +}; +export default ReferListContent; diff --git a/src/components/dashboard/fastReact/complaintList/RowActions/ReferList/index.jsx b/src/components/dashboard/fastReact/complaintList/RowActions/ReferList/index.jsx new file mode 100644 index 0000000..619bd98 --- /dev/null +++ b/src/components/dashboard/fastReact/complaintList/RowActions/ReferList/index.jsx @@ -0,0 +1,43 @@ +import { Button, Dialog, DialogActions, DialogTitle, IconButton, Tooltip } from "@mui/material"; +import ListAltIcon from "@mui/icons-material/ListAlt"; +import ReferListContent from "./ReferListContent"; +import { useState } from "react"; + +const ReferList = ({ rowId }) => { + const [openReferListDialog, setOpenReferListDialog] = useState(false); + return ( + <> + + setOpenReferListDialog(true)}> + + + + setOpenReferListDialog(false)} + PaperProps={{ + sx: { + boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px", + }, + }} + dir="rtl" + maxWidth={"md"} + > + لیست ارجاعات + {openReferListDialog && } + + + + + + ); +}; +export default ReferList; diff --git a/src/components/dashboard/fastReact/complaintList/RowActions/index.jsx b/src/components/dashboard/fastReact/complaintList/RowActions/index.jsx index 9fb298d..29e6e23 100644 --- a/src/components/dashboard/fastReact/complaintList/RowActions/index.jsx +++ b/src/components/dashboard/fastReact/complaintList/RowActions/index.jsx @@ -1,6 +1,11 @@ import { Box } from "@mui/material"; +import ReferList from "./ReferList"; const RowActions = ({ row, mutate }) => { - return ; + return ( + + + + ); }; export default RowActions; diff --git a/src/components/dashboard/fastReact/operator/ExcelPrint/index.jsx b/src/components/dashboard/fastReact/operator/ExcelPrint/index.jsx new file mode 100644 index 0000000..ae703fa --- /dev/null +++ b/src/components/dashboard/fastReact/operator/ExcelPrint/index.jsx @@ -0,0 +1,75 @@ +import { Button, CircularProgress, IconButton, useMediaQuery } from "@mui/material"; +import { useMemo, useState } from "react"; +import moment from "jalali-moment"; +import FileSaver from "file-saver"; +import DescriptionIcon from "@mui/icons-material/Description"; +import useRequest from "@/lib/hooks/useRequest"; +import { EXPORT_ROAD_ITEMS_SUPERVISOR_LIST } from "@/core/utils/routes"; +import { useTheme } from "@emotion/react"; +import DataTableFilterDataStructure from "@/core/utils/DataTableFilterDataStructure"; +import isArrayEmpty from "@/core/utils/isArrayEmpty"; + +const PrintExcel = ({ table, filterData }) => { + const [loading, setLoading] = useState(false); + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down("sm")); + const requestServer = useRequest(); + const activeFilters = Object.entries(filterData).reduce((acc, [key, filter]) => { + if (filter.value && (!Array.isArray(filter.value) || filter.value.some((item) => item.trim() !== ""))) { + acc.push({ id: key, value: filter.value }); + } + return acc; + }, []); + + const filterParams = useMemo(() => { + const params = new URLSearchParams(); + if (activeFilters.length > 0) { + activeFilters.map((filter, index) => { + const filteredFilterData = DataTableFilterDataStructure(filterData, isArrayEmpty); + params.set("filters", JSON.stringify(filteredFilterData.length === 0 ? [] : filteredFilterData)); + }); + } else { + params.set("filters", JSON.stringify([])); + } + return params; + }, [activeFilters]); + + const clickHandler = () => { + setLoading(true); + requestServer(`${EXPORT_ROAD_ITEMS_SUPERVISOR_LIST}?${filterParams}`, "get", { + requestOptions: { responseType: "blob" }, + }) + .then((response) => { + const filename = `خروجی کارتابل ارزیابی فعالیت روزانه تاریخ_${moment().format("jYYYY_jMM_jDD")}.xlsx`; + FileSaver.saveAs(response.data, filename); + }) + .catch(() => {}) + .finally(() => { + setLoading(false); + }); + }; + + return ( + <> + {isMobile ? ( + + + + ) : ( + + )} + + ); +}; + +export default PrintExcel; diff --git a/src/components/dashboard/fastReact/operator/OperatorList.jsx b/src/components/dashboard/fastReact/operator/OperatorList.jsx new file mode 100644 index 0000000..0234f2b --- /dev/null +++ b/src/components/dashboard/fastReact/operator/OperatorList.jsx @@ -0,0 +1,305 @@ +import DataTableWithAuth from "@/core/components/DataTableWithAuth"; +import { GET_FAST_REACT_OPERATOR } from "@/core/utils/routes"; +import EngineeringIcon from "@mui/icons-material/Engineering"; +import ThreePIcon from "@mui/icons-material/ThreeP"; +import { Box, Stack, Typography } from "@mui/material"; +import moment from "jalali-moment"; +import { useMemo } from "react"; +import RowActions from "./RowActions"; +import DescriptionForm from "./RowActions/DescriptionDialog"; +import ImageDialog from "./RowActions/ImageDialog"; +import LocationForm from "./RowActions/LocationDialog"; +import Toolbar from "./Toolbar"; + +const OperatorList = () => { + const statusOptions = [ + { value: "", label: "همه وضعیت ها" }, + { value: 0, label: "درحال بررسی" }, + { value: 1, label: "تایید شده" }, + { value: 2, label: "عدم تایید" }, + ]; + + const columns = useMemo( + () => [ + { + accessorKey: "id", + header: "کد یکتا", + id: "road_observeds__id", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + }, + { + accessorKey: "fk_RegisteredEventMessage", + header: "کد سوانح", + id: "fk_RegisteredEventMessage", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + }, + { + accessorKey: "Title", + header: "موضوع گزارش", + id: "Title", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + }, + { + accessorKey: "FeatureTypeTitle", + header: "نوع گزارش", + id: "FeatureTypeTitle", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + }, + { + accessorKey: "Description", + header: "توضیح گزارش", + id: "Description", + enableColumnFilter: false, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + muiTableBodyCellProps: { + sx: { + borderLeft: "1px solid #e1e1e1", + py: 0, + "&:first-of-type": { + borderLeft: "unset", + }, + }, + }, + Cell: ({ renderedCellValue }) => { + if (renderedCellValue) { + return ( + + + + ); + } + return بدون توضیحات; + }, + }, + { + header: "موقعیت", + id: "location", + enableColumnFilter: false, + enableSorting: false, + datatype: "array", + grow: false, + size: 100, + muiTableBodyCellProps: { + sx: { + borderLeft: "1px solid #e1e1e1", + py: 0, + "&:first-of-type": { + borderLeft: "unset", + }, + }, + }, + Cell: ({ row }) => { + return ( + + + + ); + }, + }, + { + header: "تصاویر", + id: "images", + enableColumnFilter: false, + enableSorting: false, + datatype: "array", + grow: false, + size: 100, + muiTableBodyCellProps: { + sx: { + borderLeft: "1px solid #e1e1e1", + py: 0, + "&:first-of-type": { + borderLeft: "unset", + }, + }, + }, + Cell: ({ row }) => { + if (!row.original?.image_before && !row.original?.image_after) return <>بدون تصویر; + return ( + + {row.original?.image_before && row.original?.image_after && ( + + )} + + ); + }, + }, + { + accessorKey: "MobileForSendEventSms", + header: "شماره تماس گیرنده", + id: "MobileForSendEventSms", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + }, + { + accessorFn: (row) => moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"), + header: "تاریخ ثبت", + id: "created_at", + enableColumnFilter: true, + datatype: "date", + filterMode: "between", + grow: false, + size: 100, + }, + { + accessorFn: (row) => moment(row.rms_last_activity).locale("fa").format("HH:mm | yyyy/MM/DD"), + header: "تاریخ اقدام", + id: "rms_last_activity", + enableColumnFilter: true, + datatype: "date", + filterMode: "between", + grow: false, + size: 100, + }, + { + accessorKey: "rms_description", + header: "توضیح مامور", + id: "rms_description", + enableColumnFilter: false, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + muiTableBodyCellProps: { + sx: { + borderLeft: "1px solid #e1e1e1", + py: 0, + "&:first-of-type": { + borderLeft: "unset", + }, + }, + }, + Cell: ({ renderedCellValue }) => { + if (renderedCellValue) { + return ( + + + + ); + } + return بدون توضیحات; + }, + }, + { + accessorKey: "supervisor_description", + header: "توضیح کارشناس", + id: "supervisor_description", + enableColumnFilter: false, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + muiTableBodyCellProps: { + sx: { + borderLeft: "1px solid #e1e1e1", + py: 0, + "&:first-of-type": { + borderLeft: "unset", + }, + }, + }, + Cell: ({ renderedCellValue }) => { + if (renderedCellValue) { + return ( + + + + ); + } + return بدون توضیحات; + }, + }, + { + accessorKey: "status", + header: "وضعیت", + id: "status", + enableColumnFilter: true, + datatype: "numeric", + filterMode: "equals", + sortDescFirst: true, + grow: false, + size: 100, + columnSelectOption: () => { + return statusOptions.map((status) => ({ + value: status.value, + label: status.label, + })); + }, + Cell: ({ row }) => <>{row.original.status_fa}, + }, + ], + [] + ); + + return ( + <> + + + + + ); +}; +export default OperatorList; diff --git a/src/components/dashboard/fastReact/operator/RowActions/DescriptionDialog/index.jsx b/src/components/dashboard/fastReact/operator/RowActions/DescriptionDialog/index.jsx new file mode 100644 index 0000000..4d80ac4 --- /dev/null +++ b/src/components/dashboard/fastReact/operator/RowActions/DescriptionDialog/index.jsx @@ -0,0 +1,50 @@ +import { Dialog, DialogContent, DialogTitle, IconButton, Tooltip, Typography, Card, CardContent } from "@mui/material"; +import { useState } from "react"; +import RemoveRedEyeIcon from "@mui/icons-material/RemoveRedEye"; +import CloseIcon from "@mui/icons-material/Close"; + +const DescriptionForm = ({ description, title, icon: IconComponent = RemoveRedEyeIcon }) => { + const [openOfficerDescriptionDialog, setOpenOfficerDescriptionDialog] = useState(false); + + return ( + <> + + setOpenOfficerDescriptionDialog(true)}> + + + + setOpenOfficerDescriptionDialog(false)} + PaperProps={{ + sx: { + transition: "all .3s", + boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px", + borderRadius: 2, + padding: 1, + }, + }} + maxWidth="sm" + fullWidth + dir="rtl" + > + + + {title} + + setOpenOfficerDescriptionDialog(false)} size="small"> + + + + + + + {description || "هیچ توضیحی موجود نیست"} + + + + + + ); +}; +export default DescriptionForm; diff --git a/src/components/dashboard/fastReact/operator/RowActions/ImageDialog/ImageFormContent.jsx b/src/components/dashboard/fastReact/operator/RowActions/ImageDialog/ImageFormContent.jsx new file mode 100644 index 0000000..9aaa92e --- /dev/null +++ b/src/components/dashboard/fastReact/operator/RowActions/ImageDialog/ImageFormContent.jsx @@ -0,0 +1,44 @@ +import { Box, DialogContent, Paper, Stack, Typography, useTheme } from "@mui/material"; +import Image from "next/image"; + +const ImageFormContent = ({ image, title }) => { + const theme = useTheme(); + return ( + + + {title} + + + Image + + + ); +}; +export default ImageFormContent; diff --git a/src/components/dashboard/fastReact/operator/RowActions/ImageDialog/index.jsx b/src/components/dashboard/fastReact/operator/RowActions/ImageDialog/index.jsx new file mode 100644 index 0000000..de3b76a --- /dev/null +++ b/src/components/dashboard/fastReact/operator/RowActions/ImageDialog/index.jsx @@ -0,0 +1,46 @@ +import PhotoLibraryIcon from "@mui/icons-material/PhotoLibrary"; +import { Button, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Tooltip } from "@mui/material"; +import { useState } from "react"; +import ImageFormContent from "./ImageFormContent"; + +const ImageDialog = ({ image_before, image_after }) => { + const [openImageDialog, setOpenImageDialog] = useState(false); + + return ( + <> + + setOpenImageDialog(true)}> + + + + setOpenImageDialog(false)} + PaperProps={{ + sx: { + boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px", + }, + }} + maxWidth={"sm"} + scroll="paper" + > + تصاویر + + {openImageDialog && ( + <> + + + + )} + + + + + + + ); +}; +export default ImageDialog; diff --git a/src/components/dashboard/fastReact/operator/RowActions/LocationDialog/LocationFormContent.jsx b/src/components/dashboard/fastReact/operator/RowActions/LocationDialog/LocationFormContent.jsx new file mode 100644 index 0000000..94f091d --- /dev/null +++ b/src/components/dashboard/fastReact/operator/RowActions/LocationDialog/LocationFormContent.jsx @@ -0,0 +1,30 @@ +"use client"; +import { Box, Button, DialogActions, DialogContent, Stack } from "@mui/material"; +import React from "react"; +import dynamic from "next/dynamic"; +import MapLoading from "@/core/components/MapLayer/Loading"; +import ShowLocationMarker from "@/core/components/ShowLocationMarker"; +const MapLayer = dynamic(() => import("@/core/components/MapLayer"), { + loading: () => , + ssr: false, +}); + +const LocationFormContent = ({ setOpenLocationDialog, start_lat, start_lng }) => { + return ( + <> + + + + + + + + + + + + ); +}; +export default LocationFormContent; diff --git a/src/components/dashboard/fastReact/operator/RowActions/LocationDialog/index.jsx b/src/components/dashboard/fastReact/operator/RowActions/LocationDialog/index.jsx new file mode 100644 index 0000000..09df6ad --- /dev/null +++ b/src/components/dashboard/fastReact/operator/RowActions/LocationDialog/index.jsx @@ -0,0 +1,36 @@ +import React, { useState } from "react"; +import { Tooltip, IconButton, Dialog, DialogTitle } from "@mui/material"; +import ExploreIcon from "@mui/icons-material/Explore"; +import LocationFormContent from "./LocationFormContent"; +const LocationForm = ({ start_lat, start_lng }) => { + const [openLocationDialog, setOpenLocationDialog] = useState(false); + + return ( + <> + + setOpenLocationDialog(true)}> + + + + setOpenLocationDialog(false)} + PaperProps={{ + sx: { + boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px", + }, + }} + dir="rtl" + maxWidth={"md"} + > + موقعیت + + + + ); +}; +export default LocationForm; diff --git a/src/components/dashboard/fastReact/operator/RowActions/index.jsx b/src/components/dashboard/fastReact/operator/RowActions/index.jsx new file mode 100644 index 0000000..9fb298d --- /dev/null +++ b/src/components/dashboard/fastReact/operator/RowActions/index.jsx @@ -0,0 +1,6 @@ +import { Box } from "@mui/material"; + +const RowActions = ({ row, mutate }) => { + return ; +}; +export default RowActions; diff --git a/src/components/dashboard/fastReact/operator/Toolbar.jsx b/src/components/dashboard/fastReact/operator/Toolbar.jsx new file mode 100644 index 0000000..479ae4e --- /dev/null +++ b/src/components/dashboard/fastReact/operator/Toolbar.jsx @@ -0,0 +1,13 @@ +import PrintExcel from "./ExcelPrint"; +import ComplaintList from "../complaintList"; +import { Stack } from "@mui/material"; + +const Toolbar = ({ table, filterData, mutate }) => { + return ( + + + + + ); +}; +export default Toolbar; diff --git a/src/components/dashboard/fastReact/operator/index.jsx b/src/components/dashboard/fastReact/operator/index.jsx new file mode 100644 index 0000000..85759c2 --- /dev/null +++ b/src/components/dashboard/fastReact/operator/index.jsx @@ -0,0 +1,15 @@ +"use client"; +import PageTitle from "@/core/components/PageTitle"; +import { Stack } from "@mui/material"; +import SupervisorList from "./OperatorList"; +import OperatorList from "./OperatorList"; + +const OperatorPage = () => { + return ( + + + + + ); +}; +export default OperatorPage; diff --git a/src/components/dashboard/fastReact/supervisor/RowActions/index.jsx b/src/components/dashboard/fastReact/supervisor/RowActions/index.jsx index ad2e492..bf60960 100644 --- a/src/components/dashboard/fastReact/supervisor/RowActions/index.jsx +++ b/src/components/dashboard/fastReact/supervisor/RowActions/index.jsx @@ -1,20 +1,20 @@ -import {Box} from "@mui/material"; +import { Box } from "@mui/material"; import ConfirmForm from "./ConfirmDialog"; import RejectForm from "./RejectDialog"; -import {usePermissions} from "@/lib/hooks/usePermissions"; +import { usePermissions } from "@/lib/hooks/usePermissions"; -const RowActions = ({row, mutate}) => { - const {data: userPermissions} = usePermissions(); +const RowActions = ({ row, mutate }) => { + const { data: userPermissions } = usePermissions(); const hasSupervisePermission = userPermissions.some((item) => ["supervise-fast-react", "supervise-fast-react-province"].includes(item) ); return ( - + {hasSupervisePermission && row.original?.status === 0 && ( - + )} - {hasSupervisePermission && row.original?.status === 0 &&( - + {hasSupervisePermission && row.original?.status === 0 && ( + )} ); diff --git a/src/core/utils/pageMenu.js b/src/core/utils/pageMenu.js index 2eaf65b..1811e60 100644 --- a/src/core/utils/pageMenu.js +++ b/src/core/utils/pageMenu.js @@ -374,14 +374,6 @@ export const pageMenu = [ }, ], }, - { - id: "roadObservationsManagmentList", - label: "رسیدگی به شکایات", - type: "page", - route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_observations", - icon: , - permissions: ["show-fast-react", "show-fast-react-province", "show-fast-react-edarate-shahri"], - }, { id: "roadObservationsManagmentOparation", label: "عملیات", @@ -394,8 +386,8 @@ export const pageMenu = [ id: "roadObservationsManagmentOparationCartable", label: "کارتابل", type: "page", - route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_observations/operator/cartable", - permissions: ["show-fast-react", "show-fast-react-province", "show-fast-react-edarate-shahri"], + route: "/dashboard/fast-react/operator", + permissions: ["show-fast-react-edarate-shahri"], }, ], }, diff --git a/src/core/utils/routes.js b/src/core/utils/routes.js index 21e97b8..ed9e8c1 100644 --- a/src/core/utils/routes.js +++ b/src/core/utils/routes.js @@ -116,3 +116,5 @@ export const GET_FAST_REACT_SUPERVISOR = api + "/api/v3/road_observations/superv export const GET_FAST_REACT_COMPLAINTS = api + "/api/v3/road_observations/complaints_index"; export const VERIFY_BY_FAST_REACT_SUPERVISOR = api + "/api/v3/road_observations/verify"; export const REJECT_BY_FAST_REACT_SUPERVISOR = api + "/api/v3/road_observations/verify"; +export const GET_FAST_REACT_OPERATOR = api + "/api/v3/road_observations/operator_index"; +export const GET_FAST_REACT_REFER_LIST = api + "/api/v3/road_observations/refer_list";