From 65beffa11eb5fbc904cb0c978bbb028b9538d2b2 Mon Sep 17 00:00:00 2001 From: AminGhasempoor Date: Wed, 26 Nov 2025 11:33:09 +0330 Subject: [PATCH 1/3] general manager show --- .../inquiry-privacy/general-manager/page.js | 3 +- .../general-manager/GeneralManagerList.jsx | 243 ++++++++++++++++++ .../RowActions/ConfirmAction/index.jsx | 17 ++ .../RowActions/RejectAction/index.jsx | 17 ++ .../general-manager/RowActions/index.jsx | 13 + .../ShowPrimaryArea/ShowBound.jsx | 29 +++ .../general-manager/ShowPrimaryArea/index.jsx | 69 +++++ .../inquiryPrivacy/general-manager/index.jsx | 14 + src/core/utils/routes.js | 1 + 9 files changed, 405 insertions(+), 1 deletion(-) create mode 100644 src/components/dashboard/inquiryPrivacy/general-manager/GeneralManagerList.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/general-manager/RowActions/ConfirmAction/index.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/general-manager/RowActions/RejectAction/index.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/general-manager/RowActions/index.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/general-manager/ShowPrimaryArea/ShowBound.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/general-manager/ShowPrimaryArea/index.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/general-manager/index.jsx diff --git a/src/app/(withAuth)/(dashboardLayout)/dashboard/inquiry-privacy/general-manager/page.js b/src/app/(withAuth)/(dashboardLayout)/dashboard/inquiry-privacy/general-manager/page.js index e24a103..763114c 100644 --- a/src/app/(withAuth)/(dashboardLayout)/dashboard/inquiry-privacy/general-manager/page.js +++ b/src/app/(withAuth)/(dashboardLayout)/dashboard/inquiry-privacy/general-manager/page.js @@ -1,11 +1,12 @@ import WithPermission from "@/core/middlewares/withPermission"; +import GeneralManagerPage from "@/components/dashboard/inquiryPrivacy/general-manager"; export const metadata = { title: "کارتابل مدیر", }; const Page = () => { return ( -

کارتابل مدیر

+
); }; diff --git a/src/components/dashboard/inquiryPrivacy/general-manager/GeneralManagerList.jsx b/src/components/dashboard/inquiryPrivacy/general-manager/GeneralManagerList.jsx new file mode 100644 index 0000000..4abd643 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/general-manager/GeneralManagerList.jsx @@ -0,0 +1,243 @@ +import CustomSelectByDependency from "@/core/components/DataTable/filter/fieldsType/CustomSelectByDependency"; +import DataTableWithAuth from "@/core/components/DataTableWithAuth"; +import useInquiryPrivacyState from "@/lib/hooks/useInquiryPrivacyState"; +import AutorenewIcon from "@mui/icons-material/Autorenew"; +import DangerousIcon from "@mui/icons-material/Dangerous"; +import ManageAccountsIcon from "@mui/icons-material/ManageAccounts"; +import MapsHomeWorkIcon from "@mui/icons-material/MapsHomeWork"; +import PsychologyAltIcon from "@mui/icons-material/PsychologyAlt"; +import ReceiptLongIcon from "@mui/icons-material/ReceiptLong"; +import SecurityIcon from "@mui/icons-material/Security"; +import WindowIcon from "@mui/icons-material/Window"; +import { Box, Stack } from "@mui/material"; +import moment from "jalali-moment"; +import { useMemo } from "react"; +import RowActions from "./RowActions"; +import { GET_GENERAL_MANAGER_LIST } from "@/core/utils/routes"; +import ShowPrimaryArea from "./ShowPrimaryArea"; + +const GeneralManagerList = () => { + const stateIcon = (state_id) => { + if (state_id === 1) return ; + if (state_id === 2 || state_id === 5 || state_id === 13) return ; + if (state_id === 3 || state_id === 6 || state_id === 14) + return ; + if (state_id === 4 || state_id === 7 || state_id === 15) return ; + if (state_id === 8) return ; + if (state_id === 9 || state_id === 11) return ; + if (state_id === 10) return ; + if (state_id === 12) return ; + }; + const columns = useMemo(() => { + return [ + { + accessorKey: "panjare_vahed_id", + header: "کدرهگیری درخواست", + id: "panjare_vahed_id", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + Cell: ({ row }) => <>{row.original.panjare_vahed_id}, + }, + { + accessorKey: "national_id", + header: "کد ملی", + id: "national_id", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + Cell: ({ row }) => <>{row.original.national_id}, + }, + { + accessorKey: "state_id", + header: "وضعیت", + id: "state_id", + enableColumnFilter: true, + datatype: "numeric", + filterMode: "equals", + sortDescFirst: false, + grow: false, + size: 100, + ColumnSelectComponent: (props) => { + const { itemsList, loadingItemsList, errorItemsList } = useInquiryPrivacyState(); + + const getColumnSelectOptions = useMemo(() => { + if (loadingItemsList) { + return [{ value: "loading", label: "در حال بارگذاری..." }]; + } + if (errorItemsList) { + return [{ value: "error", label: "خطا در بارگذاری" }]; + } + return [ + { value: "", label: "همه موارد" }, + ...itemsList.map((item) => ({ + value: item.id, + label: item.name, + })), + ]; + }, [itemsList, loadingItemsList, errorItemsList]); + + return ( + + ); + }, + Cell: ({ row }) => ( + + {stateIcon(row.original.state_id)} + + {row.original.state_name} + + + ), + }, + { + accessorKey: "plan_title", + header: "عنوان طرح", + id: "plan_title", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + Cell: ({ row }) => <>{row.original.plan_title}, + }, + { + accessorKey: "plan_group", + header: "گروه طرح", + id: "plan_group", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + Cell: ({ row }) => <>{row.original.plan_group}, + }, + { + accessorKey: "requested_organization", + header: "دستگاه صادر کننده", + id: "requested_organization", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + Cell: ({ row }) => <>{row.original.requested_organization}, + }, + { + accessorKey: "worksheet_id", + header: "شناسه کاربرگ", + id: "worksheet_id", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + Cell: ({ row }) => <>{row.original.worksheet_id}, + }, + { + accessorKey: "primary_area", + header: "نمایش محدوده طرح", + id: "primary_area", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + Cell: ({ row }) => + row.original.primary_area ? ( + + + + ) : ( + "-" + ), + }, + { + accessorKey: "province_id", + header: "استان", + id: "province_id", + enableColumnFilter: false, + datatype: "numeric", + sortDescFirst: false, + grow: false, + size: 100, + Cell: ({ row }) => <>{row.original.province_name}, + }, + { + accessorKey: "city_id", + header: "شهر", + id: "city_id", + enableColumnFilter: false, + datatype: "numeric", + sortDescFirst: false, + grow: false, + size: 100, + Cell: ({ row }) => <>{row.original.city_name}, + }, + { + accessorKey: "isic", + header: "کد آیسیک", + id: "isic", + enableColumnFilter: true, + datatype: "text", + filterMode: "equals", + sortDescFirst: false, + columnFilterModeOptions: ["equals", "contains"], + grow: false, + size: 100, + Cell: ({ row }) => <>{row.original.isic}, + }, + { + accessorFn: (row) => moment(row.request_date).locale("fa").format("YYYY/MM/DD"), + header: "تاریخ درخواست", + id: "request_date", + enableColumnFilter: true, + datatype: "date", + filterMode: "between", + grow: false, + size: 100, + }, + ]; + }, []); + + return ( + <> + + + + + ); +}; + +export default GeneralManagerList; diff --git a/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/ConfirmAction/index.jsx b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/ConfirmAction/index.jsx new file mode 100644 index 0000000..c2a0cfc --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/ConfirmAction/index.jsx @@ -0,0 +1,17 @@ +import ThumbUpIcon from "@mui/icons-material/ThumbUp"; +import { IconButton, Tooltip } from "@mui/material"; +import { useState } from "react"; + +const ConfirmAction = ({ rowId, mutate }) => { + const [openConfirmDialog, setOpenConfirmDialog] = useState(false); + return ( + <> + + setOpenConfirmDialog(true)}> + + + + + ); +}; +export default ConfirmAction; diff --git a/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/RejectAction/index.jsx b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/RejectAction/index.jsx new file mode 100644 index 0000000..c16a405 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/RejectAction/index.jsx @@ -0,0 +1,17 @@ +import ThumbDownIcon from "@mui/icons-material/ThumbDown"; +import { IconButton, Tooltip } from "@mui/material"; +import { useState } from "react"; + +const RejectAction = ({ rowId, mutate }) => { + const [openRejectDialog, setOpenRejectDialog] = useState(false); + return ( + <> + + setOpenRejectDialog(true)}> + + + + + ); +}; +export default RejectAction; diff --git a/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/index.jsx b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/index.jsx new file mode 100644 index 0000000..06ea132 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/index.jsx @@ -0,0 +1,13 @@ +import { Box } from "@mui/material"; +import ConfirmAction from "./ConfirmAction"; +import RejectAction from "./RejectAction"; + +const RowActions = ({ row, mutate }) => { + return ( + + + + + ); +}; +export default RowActions; diff --git a/src/components/dashboard/inquiryPrivacy/general-manager/ShowPrimaryArea/ShowBound.jsx b/src/components/dashboard/inquiryPrivacy/general-manager/ShowPrimaryArea/ShowBound.jsx new file mode 100644 index 0000000..24db476 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/general-manager/ShowPrimaryArea/ShowBound.jsx @@ -0,0 +1,29 @@ +import { useEffect, useRef } from "react"; +import { FeatureGroup, useMap } from "react-leaflet"; + +const ShowBound = ({ bound }) => { + const map = useMap(); + const featureRef = useRef(null); + + const safeFitBounds = (layer) => { + if (!layer || !map) return; + try { + const latLngs = layer.getLatLngs(); + map.fitBounds(latLngs, { + paddingTopLeft: [20, 20], + paddingBottomRight: [20, 20], + }); + } catch (e) { + console.warn("fitBounds failed:", e); + } + }; + + useEffect(() => { + bound?.editing?.disable(); + featureRef.current.addLayer(bound); + safeFitBounds(bound); + }, []); + + return ; +}; +export default ShowBound; diff --git a/src/components/dashboard/inquiryPrivacy/general-manager/ShowPrimaryArea/index.jsx b/src/components/dashboard/inquiryPrivacy/general-manager/ShowPrimaryArea/index.jsx new file mode 100644 index 0000000..98e24d0 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/general-manager/ShowPrimaryArea/index.jsx @@ -0,0 +1,69 @@ +const { + Button, + IconButton, + Tooltip, + Box, + Dialog, + DialogTitle, + Typography, + DialogContent, + DialogActions, +} = require("@mui/material"); +import LayersIcon from "@mui/icons-material/Layers"; +import CloseIcon from "@mui/icons-material/Close"; +import { useMemo, useState } from "react"; +import MapLayer from "@/core/components/MapLayer"; +import ShowBound from "./ShowBound"; + +const ShowPrimaryArea = ({ primaryArea }) => { + const [openShowAreaDialog, setOpenShowAreaDialog] = useState(false); + const bound = useMemo(() => { + const latLngCoords = primaryArea.coordinates.map((coord) => [coord[1], coord[0]]); + return primaryArea.type === "polygon" ? L.polygon(latLngCoords) : L.polyline(latLngCoords); + }, [primaryArea]); + + return ( + + + setOpenShowAreaDialog(true)}> + + + + setOpenShowAreaDialog(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" + > + + + محدوده طرح + + setOpenShowAreaDialog(false)} size="small"> + + + + + + + + + + + + + + + ); +}; + +export default ShowPrimaryArea; diff --git a/src/components/dashboard/inquiryPrivacy/general-manager/index.jsx b/src/components/dashboard/inquiryPrivacy/general-manager/index.jsx new file mode 100644 index 0000000..3e166e3 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/general-manager/index.jsx @@ -0,0 +1,14 @@ +"use client"; +import PageTitle from "@/core/components/PageTitle"; +import { Stack } from "@mui/material"; +import GeneralManagerList from "./GeneralManagerList"; + +const GeneralManagerPage = () => { + return ( + + + + + ); +}; +export default GeneralManagerPage; diff --git a/src/core/utils/routes.js b/src/core/utils/routes.js index 8572b6f..a2e65a9 100644 --- a/src/core/utils/routes.js +++ b/src/core/utils/routes.js @@ -240,3 +240,4 @@ export const GET_CITY_ADMIN_LIST = api + "/api/v3/harim/province_office"; export const GET_INQUIRY_PRIVACY_STATE_LIST = api + "/api/v3/harim/detail/states"; export const CITY_ADMIN_FEEDBACK = api + "/api/v3/harim/province_office/feedback"; export const GET_PRIVACY_ADMIN_LIST = api + "/api/v3/harim/harim_office"; +export const GET_GENERAL_MANAGER_LIST = api + "/api/v3/harim/general_manager"; From efe47523a20d09b94f150a590f6099791016356b Mon Sep 17 00:00:00 2001 From: AminGhasempoor Date: Wed, 26 Nov 2025 15:06:53 +0330 Subject: [PATCH 2/3] harim manager --- .../RowActions/History/HistoryContent.jsx | 17 ++++++ .../RowActions/History/TableContent.jsx | 56 +++++++++++++++++++ .../city-admin/RowActions/History/index.jsx | 33 +++++++++++ .../city-admin/RowActions/index.jsx | 2 + .../RowActions/History/HistoryContent.jsx | 17 ++++++ .../RowActions/History/TableContent.jsx | 56 +++++++++++++++++++ .../RowActions/History/index.jsx | 33 +++++++++++ .../general-manager/RowActions/index.jsx | 9 +++ .../RowActions/ConfirmAction/index.jsx | 1 + .../RowActions/History/HistoryContent.jsx | 17 ++++++ .../RowActions/History/TableContent.jsx | 56 +++++++++++++++++++ .../RowActions/History/index.jsx | 33 +++++++++++ .../RowActions/ReferralAction/index.jsx | 1 + .../RowActions/RejectAction/index.jsx | 1 + .../privacy-office/RowActions/index.jsx | 2 + .../RowActions/History/HistoryContent.jsx | 17 ++++++ .../RowActions/History/TableContent.jsx | 56 +++++++++++++++++++ .../RowActions/History/index.jsx | 33 +++++++++++ src/core/utils/routes.js | 3 + src/lib/hooks/useHistory.js | 30 ++++++++++ 20 files changed, 473 insertions(+) create mode 100644 src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/HistoryContent.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/TableContent.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/index.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/HistoryContent.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/TableContent.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/index.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/HistoryContent.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/TableContent.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/index.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/HistoryContent.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/TableContent.jsx create mode 100644 src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/index.jsx create mode 100644 src/lib/hooks/useHistory.js diff --git a/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/HistoryContent.jsx b/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/HistoryContent.jsx new file mode 100644 index 0000000..71f59c1 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/HistoryContent.jsx @@ -0,0 +1,17 @@ +import { Button, DialogActions, DialogContent } from "@mui/material"; +import TableContent from "./TableContent"; +const HistoryContent = ({ setOpenReferReasonDialog, rowId }) => { + return ( + <> + + + + + + + + ); +}; +export default HistoryContent; diff --git a/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/TableContent.jsx b/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/TableContent.jsx new file mode 100644 index 0000000..cd3afb0 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/TableContent.jsx @@ -0,0 +1,56 @@ +import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress, Typography } from "@mui/material"; +import "moment/locale/fa"; +import { useHistory } from "@/lib/hooks/useHistory"; + +const TableContent = ({ rowId }) => { + const { historyData, loading, error } = useHistory(rowId); + + if (loading) { + return ( + + + + ); + } + + if (error) { + return ( + + {error} + + ); + } + + if (!historyData.length) { + return ( + + اطلاعاتی وجود ندارد + + ); + } + + return ( + + + + + + وضعیت + توضیحات کارشناس + + + + {historyData.map((row) => ( + + {row.previous_state_name} + {row.expert_description} + + ))} + +
+
+
+ ); +}; + +export default TableContent; diff --git a/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/index.jsx b/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/index.jsx new file mode 100644 index 0000000..234ac15 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/index.jsx @@ -0,0 +1,33 @@ +import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material"; +import { RestorePage } from "@mui/icons-material"; +import HistoryContent from "./HistoryContent"; +import { useState } from "react"; + +const History = ({ rowId }) => { + const [openReferReasonDialog, setOpenReferReasonDialog] = useState(false); + + return ( + <> + + setOpenReferReasonDialog(true)}> + + + + + تاریخچه + + + + ); +}; + +export default History; diff --git a/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/index.jsx b/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/index.jsx index cb1517b..a432d18 100644 --- a/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/index.jsx @@ -1,5 +1,6 @@ import { Box } from "@mui/material"; import FeedbackAction from "./FeedbackAction"; +import History from "./History"; const RowActions = ({ row, mutate }) => { return ( @@ -9,6 +10,7 @@ const RowActions = ({ row, mutate }) => { ) : ( "-" )} + ); }; diff --git a/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/HistoryContent.jsx b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/HistoryContent.jsx new file mode 100644 index 0000000..71f59c1 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/HistoryContent.jsx @@ -0,0 +1,17 @@ +import { Button, DialogActions, DialogContent } from "@mui/material"; +import TableContent from "./TableContent"; +const HistoryContent = ({ setOpenReferReasonDialog, rowId }) => { + return ( + <> + + + + + + + + ); +}; +export default HistoryContent; diff --git a/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/TableContent.jsx b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/TableContent.jsx new file mode 100644 index 0000000..cd3afb0 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/TableContent.jsx @@ -0,0 +1,56 @@ +import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress, Typography } from "@mui/material"; +import "moment/locale/fa"; +import { useHistory } from "@/lib/hooks/useHistory"; + +const TableContent = ({ rowId }) => { + const { historyData, loading, error } = useHistory(rowId); + + if (loading) { + return ( + + + + ); + } + + if (error) { + return ( + + {error} + + ); + } + + if (!historyData.length) { + return ( + + اطلاعاتی وجود ندارد + + ); + } + + return ( + + + + + + وضعیت + توضیحات کارشناس + + + + {historyData.map((row) => ( + + {row.previous_state_name} + {row.expert_description} + + ))} + +
+
+
+ ); +}; + +export default TableContent; diff --git a/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/index.jsx b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/index.jsx new file mode 100644 index 0000000..234ac15 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/index.jsx @@ -0,0 +1,33 @@ +import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material"; +import { RestorePage } from "@mui/icons-material"; +import HistoryContent from "./HistoryContent"; +import { useState } from "react"; + +const History = ({ rowId }) => { + const [openReferReasonDialog, setOpenReferReasonDialog] = useState(false); + + return ( + <> + + setOpenReferReasonDialog(true)}> + + + + + تاریخچه + + + + ); +}; + +export default History; diff --git a/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/index.jsx b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/index.jsx index 06ea132..1251678 100644 --- a/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/index.jsx @@ -1,12 +1,21 @@ import { Box } from "@mui/material"; import ConfirmAction from "./ConfirmAction"; import RejectAction from "./RejectAction"; +import History from "./History"; const RowActions = ({ row, mutate }) => { + // const stateId = row.original.state_id; + // + // const disabled = { + // referral: stateId !== 2, + // reject: stateId !== 2 && stateId !== 5, + // confirm: stateId !== 2 && stateId !== 5 && stateId !== 13, + // }; return ( + ); }; diff --git a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ConfirmAction/index.jsx b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ConfirmAction/index.jsx index 7820320..3903560 100644 --- a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ConfirmAction/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ConfirmAction/index.jsx @@ -2,6 +2,7 @@ import ThumbUpIcon from "@mui/icons-material/ThumbUp"; import { IconButton, Tooltip } from "@mui/material"; const ConfirmAction = ({ onClick, disabled }) => { + if (disabled) return return ( <> diff --git a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/HistoryContent.jsx b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/HistoryContent.jsx new file mode 100644 index 0000000..71f59c1 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/HistoryContent.jsx @@ -0,0 +1,17 @@ +import { Button, DialogActions, DialogContent } from "@mui/material"; +import TableContent from "./TableContent"; +const HistoryContent = ({ setOpenReferReasonDialog, rowId }) => { + return ( + <> + + + + + + + + ); +}; +export default HistoryContent; diff --git a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/TableContent.jsx b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/TableContent.jsx new file mode 100644 index 0000000..cd3afb0 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/TableContent.jsx @@ -0,0 +1,56 @@ +import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress, Typography } from "@mui/material"; +import "moment/locale/fa"; +import { useHistory } from "@/lib/hooks/useHistory"; + +const TableContent = ({ rowId }) => { + const { historyData, loading, error } = useHistory(rowId); + + if (loading) { + return ( + + + + ); + } + + if (error) { + return ( + + {error} + + ); + } + + if (!historyData.length) { + return ( + + اطلاعاتی وجود ندارد + + ); + } + + return ( + + + + + + وضعیت + توضیحات کارشناس + + + + {historyData.map((row) => ( + + {row.previous_state_name} + {row.expert_description} + + ))} + +
+
+
+ ); +}; + +export default TableContent; diff --git a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/index.jsx b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/index.jsx new file mode 100644 index 0000000..234ac15 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/index.jsx @@ -0,0 +1,33 @@ +import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material"; +import { RestorePage } from "@mui/icons-material"; +import HistoryContent from "./HistoryContent"; +import { useState } from "react"; + +const History = ({ rowId }) => { + const [openReferReasonDialog, setOpenReferReasonDialog] = useState(false); + + return ( + <> + + setOpenReferReasonDialog(true)}> + + + + + تاریخچه + + + + ); +}; + +export default History; diff --git a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ReferralAction/index.jsx b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ReferralAction/index.jsx index 85a693f..a5326f5 100644 --- a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ReferralAction/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ReferralAction/index.jsx @@ -2,6 +2,7 @@ import { Reply } from "@mui/icons-material"; import { IconButton, Tooltip } from "@mui/material"; const ReferralAction = ({ onClick, disabled }) => { + if (disabled) return return ( <> diff --git a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/RejectAction/index.jsx b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/RejectAction/index.jsx index e467e87..a4647b7 100644 --- a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/RejectAction/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/RejectAction/index.jsx @@ -2,6 +2,7 @@ import ThumbDownIcon from "@mui/icons-material/ThumbDown"; import { IconButton, Tooltip } from "@mui/material"; const RejectAction = ({ onClick, disabled }) => { + if (disabled) return return ( <> diff --git a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/index.jsx b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/index.jsx index 6cc004d..ed3df15 100644 --- a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/index.jsx @@ -4,6 +4,7 @@ import ActionDialog from "./ActionsDialog"; import ConfirmAction from "./ConfirmAction"; import ReferralAction from "./ReferralAction"; import RejectAction from "./RejectAction"; +import History from "./History"; const RowActions = ({ row: { original }, mutate }) => { const [modal, setModal] = useState({ @@ -31,6 +32,7 @@ const RowActions = ({ row: { original }, mutate }) => { return ( <> + handleOpenModal("refer_request", original)} disabled={disabled.referral} diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/HistoryContent.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/HistoryContent.jsx new file mode 100644 index 0000000..71f59c1 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/HistoryContent.jsx @@ -0,0 +1,17 @@ +import { Button, DialogActions, DialogContent } from "@mui/material"; +import TableContent from "./TableContent"; +const HistoryContent = ({ setOpenReferReasonDialog, rowId }) => { + return ( + <> + + + + + + + + ); +}; +export default HistoryContent; diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/TableContent.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/TableContent.jsx new file mode 100644 index 0000000..cd3afb0 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/TableContent.jsx @@ -0,0 +1,56 @@ +import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress, Typography } from "@mui/material"; +import "moment/locale/fa"; +import { useHistory } from "@/lib/hooks/useHistory"; + +const TableContent = ({ rowId }) => { + const { historyData, loading, error } = useHistory(rowId); + + if (loading) { + return ( + + + + ); + } + + if (error) { + return ( + + {error} + + ); + } + + if (!historyData.length) { + return ( + + اطلاعاتی وجود ندارد + + ); + } + + return ( + + + + + + وضعیت + توضیحات کارشناس + + + + {historyData.map((row) => ( + + {row.previous_state_name} + {row.expert_description} + + ))} + +
+
+
+ ); +}; + +export default TableContent; diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/index.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/index.jsx new file mode 100644 index 0000000..234ac15 --- /dev/null +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/index.jsx @@ -0,0 +1,33 @@ +import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material"; +import { RestorePage } from "@mui/icons-material"; +import HistoryContent from "./HistoryContent"; +import { useState } from "react"; + +const History = ({ rowId }) => { + const [openReferReasonDialog, setOpenReferReasonDialog] = useState(false); + + return ( + <> + + setOpenReferReasonDialog(true)}> + + + + + تاریخچه + + + + ); +}; + +export default History; diff --git a/src/core/utils/routes.js b/src/core/utils/routes.js index f479220..bbbe9f3 100644 --- a/src/core/utils/routes.js +++ b/src/core/utils/routes.js @@ -243,3 +243,6 @@ export const GET_PRIVACY_ADMIN_LIST = api + "/api/v3/harim/harim_office"; export const PRIVACY_ADMIN_ACTION_API = api + "/api/v3/harim/harim_office"; export const GET_INQUIRY_PRIVACY_TABLE_LIST = api + "/api/v3/harim/technical_deputy"; export const GET_GENERAL_MANAGER_LIST = api + "/api/v3/harim/general_manager"; + +// History +export const GET_HISTORY_LIST = api + "/api/v3/harim/detail/histories"; diff --git a/src/lib/hooks/useHistory.js b/src/lib/hooks/useHistory.js new file mode 100644 index 0000000..df1836c --- /dev/null +++ b/src/lib/hooks/useHistory.js @@ -0,0 +1,30 @@ +import { useState, useEffect } from "react"; +import useRequest from "@/lib/hooks/useRequest"; +import { GET_HISTORY_LIST } from "@/core/utils/routes"; + +export const useHistory = (rowId) => { + const requestServer = useRequest(); + const [historyData, setHistoryData] = useState([]); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + + useEffect(() => { + if (!rowId) return; + + const fetchHistory = async () => { + try { + setLoading(true); + const response = await requestServer(`${GET_HISTORY_LIST}/${rowId}`); + setHistoryData(response.data.data); + } catch (err) { + setError(err.message); + } finally { + setLoading(false); + } + }; + + fetchHistory(); + }, [rowId]); + + return { historyData, loading, error }; +}; From f2456bba795f0ffa95ce1230553bda53df305795 Mon Sep 17 00:00:00 2001 From: AminGhasempoor Date: Wed, 26 Nov 2025 15:10:56 +0330 Subject: [PATCH 3/3] build and format --- .../RowActions/History/TableContent.jsx | 12 ++++++- .../RowActions/History/TableContent.jsx | 12 ++++++- .../RowActions/ConfirmAction/index.jsx | 2 +- .../RowActions/History/TableContent.jsx | 12 ++++++- .../RowActions/ReferralAction/index.jsx | 2 +- .../RowActions/RejectAction/index.jsx | 2 +- .../PrevCartableOpinion.jsx | 5 +-- .../Questions/QuestionVerifyNeedRoadForm.jsx | 7 +--- .../QuestionVerifyRoadSafetyForm.jsx | 7 +--- .../Questions/Refer/index.jsx | 34 +++++++++++++++---- .../ConfirmRoadSafetyFormContext.jsx | 13 ++----- .../PrevCartableOpinion.jsx | 5 +-- .../Questions/QuestionVerifyNeedRoadForm.jsx | 7 +--- .../QuestionVerifyRoadSafetyForm.jsx | 7 +--- .../Questions/Refer/Form.jsx | 20 +++++++---- .../Questions/Refer/index.jsx | 34 +++++++++++++++---- .../Questions/index.jsx | 27 ++++++++++----- .../ConfirmRoadSafetyDialog.jsx | 13 ++++--- .../ConfirmRoadSafetyFormContext.jsx | 13 ++----- .../PrevCartableOpinion.jsx | 5 +-- .../Questions/QuestionVerifyNeedRoadForm.jsx | 7 +--- .../Questions/Refer/Form.jsx | 20 +++++++---- .../Questions/Refer/index.jsx | 34 +++++++++++++++---- .../Questions/index.jsx | 22 +++++++----- .../RowActions/History/TableContent.jsx | 12 ++++++- 25 files changed, 215 insertions(+), 119 deletions(-) diff --git a/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/TableContent.jsx b/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/TableContent.jsx index cd3afb0..b405a41 100644 --- a/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/TableContent.jsx +++ b/src/components/dashboard/inquiryPrivacy/city-admin/RowActions/History/TableContent.jsx @@ -1,4 +1,14 @@ -import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress, Typography } from "@mui/material"; +import { + Box, + Table, + TableBody, + TableCell, + TableContainer, + TableHead, + TableRow, + CircularProgress, + Typography, +} from "@mui/material"; import "moment/locale/fa"; import { useHistory } from "@/lib/hooks/useHistory"; diff --git a/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/TableContent.jsx b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/TableContent.jsx index cd3afb0..b405a41 100644 --- a/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/TableContent.jsx +++ b/src/components/dashboard/inquiryPrivacy/general-manager/RowActions/History/TableContent.jsx @@ -1,4 +1,14 @@ -import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress, Typography } from "@mui/material"; +import { + Box, + Table, + TableBody, + TableCell, + TableContainer, + TableHead, + TableRow, + CircularProgress, + Typography, +} from "@mui/material"; import "moment/locale/fa"; import { useHistory } from "@/lib/hooks/useHistory"; diff --git a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ConfirmAction/index.jsx b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ConfirmAction/index.jsx index 3903560..230e4c7 100644 --- a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ConfirmAction/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ConfirmAction/index.jsx @@ -2,7 +2,7 @@ import ThumbUpIcon from "@mui/icons-material/ThumbUp"; import { IconButton, Tooltip } from "@mui/material"; const ConfirmAction = ({ onClick, disabled }) => { - if (disabled) return + if (disabled) return; return ( <> diff --git a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/TableContent.jsx b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/TableContent.jsx index cd3afb0..b405a41 100644 --- a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/TableContent.jsx +++ b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/History/TableContent.jsx @@ -1,4 +1,14 @@ -import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress, Typography } from "@mui/material"; +import { + Box, + Table, + TableBody, + TableCell, + TableContainer, + TableHead, + TableRow, + CircularProgress, + Typography, +} from "@mui/material"; import "moment/locale/fa"; import { useHistory } from "@/lib/hooks/useHistory"; diff --git a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ReferralAction/index.jsx b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ReferralAction/index.jsx index a5326f5..46d36c3 100644 --- a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ReferralAction/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/ReferralAction/index.jsx @@ -2,7 +2,7 @@ import { Reply } from "@mui/icons-material"; import { IconButton, Tooltip } from "@mui/material"; const ReferralAction = ({ onClick, disabled }) => { - if (disabled) return + if (disabled) return; return ( <> diff --git a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/RejectAction/index.jsx b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/RejectAction/index.jsx index a4647b7..47b3382 100644 --- a/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/RejectAction/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/privacy-office/RowActions/RejectAction/index.jsx @@ -2,7 +2,7 @@ import ThumbDownIcon from "@mui/icons-material/ThumbDown"; import { IconButton, Tooltip } from "@mui/material"; const RejectAction = ({ onClick, disabled }) => { - if (disabled) return + if (disabled) return; return ( <> diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/PrevCartableOpinion.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/PrevCartableOpinion.jsx index 37fe672..f6ca361 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/PrevCartableOpinion.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/PrevCartableOpinion.jsx @@ -1,12 +1,13 @@ import { Card, CardContent, CircularProgress, Stack, Typography } from "@mui/material"; const PrevCartableOpinion = ({ item }) => { - return ( - {item.previous_state_name}: {item.action_name} + + {item.previous_state_name}: {item.action_name} + توضیحات: {item.expert_description} diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/Questions/QuestionVerifyNeedRoadForm.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/Questions/QuestionVerifyNeedRoadForm.jsx index 0a9a724..747d178 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/Questions/QuestionVerifyNeedRoadForm.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/Questions/QuestionVerifyNeedRoadForm.jsx @@ -1,9 +1,4 @@ -import { - Card, - CardContent, - Stack, - Typography -} from "@mui/material"; +import { Card, CardContent, Stack, Typography } from "@mui/material"; const QuestionVerifyNeedRoadForm = ({ row }) => { return ( diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/Questions/QuestionVerifyRoadSafetyForm.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/Questions/QuestionVerifyRoadSafetyForm.jsx index 1775856..3da9f78 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/Questions/QuestionVerifyRoadSafetyForm.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/Questions/QuestionVerifyRoadSafetyForm.jsx @@ -1,9 +1,4 @@ -import { - Card, - CardContent, - Stack, - Typography -} from "@mui/material"; +import { Card, CardContent, Stack, Typography } from "@mui/material"; const QuestionVerifyRoadSafetyForm = ({ row }) => { return ( diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/Questions/Refer/index.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/Questions/Refer/index.jsx index 1fc664c..e18024f 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/Questions/Refer/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmRoadSafetyForm/Questions/Refer/index.jsx @@ -1,5 +1,5 @@ import { Close } from "@mui/icons-material"; -import { Button, Dialog, DialogTitle, IconButton } from "@mui/material" +import { Button, Dialog, DialogTitle, IconButton } from "@mui/material"; import { useState } from "react"; import ReferForm from "./Form"; @@ -8,10 +8,23 @@ const Refer = ({ rowId, mutate, handleClose, isSubmitting }) => { return ( <> - - { setOpenReferDialog(false) }} maxWidth="xs" fullWidth> + { + setOpenReferDialog(false); + }} + maxWidth="xs" + fullWidth + > setOpenReferDialog(false)} @@ -26,9 +39,16 @@ const Refer = ({ rowId, mutate, handleClose, isSubmitting }) => { مخالفت و ارجاع به دفتر حریم - {openReferDialog && } + {openReferDialog && ( + + )} - ) -} -export default Refer \ No newline at end of file + ); +}; +export default Refer; diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/ConfirmRoadSafetyFormContext.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/ConfirmRoadSafetyFormContext.jsx index 41e1139..fb3834f 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/ConfirmRoadSafetyFormContext.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/ConfirmRoadSafetyFormContext.jsx @@ -6,8 +6,6 @@ import { useState } from "react"; import PrevCartableOpinion from "./PrevCartableOpinion"; import Questions from "./Questions"; - - const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose }) => { const [tabState, setTabState] = useState(0); @@ -56,7 +54,7 @@ const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose }) > {"بستن"} - @@ -70,15 +68,10 @@ const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose }) - - diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/PrevCartableOpinion.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/PrevCartableOpinion.jsx index 37fe672..f6ca361 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/PrevCartableOpinion.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/PrevCartableOpinion.jsx @@ -1,12 +1,13 @@ import { Card, CardContent, CircularProgress, Stack, Typography } from "@mui/material"; const PrevCartableOpinion = ({ item }) => { - return ( - {item.previous_state_name}: {item.action_name} + + {item.previous_state_name}: {item.action_name} + توضیحات: {item.expert_description} diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/QuestionVerifyNeedRoadForm.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/QuestionVerifyNeedRoadForm.jsx index a39fdec..927ef9e 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/QuestionVerifyNeedRoadForm.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/QuestionVerifyNeedRoadForm.jsx @@ -1,9 +1,4 @@ -import { - Card, - CardContent, - Stack, - Typography -} from "@mui/material"; +import { Card, CardContent, Stack, Typography } from "@mui/material"; const QuestionVerifyNeedRoadForm = () => { return ( diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/QuestionVerifyRoadSafetyForm.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/QuestionVerifyRoadSafetyForm.jsx index edd3232..8c1e4e3 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/QuestionVerifyRoadSafetyForm.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/QuestionVerifyRoadSafetyForm.jsx @@ -1,9 +1,4 @@ -import { - Card, - CardContent, - Stack, - Typography -} from "@mui/material"; +import { Card, CardContent, Stack, Typography } from "@mui/material"; const QuestionVerifyRoadSafetyForm = ({ row }) => { return ( diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/Refer/Form.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/Refer/Form.jsx index cf2095e..c3a58b1 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/Refer/Form.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/Refer/Form.jsx @@ -23,15 +23,15 @@ const ReferForm = ({ rowId, mutate, handleClose, setOpenReferDialog }) => { const onSubmit = async (data) => { await requestServer(`${REFER_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT}/${rowId}`, "post", { data: { - expert_description: data.description + expert_description: data.description, }, }) .then(() => { handleClose(); - setOpenReferDialog(false) + setOpenReferDialog(false); mutate(); }) - .catch(() => { }); + .catch(() => {}); }; return ( @@ -60,11 +60,17 @@ const ReferForm = ({ rowId, mutate, handleClose, setOpenReferDialog }) => { - - ) -} -export default ReferForm \ No newline at end of file + ); +}; +export default ReferForm; diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/Refer/index.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/Refer/index.jsx index 1fc664c..e18024f 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/Refer/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/Refer/index.jsx @@ -1,5 +1,5 @@ import { Close } from "@mui/icons-material"; -import { Button, Dialog, DialogTitle, IconButton } from "@mui/material" +import { Button, Dialog, DialogTitle, IconButton } from "@mui/material"; import { useState } from "react"; import ReferForm from "./Form"; @@ -8,10 +8,23 @@ const Refer = ({ rowId, mutate, handleClose, isSubmitting }) => { return ( <> - - { setOpenReferDialog(false) }} maxWidth="xs" fullWidth> + { + setOpenReferDialog(false); + }} + maxWidth="xs" + fullWidth + > setOpenReferDialog(false)} @@ -26,9 +39,16 @@ const Refer = ({ rowId, mutate, handleClose, isSubmitting }) => { مخالفت و ارجاع به دفتر حریم - {openReferDialog && } + {openReferDialog && ( + + )} - ) -} -export default Refer \ No newline at end of file + ); +}; +export default Refer; diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/index.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/index.jsx index b8b016b..2f89a8f 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyLicenseForm/Questions/index.jsx @@ -1,5 +1,8 @@ import StyledForm from "@/core/components/StyledForm"; -import { CONFIRM_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT, CONFIRM_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT } from "@/core/utils/routes"; +import { + CONFIRM_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT, + CONFIRM_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT, +} from "@/core/utils/routes"; import useRequest from "@/lib/hooks/useRequest"; import { yupResolver } from "@hookform/resolvers/yup"; import { Button, DialogActions, DialogContent, Stack } from "@mui/material"; @@ -30,27 +33,33 @@ const Questions = ({ row, rowId, mutate, handleClose, handlePrev }) => { const onSubmit = async (data) => { await requestServer(`${CONFIRM_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT}/${rowId}`, "post", { data: { - expert_description: data.description + expert_description: data.description, }, }) .then(() => { handleClose(); mutate(); }) - .catch(() => { }); + .catch(() => {}); }; return ( - + - - @@ -60,6 +69,6 @@ const Questions = ({ row, rowId, mutate, handleClose, handlePrev }) => { - ) -} -export default Questions \ No newline at end of file + ); +}; +export default Questions; diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/ConfirmRoadSafetyDialog.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/ConfirmRoadSafetyDialog.jsx index f3a693a..5bcd863 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/ConfirmRoadSafetyDialog.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/ConfirmRoadSafetyDialog.jsx @@ -30,7 +30,13 @@ const ConfirmRoadSafetyDialog = ({ row, handleClose, rowId, mutate }) => { {loading ? ( ) : data ? ( - + ) : ( اطلاعات درخواست در سامانه یافت نشد @@ -38,6 +44,5 @@ const ConfirmRoadSafetyDialog = ({ row, handleClose, rowId, mutate }) => { )} ); - -} -export default ConfirmRoadSafetyDialog \ No newline at end of file +}; +export default ConfirmRoadSafetyDialog; diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/ConfirmRoadSafetyFormContext.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/ConfirmRoadSafetyFormContext.jsx index 7b1fd02..633d2e9 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/ConfirmRoadSafetyFormContext.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/ConfirmRoadSafetyFormContext.jsx @@ -6,8 +6,6 @@ import { useState } from "react"; import PrevCartableOpinion from "./PrevCartableOpinion"; import Questions from "./Questions"; - - const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose }) => { const [tabState, setTabState] = useState(0); @@ -56,7 +54,7 @@ const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose }) > {"بستن"} - @@ -70,15 +68,10 @@ const ConfirmRoadSafetyFormContext = ({ row, data, rowId, mutate, handleClose }) - - diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/PrevCartableOpinion.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/PrevCartableOpinion.jsx index 37fe672..f6ca361 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/PrevCartableOpinion.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/PrevCartableOpinion.jsx @@ -1,12 +1,13 @@ import { Card, CardContent, CircularProgress, Stack, Typography } from "@mui/material"; const PrevCartableOpinion = ({ item }) => { - return ( - {item.previous_state_name}: {item.action_name} + + {item.previous_state_name}: {item.action_name} + توضیحات: {item.expert_description} diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/QuestionVerifyNeedRoadForm.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/QuestionVerifyNeedRoadForm.jsx index 558d200..18fb601 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/QuestionVerifyNeedRoadForm.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/QuestionVerifyNeedRoadForm.jsx @@ -1,9 +1,4 @@ -import { - Card, - CardContent, - Stack, - Typography -} from "@mui/material"; +import { Card, CardContent, Stack, Typography } from "@mui/material"; const QuestionVerifyNeedRoadForm = ({ row }) => { return ( diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/Refer/Form.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/Refer/Form.jsx index cf2095e..c3a58b1 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/Refer/Form.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/Refer/Form.jsx @@ -23,15 +23,15 @@ const ReferForm = ({ rowId, mutate, handleClose, setOpenReferDialog }) => { const onSubmit = async (data) => { await requestServer(`${REFER_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT}/${rowId}`, "post", { data: { - expert_description: data.description + expert_description: data.description, }, }) .then(() => { handleClose(); - setOpenReferDialog(false) + setOpenReferDialog(false); mutate(); }) - .catch(() => { }); + .catch(() => {}); }; return ( @@ -60,11 +60,17 @@ const ReferForm = ({ rowId, mutate, handleClose, setOpenReferDialog }) => { - - ) -} -export default ReferForm \ No newline at end of file + ); +}; +export default ReferForm; diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/Refer/index.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/Refer/index.jsx index 1fc664c..e18024f 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/Refer/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/Refer/index.jsx @@ -1,5 +1,5 @@ import { Close } from "@mui/icons-material"; -import { Button, Dialog, DialogTitle, IconButton } from "@mui/material" +import { Button, Dialog, DialogTitle, IconButton } from "@mui/material"; import { useState } from "react"; import ReferForm from "./Form"; @@ -8,10 +8,23 @@ const Refer = ({ rowId, mutate, handleClose, isSubmitting }) => { return ( <> - - { setOpenReferDialog(false) }} maxWidth="xs" fullWidth> + { + setOpenReferDialog(false); + }} + maxWidth="xs" + fullWidth + > setOpenReferDialog(false)} @@ -26,9 +39,16 @@ const Refer = ({ rowId, mutate, handleClose, isSubmitting }) => { مخالفت و ارجاع به دفتر حریم - {openReferDialog && } + {openReferDialog && ( + + )} - ) -} -export default Refer \ No newline at end of file + ); +}; +export default Refer; diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/index.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/index.jsx index a52b00c..d020ad8 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/index.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/ConfirmVerifyRoadSafetyForm/Questions/index.jsx @@ -29,27 +29,33 @@ const Questions = ({ row, rowId, mutate, handleClose, handlePrev }) => { const onSubmit = async (data) => { await requestServer(`${CONFIRM_VERIFY_NEADROAD_ROAD_INQUIRY_PRIVACY_ZAMIN_GOV_ASSISTANT}/${rowId}`, "post", { data: { - expert_description: data.description + expert_description: data.description, }, }) .then(() => { handleClose(); mutate(); }) - .catch(() => { }); + .catch(() => {}); }; return ( - + - - @@ -59,6 +65,6 @@ const Questions = ({ row, rowId, mutate, handleClose, handlePrev }) => { - ) -} -export default Questions \ No newline at end of file + ); +}; +export default Questions; diff --git a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/TableContent.jsx b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/TableContent.jsx index cd3afb0..b405a41 100644 --- a/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/TableContent.jsx +++ b/src/components/dashboard/inquiryPrivacy/technical-deputy/RowActions/History/TableContent.jsx @@ -1,4 +1,14 @@ -import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, CircularProgress, Typography } from "@mui/material"; +import { + Box, + Table, + TableBody, + TableCell, + TableContainer, + TableHead, + TableRow, + CircularProgress, + Typography, +} from "@mui/material"; import "moment/locale/fa"; import { useHistory } from "@/lib/hooks/useHistory";