Merge branch 'release/v1.1.0'
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
HOST="rms.witel.ir"
|
||||
NEXT_PUBLIC_VERSION="1.0.5"
|
||||
NEXT_PUBLIC_VERSION="1.1.0"
|
||||
NEXT_PUBLIC_API_URL="https://rms.witel.ir"
|
||||
NEXT_PUBLIC_MAPTILE_ENDPOINT="https://rmsmap.rmto.ir/141map"
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM node:22.11.0-alpine3.20
|
||||
FROM docker.arvancloud.ir/node:22.11.0-alpine3.20
|
||||
|
||||
WORKDIR /var/www/app
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
"use client";
|
||||
import PageLoading from "@/core/components/PageLoading";
|
||||
|
||||
const Loading = () => {
|
||||
return <PageLoading />;
|
||||
};
|
||||
export default Loading;
|
||||
@@ -1,7 +0,0 @@
|
||||
"use client";
|
||||
import PageLoading from "@/core/components/PageLoading";
|
||||
|
||||
const Loading = () => {
|
||||
return <PageLoading />;
|
||||
};
|
||||
export default Loading;
|
||||
@@ -1,7 +0,0 @@
|
||||
"use client";
|
||||
import PageLoading from "@/core/components/PageLoading";
|
||||
|
||||
const Loading = () => {
|
||||
return <PageLoading />;
|
||||
};
|
||||
export default Loading;
|
||||
@@ -1,7 +0,0 @@
|
||||
"use client";
|
||||
import PageLoading from "@/core/components/PageLoading";
|
||||
|
||||
const Loading = () => {
|
||||
return <PageLoading />;
|
||||
};
|
||||
export default Loading;
|
||||
@@ -1,7 +0,0 @@
|
||||
"use client";
|
||||
import PageLoading from "@/core/components/PageLoading";
|
||||
|
||||
const Loading = () => {
|
||||
return <PageLoading />;
|
||||
};
|
||||
export default Loading;
|
||||
@@ -6,13 +6,7 @@ export const metadata = {
|
||||
};
|
||||
const Page = () => {
|
||||
return (
|
||||
<WithPermission
|
||||
permission_name={[
|
||||
"show-safety-and-privacy-operator-cartable",
|
||||
"show-safety-and-privacy-operator-cartable-province",
|
||||
"show-safety-and-privacy-operator-cartable-edarate-shahri",
|
||||
]}
|
||||
>
|
||||
<WithPermission permission_name={["show-safety-and-privacy-operator-cartable-edarate-shahri"]}>
|
||||
<OperatorPage />
|
||||
{/*<ActivityCodeLog activity_code={1145} />*/}
|
||||
</WithPermission>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import SupervisorPage from "@/components/dashboard/roadSafety/supervisor";
|
||||
import WithPermission from "@/core/middlewares/withPermission";
|
||||
// import ActivityCodeLog from "@/core/components/ActivityCodeLog";
|
||||
export const metadata = {
|
||||
title: "کارتابل ارزیابی نگهداری حریم",
|
||||
};
|
||||
const Page = () => {
|
||||
return (
|
||||
<WithPermission
|
||||
permission_name={[
|
||||
"show-safety-and-privacy-operator-cartable",
|
||||
"show-safety-and-privacy-operator-cartable-province",
|
||||
]}
|
||||
>
|
||||
<SupervisorPage />
|
||||
{/*<ActivityCodeLog activity_code={1145} />*/}
|
||||
</WithPermission>
|
||||
);
|
||||
};
|
||||
|
||||
export default Page;
|
||||
@@ -1,13 +1,17 @@
|
||||
"use client";
|
||||
import HeaderWithLogo from "@/components/layouts/dashboard/headerWithLogo";
|
||||
import HeaderWithSidebar from "@/components/layouts/dashboard/headerWithSidebar";
|
||||
import { Stack } from "@mui/material";
|
||||
import { SWRConfig } from "swr";
|
||||
|
||||
const Layout = ({ children }) => {
|
||||
return (
|
||||
<Stack sx={{ width: "100%", height: "100%" }}>
|
||||
<HeaderWithLogo />
|
||||
<HeaderWithSidebar>{children}</HeaderWithSidebar>
|
||||
</Stack>
|
||||
<SWRConfig value={{ provider: () => new Map() }}>
|
||||
<Stack sx={{ width: "100%", height: "100%" }}>
|
||||
<HeaderWithLogo />
|
||||
<HeaderWithSidebar>{children}</HeaderWithSidebar>
|
||||
</Stack>
|
||||
</SWRConfig>
|
||||
);
|
||||
};
|
||||
export default Layout;
|
||||
|
||||
@@ -83,7 +83,7 @@ const CreateFormContent = ({ setOpen, mutate }) => {
|
||||
const startPoint = `${data.start_point.lat},${data.start_point.lng}`;
|
||||
const formData = new FormData();
|
||||
formData.append("activity_date", data.activity_date);
|
||||
formData.append("activity_time", format(new Date(data.activity_time), "HH:mm"));
|
||||
formData.append("activity_time", `${data.activity_time.toString().padStart(2, "0")}:00`);
|
||||
formData.append("info_id", data.info_id);
|
||||
formData.append("axis_type_id", data.axis_type_id);
|
||||
formData.append("recognize_picture", data.recognize_picture);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Box, Chip, Divider, Grid, Stack, Typography } from "@mui/material";
|
||||
import InsertDriveFileIcon from "@mui/icons-material/InsertDriveFile";
|
||||
import ImageUpload from "./ImageUpload";
|
||||
import { Controller, useWatch } from "react-hook-form";
|
||||
import HourSelect from "@/core/components/HourSelect";
|
||||
import MapInfoOneMarker from "@/core/components/MapInfoOneMarker";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import MuiTimePicker from "@/core/components/MuiTimePicker";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
import InsertDriveFileIcon from "@mui/icons-material/InsertDriveFile";
|
||||
import { Box, Chip, Divider, Grid, Stack, Typography } from "@mui/material";
|
||||
import { Controller, useWatch } from "react-hook-form";
|
||||
import ImageUpload from "./ImageUpload";
|
||||
|
||||
const GetSubItemInfo = ({ itemsList, control, setValue, errors }) => {
|
||||
const StartPoint = useWatch({ control, name: "start_point" });
|
||||
@@ -84,14 +84,11 @@ const GetSubItemInfo = ({ itemsList, control, setValue, errors }) => {
|
||||
control={control}
|
||||
render={({ field, fieldState: { error } }) => {
|
||||
return (
|
||||
<MuiTimePicker
|
||||
name="activity_time"
|
||||
error={error}
|
||||
<HourSelect
|
||||
value={field.value}
|
||||
placeholder={"زمان فعالیت را وارد کنید"}
|
||||
label={"زمان فعالیت"}
|
||||
setFieldValue={(name, value) => field.onChange(value || null)}
|
||||
helperText={error ? error.message : null}
|
||||
label="ساعت فعالیت"
|
||||
error={error}
|
||||
onChange={field.onChange}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import { Button, DialogActions, DialogContent, Stack } from "@mui/material";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import HourSelect from "@/core/components/HourSelect";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import StyledForm from "@/core/components/StyledForm";
|
||||
import { THIRD_STEP_STORE } from "@/core/utils/routes";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import { Button, DialogActions, DialogContent, Grid, Stack } from "@mui/material";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { mixed, object, string } from "yup";
|
||||
import ImageUpload from "./ImageUpload";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import { THIRD_STEP_STORE } from "@/core/utils/routes";
|
||||
import MuiDatePicker from "@/core/components/MuiDatePicker";
|
||||
import MuiTimePicker from "@/core/components/MuiTimePicker";
|
||||
import { format } from "date-fns";
|
||||
|
||||
const StepThreeContent = ({ setOpen, mutate, rowId }) => {
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
@@ -33,7 +32,7 @@ const StepThreeContent = ({ setOpen, mutate, rowId }) => {
|
||||
});
|
||||
const onSubmit = async (data) => {
|
||||
const formData = new FormData();
|
||||
formData.append("action_date", `${data.action_date} ${format(new Date(data.action_time), "HH:mm")}`);
|
||||
formData.append("action_date", `${data.action_date} ${data.action_time.toString().padStart(2, "0")}:00`);
|
||||
formData.append("action_picture", data.action_picture);
|
||||
await requestServer(`${THIRD_STEP_STORE}/${rowId}`, "post", {
|
||||
data: formData,
|
||||
@@ -48,43 +47,44 @@ const StepThreeContent = ({ setOpen, mutate, rowId }) => {
|
||||
return (
|
||||
<StyledForm onSubmit={handleSubmit(onSubmit)}>
|
||||
<DialogContent dividers>
|
||||
<Stack spacing={2}>
|
||||
<Stack direction={"row"} spacing={2} justifyContent={"space-between"}>
|
||||
<Controller
|
||||
control={control}
|
||||
render={({ field, fieldState: { error } }) => {
|
||||
return (
|
||||
<MuiDatePicker
|
||||
name="action_date"
|
||||
error={error}
|
||||
value={field.value}
|
||||
placeholder={"تاریخ اقدام را وارد کنید"}
|
||||
label={"تاریخ اقدام"}
|
||||
setFieldValue={(name, value) => field.onChange(value || [])}
|
||||
helperText={error ? error.message : null}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
name={"action_date"}
|
||||
/>
|
||||
<Controller
|
||||
control={control}
|
||||
render={({ field, fieldState: { error } }) => {
|
||||
return (
|
||||
<MuiTimePicker
|
||||
name="action_time"
|
||||
error={error}
|
||||
value={field.value}
|
||||
placeholder={"زمان اقدام را وارد کنید"}
|
||||
label={"زمان اقدام"}
|
||||
setFieldValue={(name, value) => field.onChange(value || null)}
|
||||
helperText={error ? error.message : null}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
name={"action_time"}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Controller
|
||||
control={control}
|
||||
render={({ field, fieldState: { error } }) => {
|
||||
return (
|
||||
<MuiDatePicker
|
||||
name="action_date"
|
||||
error={error}
|
||||
value={field.value}
|
||||
placeholder={"تاریخ اقدام را وارد کنید"}
|
||||
label={"تاریخ اقدام"}
|
||||
setFieldValue={(name, value) => field.onChange(value || [])}
|
||||
helperText={error ? error.message : null}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
name={"action_date"}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<Controller
|
||||
control={control}
|
||||
render={({ field, fieldState: { error } }) => {
|
||||
return (
|
||||
<HourSelect
|
||||
value={field.value}
|
||||
label="ساعت اقدام"
|
||||
error={error}
|
||||
onChange={field.onChange}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
name={"action_time"}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Controller
|
||||
name="action_picture"
|
||||
control={control}
|
||||
|
||||
@@ -1,8 +1,23 @@
|
||||
import { Box, Button, Chip, DialogActions, DialogContent, Divider, Fade, Grid, Stack, Typography } from "@mui/material";
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
Chip,
|
||||
DialogActions,
|
||||
DialogContent,
|
||||
Divider,
|
||||
Fade,
|
||||
FormControlLabel,
|
||||
Grid,
|
||||
Radio,
|
||||
RadioGroup,
|
||||
Stack,
|
||||
TextField,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { Controller, useForm, useWatch } from "react-hook-form";
|
||||
import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import { mixed, object } from "yup";
|
||||
import { mixed, object, string } from "yup";
|
||||
import ShowDocuments from "./ShowDocuments";
|
||||
import StyledForm from "@/core/components/StyledForm";
|
||||
import { SECOND_STEP_STORE } from "@/core/utils/routes";
|
||||
@@ -12,24 +27,35 @@ const StepTwoContent = ({ setOpenStepTwoDialog, mutate, rowId }) => {
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
const [selectedDamageItemList, setSelectedDamageItemList] = useState([]);
|
||||
const defaultValues = {
|
||||
need_judiciary: "0",
|
||||
operator_description: "",
|
||||
judiciary_document: null,
|
||||
};
|
||||
const validationSchema = object({
|
||||
judiciary_document: mixed().test("is-array", "لطفا حداقل یک فایل بارگذاری کنید!", (value) => {
|
||||
return Array.isArray(value) && value.length > 0;
|
||||
judiciary_document: mixed().when("need_judiciary", {
|
||||
is: "1",
|
||||
then: (schema) =>
|
||||
schema.test("is-array", "لطفا حداقل یک فایل بارگذاری کنید!", (value) => {
|
||||
return Array.isArray(value) && value.length > 0;
|
||||
}),
|
||||
otherwise: (schema) => schema.notRequired(),
|
||||
}),
|
||||
operator_description: string().when("need_judiciary", {
|
||||
is: "0",
|
||||
then: (schema) => schema.required("لطفا توضیحات را وارد کنید!"),
|
||||
otherwise: (schema) => schema.notRequired(),
|
||||
}),
|
||||
});
|
||||
const {
|
||||
control,
|
||||
handleSubmit,
|
||||
setValue,
|
||||
formState: { isSubmitting, errors },
|
||||
formState: { isSubmitting },
|
||||
} = useForm({
|
||||
defaultValues,
|
||||
resolver: yupResolver(validationSchema),
|
||||
mode: "all",
|
||||
});
|
||||
|
||||
const handleCreateDamage = (files) => {
|
||||
setSelectedDamageItemList((prev) => {
|
||||
const newFiles = files.filter((file) => !prev.some((item) => item.name === file.name));
|
||||
@@ -40,12 +66,19 @@ const StepTwoContent = ({ setOpenStepTwoDialog, mutate, rowId }) => {
|
||||
setValue("judiciary_document", selectedDamageItemList);
|
||||
}, [selectedDamageItemList]);
|
||||
|
||||
const need_judiciary = useWatch({ control, name: "need_judiciary" });
|
||||
|
||||
const deleteDamageItem = (name) => {
|
||||
setSelectedDamageItemList((prev) => prev.filter((documentItem) => documentItem.name !== name));
|
||||
};
|
||||
const onSubmit = async (data) => {
|
||||
const formData = new FormData();
|
||||
data.judiciary_document.map((item, index) => formData.append(`judiciary_document[${index}]`, item));
|
||||
formData.append(`need_judiciary`, data.need_judiciary);
|
||||
if (data.need_judiciary == 1) {
|
||||
data.judiciary_document.map((item, index) => formData.append(`judiciary_document[${index}]`, item));
|
||||
} else {
|
||||
formData.append(`operator_description`, data.operator_description);
|
||||
}
|
||||
await requestServer(`${SECOND_STEP_STORE}/${rowId}`, "post", {
|
||||
data: formData,
|
||||
hasSidebarUpdate: true,
|
||||
@@ -58,69 +91,108 @@ const StepTwoContent = ({ setOpenStepTwoDialog, mutate, rowId }) => {
|
||||
};
|
||||
return (
|
||||
<StyledForm onSubmit={handleSubmit(onSubmit)}>
|
||||
<DialogContent dividers>
|
||||
<Stack spacing={2}>
|
||||
<Controller
|
||||
control={control}
|
||||
name={"judiciary_document"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<>
|
||||
<Button variant="contained" component="label">
|
||||
انتخاب فایل
|
||||
<input
|
||||
type="file"
|
||||
hidden
|
||||
onChange={(e) => {
|
||||
const files = Array.from(e.target.files);
|
||||
if (files.length > 0) {
|
||||
handleCreateDamage(files);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Button>
|
||||
{error && <Typography color={"error"}>{error.message}</Typography>}
|
||||
</>
|
||||
<DialogContent dividers sx={{ minHeight: need_judiciary == 1 ? 255 : "" }}>
|
||||
<Controller
|
||||
name="need_judiciary"
|
||||
control={control}
|
||||
rules={{ required: "لطفا حالت را انتخاب کنید" }}
|
||||
render={({ field }) => (
|
||||
<>
|
||||
<RadioGroup {...field} sx={{ mb: 1, justifyContent: "center" }} row>
|
||||
<FormControlLabel value="0" control={<Radio />} label="بدون مستندات قضایی" />
|
||||
<FormControlLabel value="1" control={<Radio />} label="دارای مستندات قضایی" />
|
||||
</RadioGroup>
|
||||
</>
|
||||
)}
|
||||
/>
|
||||
{need_judiciary == 1 ? (
|
||||
<>
|
||||
<Stack spacing={2}>
|
||||
<Controller
|
||||
control={control}
|
||||
name={"judiciary_document"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<>
|
||||
<Button variant="contained" component="label">
|
||||
انتخاب فایل
|
||||
<input
|
||||
type="file"
|
||||
hidden
|
||||
onChange={(e) => {
|
||||
const files = Array.from(e.target.files);
|
||||
if (files.length > 0) {
|
||||
handleCreateDamage(files);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Button>
|
||||
{error && <Typography color={"error"}>{error.message}</Typography>}
|
||||
</>
|
||||
)}
|
||||
/>
|
||||
</Stack>
|
||||
<Divider sx={{ my: 2, width: "100%" }}>
|
||||
<Chip variant="outlined" label="لیست مستندات قضایی" />
|
||||
</Divider>
|
||||
{selectedDamageItemList.length === 0 && (
|
||||
<Box
|
||||
sx={{
|
||||
my: 4,
|
||||
width: "100%",
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
<Typography variant="h6" sx={{ letterSpacing: "2px", color: "#606060" }}>
|
||||
فایل موردنظر را بارگذاری کنید.
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
/>
|
||||
</Stack>
|
||||
<Divider sx={{ my: 2, width: "100%" }}>
|
||||
<Chip variant="outlined" label="لیست مستندات قضایی" />
|
||||
</Divider>
|
||||
{selectedDamageItemList.length === 0 && (
|
||||
<Box
|
||||
sx={{
|
||||
my: 4,
|
||||
width: "100%",
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
<Typography variant="h6" sx={{ letterSpacing: "2px", color: "#606060" }}>
|
||||
فایل موردنظر را بارگذاری کنید.
|
||||
</Typography>
|
||||
</Box>
|
||||
<Fade in={selectedDamageItemList.length !== 0} sx={{ width: "100%" }}>
|
||||
<Grid
|
||||
container
|
||||
rowSpacing={2}
|
||||
sx={{
|
||||
p: 1,
|
||||
mt: 2,
|
||||
minHeight: 150,
|
||||
overflowY: "auto",
|
||||
}}
|
||||
>
|
||||
{selectedDamageItemList.length !== 0 &&
|
||||
selectedDamageItemList.map((selectedDamageItem, index) => (
|
||||
<Grid key={index} item xs={12}>
|
||||
<ShowDocuments
|
||||
deleteDamageItem={deleteDamageItem}
|
||||
selectedDamageItem={selectedDamageItem}
|
||||
/>
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
</Fade>
|
||||
</>
|
||||
) : (
|
||||
<Stack>
|
||||
<Controller
|
||||
control={control}
|
||||
name={"operator_description"}
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<TextField
|
||||
{...field}
|
||||
multiline
|
||||
rows={5}
|
||||
label="توضیحات و دلایل"
|
||||
placeholder="لطفاً علت ثبت گام بدون مستندات قضایی را توضیح دهید"
|
||||
error={!!error}
|
||||
helperText={error?.message}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
sx={{ mt: 1 }}
|
||||
InputLabelProps={{ shrink: true }}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Stack>
|
||||
)}
|
||||
<Fade in={selectedDamageItemList.length !== 0} sx={{ width: "100%" }}>
|
||||
<Grid
|
||||
container
|
||||
spacing={2}
|
||||
sx={{
|
||||
p: 1,
|
||||
mt: 2,
|
||||
minHeight: 150,
|
||||
overflowY: "auto",
|
||||
}}
|
||||
>
|
||||
{selectedDamageItemList.length !== 0 &&
|
||||
selectedDamageItemList.map((selectedDamageItem, index) => (
|
||||
<Grid key={index} item xs={12}>
|
||||
<ShowDocuments
|
||||
deleteDamageItem={deleteDamageItem}
|
||||
selectedDamageItem={selectedDamageItem}
|
||||
/>
|
||||
</Grid>
|
||||
))}
|
||||
</Grid>
|
||||
</Fade>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setOpenStepTwoDialog(false)} variant={"outlined"} color={"secondary"}>
|
||||
|
||||
@@ -1,33 +1,39 @@
|
||||
"use client";
|
||||
import CustomSelectByDependency from "@/core/components/DataTable/filter/fieldsType/CustomSelectByDependency";
|
||||
import DataTableWithAuth from "@/core/components/DataTableWithAuth";
|
||||
import { GET_SAFETY_AND_PRIVACY_OPERATOR } from "@/core/utils/routes";
|
||||
import useSafetyAndPrivacyGetItems from "@/lib/hooks/useSafetyAndPrivacyGetItems";
|
||||
import { Box, Stack } from "@mui/material";
|
||||
import moment from "jalali-moment";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useMemo } from "react";
|
||||
import RowActions from "./RowActions";
|
||||
import Toolbar from "./Toolbar";
|
||||
import { usePermissions } from "@/lib/hooks/usePermissions";
|
||||
import { useAuth } from "@/lib/contexts/auth";
|
||||
import useProvinces from "@/lib/hooks/useProvince";
|
||||
import useEdaratLists from "@/lib/hooks/useEdaratLists";
|
||||
import { GET_SAFETY_AND_PRIVACY } from "@/core/utils/routes";
|
||||
import RecognizePictureDialog from "./RowActions/RecognizePictureDialog";
|
||||
import ActionPictureDialog from "./RowActions/ActionPictureDialog";
|
||||
import DescriptionForm from "./RowActions/DescriptionForm";
|
||||
import FinishDescriptionForm from "./RowActions/FinishDescriptionForm";
|
||||
import JudiciaryDocumentDialog from "./RowActions/JudiciaryDocumentDialog";
|
||||
import LocationForm from "./RowActions/LocationForm";
|
||||
import useSafetyAndPrivacyGetItems from "@/lib/hooks/useSafetyAndPrivacyGetItems";
|
||||
import RecognizePictureDialog from "./RowActions/RecognizePictureDialog";
|
||||
import Toolbar from "./Toolbar";
|
||||
import OperatorDescriptionForm from "./RowActions/OperatorDescriptionForm";
|
||||
|
||||
const OperatorList = () => {
|
||||
const { data: userPermissions } = usePermissions();
|
||||
const hasCountryPermission = userPermissions?.includes("show-safety-and-privacy-operator-cartable");
|
||||
const hasProvincePermission = userPermissions?.includes("show-safety-and-privacy-operator-cartable-province");
|
||||
const { user } = useAuth();
|
||||
const statusOptions = [
|
||||
{ value: "", label: "همه وضعیت ها" },
|
||||
const stepOptions = [
|
||||
{ value: "", label: "همه گام ها" },
|
||||
{ value: 1, label: "گام اول (شناسایی)" },
|
||||
{ value: 2, label: "گام دوم (مستندات قضایی)" },
|
||||
{ value: 3, label: "گام سوم (برخورد)" },
|
||||
];
|
||||
const statusOptions = [
|
||||
{ value: "", label: "همه وضعیت ها" },
|
||||
{ value: 0, label: "درحال بررسی" },
|
||||
{ value: 1, label: "تایید" },
|
||||
{ value: 2, label: "عدم تایید" },
|
||||
];
|
||||
const finishOptions = [
|
||||
{ value: "", label: "همه موارد" },
|
||||
{ value: 0, label: "در جریان" },
|
||||
{ value: 1, label: "خاتمه یافته" },
|
||||
];
|
||||
const axisOptions = [
|
||||
{ value: "", label: "همه محور ها" },
|
||||
{ value: 1, label: "آزادراه" },
|
||||
@@ -37,100 +43,8 @@ const OperatorList = () => {
|
||||
{ value: 5, label: "روستایی" },
|
||||
];
|
||||
|
||||
const columns = useMemo(() => {
|
||||
const ProvinceColumn = {
|
||||
header: "استان",
|
||||
id: "province_id",
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
grow: false,
|
||||
size: 130,
|
||||
ColumnSelectComponent: (props) => {
|
||||
const { provinces, errorProvinces, loadingProvinces } = useProvinces();
|
||||
const getColumnSelectOptions = useMemo(() => {
|
||||
if (loadingProvinces) {
|
||||
return [{ value: "loading", label: "در حال بارگذاری..." }];
|
||||
}
|
||||
if (errorProvinces) {
|
||||
return [{ value: "error", label: "خطا در بارگذاری" }];
|
||||
}
|
||||
return [
|
||||
{ value: "", label: "کل کشور" },
|
||||
...provinces.map((province) => ({
|
||||
value: province.id,
|
||||
label: province.name_fa,
|
||||
})),
|
||||
];
|
||||
}, [provinces, errorProvinces, loadingProvinces]);
|
||||
return (
|
||||
<CustomSelectByDependency
|
||||
{...props}
|
||||
value={loadingProvinces ? "loading" : props.filterParameters.value}
|
||||
columnSelectOption={getColumnSelectOptions}
|
||||
/>
|
||||
);
|
||||
},
|
||||
Cell: ({ row }) => <>{row.original.province_fa}</>,
|
||||
};
|
||||
const EdareShahriColumn = {
|
||||
header: "اداره",
|
||||
id: "edare_shahri_id",
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
dependencyId: hasCountryPermission ? "province_id" : null,
|
||||
grow: false,
|
||||
size: 120,
|
||||
ColumnSelectComponent: (props) => {
|
||||
const { edaratList, loadingEdaratList, errorEdaratList } = useEdaratLists(
|
||||
hasCountryPermission ? props.dependencyFieldValue.value : user.province_id
|
||||
);
|
||||
const [prevDependency, setPrevDependency] = useState(
|
||||
hasCountryPermission ? props.dependencyFieldValue.value : user.province_id
|
||||
);
|
||||
|
||||
const getColumnSelectOptions = useMemo(() => {
|
||||
if (hasCountryPermission && props.dependencyFieldValue.value === "") {
|
||||
return [{ value: "empty", label: "ابتدا استان را انتخاب کنید" }];
|
||||
}
|
||||
if (loadingEdaratList) {
|
||||
return [{ value: "loading", label: "در حال بارگذاری..." }];
|
||||
}
|
||||
if (errorEdaratList) {
|
||||
return [{ value: "error", label: "خطا در بارگذاری" }];
|
||||
}
|
||||
return [
|
||||
{ value: "", label: "کل ادارات" },
|
||||
...edaratList.map((edare) => ({
|
||||
value: edare.id,
|
||||
label: edare.name_fa,
|
||||
})),
|
||||
];
|
||||
}, [edaratList, loadingEdaratList, errorEdaratList]);
|
||||
useEffect(() => {
|
||||
if (hasCountryPermission) return;
|
||||
if (prevDependency === props.dependencyFieldValue?.value) return;
|
||||
props.handleChange({ ...props.filterParameters, value: "" });
|
||||
setPrevDependency(props.dependencyFieldValue?.value);
|
||||
}, [props.dependencyFieldValue?.value, hasCountryPermission]);
|
||||
return (
|
||||
<CustomSelectByDependency
|
||||
{...props}
|
||||
value={
|
||||
props.dependencyFieldValue?.value === ""
|
||||
? "empty"
|
||||
: loadingEdaratList
|
||||
? "loading"
|
||||
: props.filterParameters.value
|
||||
}
|
||||
columnSelectOption={getColumnSelectOptions}
|
||||
/>
|
||||
);
|
||||
},
|
||||
Cell: ({ row }) => <>{row.original.edare_shahri_name}</>,
|
||||
};
|
||||
return [
|
||||
const columns = useMemo(
|
||||
() => [
|
||||
{
|
||||
accessorKey: "id",
|
||||
header: "کد یکتا",
|
||||
@@ -143,9 +57,6 @@ const OperatorList = () => {
|
||||
grow: false,
|
||||
size: 100,
|
||||
},
|
||||
...(hasCountryPermission ? [ProvinceColumn] : []),
|
||||
...(hasProvincePermission ? [EdareShahriColumn] : []),
|
||||
|
||||
{
|
||||
header: "اطلاعات فعالیت",
|
||||
id: "info",
|
||||
@@ -250,21 +161,126 @@ const OperatorList = () => {
|
||||
],
|
||||
},
|
||||
{
|
||||
header: "وضعیت",
|
||||
id: "step",
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
sortDescFirst: true,
|
||||
header: "وضعیت فعالیت",
|
||||
id: "allstatus",
|
||||
enableColumnFilter: false,
|
||||
enableSorting: false,
|
||||
datatype: "text",
|
||||
grow: false,
|
||||
size: 100,
|
||||
columnSelectOption: () => {
|
||||
return statusOptions.map((status) => ({
|
||||
value: status.value,
|
||||
label: status.label,
|
||||
}));
|
||||
},
|
||||
Cell: ({ row }) => <>{row.original.step_fa}</>,
|
||||
size: 50,
|
||||
columns: [
|
||||
{
|
||||
header: "وضعیت گام ها",
|
||||
id: "step",
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
sortDescFirst: true,
|
||||
grow: false,
|
||||
size: 100,
|
||||
columnSelectOption: () => {
|
||||
return stepOptions.map((status) => ({
|
||||
value: status.value,
|
||||
label: status.label,
|
||||
}));
|
||||
},
|
||||
Cell: ({ row }) => <>{row.original.step_fa}</>,
|
||||
},
|
||||
{
|
||||
header: "وضعیت فرایند",
|
||||
id: "is_finished",
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
sortDescFirst: true,
|
||||
grow: false,
|
||||
size: 100,
|
||||
columnSelectOption: () => {
|
||||
return finishOptions.map((status) => ({
|
||||
value: status.value,
|
||||
label: status.label,
|
||||
}));
|
||||
},
|
||||
Cell: ({ row }) => (
|
||||
<>
|
||||
{row.original.is_finished == 1
|
||||
? "خاتمه یافته"
|
||||
: row.original.is_finished == 0
|
||||
? "در جریان"
|
||||
: "-"}
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
header: "علت خاتمه فرایند",
|
||||
id: "finished_description",
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
grow: false,
|
||||
size: 100,
|
||||
muiTableBodyCellProps: {
|
||||
sx: {
|
||||
borderLeft: "1px solid #e1e1e1",
|
||||
py: 0,
|
||||
"&:first-of-type": {
|
||||
borderLeft: "unset",
|
||||
},
|
||||
},
|
||||
},
|
||||
Cell: ({ row }) =>
|
||||
row.original.final_description ? (
|
||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||
<FinishDescriptionForm description={row.original.final_description} />
|
||||
</Stack>
|
||||
) : (
|
||||
"-"
|
||||
),
|
||||
},
|
||||
{
|
||||
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 || "-"}</>,
|
||||
},
|
||||
{
|
||||
header: "توضیحات ناظر",
|
||||
id: "supervisor_description",
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
grow: false,
|
||||
size: 100,
|
||||
muiTableBodyCellProps: {
|
||||
sx: {
|
||||
borderLeft: "1px solid #e1e1e1",
|
||||
py: 0,
|
||||
"&:first-of-type": {
|
||||
borderLeft: "unset",
|
||||
},
|
||||
},
|
||||
},
|
||||
Cell: ({ row }) =>
|
||||
row.original.supervisor_description ? (
|
||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||
<DescriptionForm description={row.original.supervisor_description} />
|
||||
</Stack>
|
||||
) : (
|
||||
"-"
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
header: "گام اول (شناسایی)",
|
||||
@@ -349,7 +365,8 @@ const OperatorList = () => {
|
||||
Cell: ({ row }) => {
|
||||
return (
|
||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||
{row.original.judiciary_document_upload_date !== "0000-00-00 00:00:00" ? (
|
||||
{row.original.judiciary_document_upload_date !== "0000-00-00 00:00:00" &&
|
||||
row.original.judiciary_document_upload_date ? (
|
||||
<JudiciaryDocumentDialog rowId={row.getValue("id")} />
|
||||
) : (
|
||||
<>-</>
|
||||
@@ -375,6 +392,32 @@ const OperatorList = () => {
|
||||
grow: false,
|
||||
size: 100,
|
||||
},
|
||||
{
|
||||
header: "توضیحات کارشناس",
|
||||
id: "operator_description",
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
grow: false,
|
||||
size: 100,
|
||||
muiTableBodyCellProps: {
|
||||
sx: {
|
||||
borderLeft: "1px solid #e1e1e1",
|
||||
py: 0,
|
||||
"&:first-of-type": {
|
||||
borderLeft: "unset",
|
||||
},
|
||||
},
|
||||
},
|
||||
Cell: ({ row }) =>
|
||||
row.original.operator_description ? (
|
||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||
<OperatorDescriptionForm description={row.original.operator_description} />
|
||||
</Stack>
|
||||
) : (
|
||||
"-"
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -431,8 +474,9 @@ const OperatorList = () => {
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}, []);
|
||||
],
|
||||
[]
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -441,7 +485,7 @@ const OperatorList = () => {
|
||||
need_filter={true}
|
||||
columns={columns}
|
||||
sorting={[{ id: "id", desc: true }]}
|
||||
table_url={GET_SAFETY_AND_PRIVACY}
|
||||
table_url={GET_SAFETY_AND_PRIVACY_OPERATOR}
|
||||
page_name={"roadSafetyOperator"}
|
||||
table_name={"roadSafetyOperatorList"}
|
||||
TableToolbar={Toolbar}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
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 }) => {
|
||||
const [openOfficerDescriptionDialog, setOpenOfficerDescriptionDialog] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="توضیحات ناظر">
|
||||
<IconButton color="primary" onClick={() => setOpenOfficerDescriptionDialog(true)}>
|
||||
<RemoveRedEyeIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
open={openOfficerDescriptionDialog}
|
||||
onClose={() => 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"
|
||||
>
|
||||
<DialogTitle sx={{ display: "flex", justifyContent: "space-between", padding: "16px 24px" }}>
|
||||
<Typography variant="body1" sx={{ fontWeight: "bold", fontSize: "large" }}>
|
||||
توضیحات ناظر
|
||||
</Typography>
|
||||
<IconButton onClick={() => setOpenOfficerDescriptionDialog(false)} size="small">
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<Card elevation={0}>
|
||||
<CardContent>
|
||||
<Typography variant="body2">{description || "هیچ توضیحی موجود نیست"} </Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default DescriptionForm;
|
||||
@@ -0,0 +1,51 @@
|
||||
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 FinishDescriptionForm = ({ description }) => {
|
||||
const [openOfficerDescriptionDialog, setOpenOfficerDescriptionDialog] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="علت خاتمه فرایند">
|
||||
<IconButton color="primary" onClick={() => setOpenOfficerDescriptionDialog(true)}>
|
||||
<RemoveRedEyeIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
open={openOfficerDescriptionDialog}
|
||||
onClose={() => 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"
|
||||
>
|
||||
<DialogTitle sx={{ display: "flex", justifyContent: "space-between", padding: "16px 24px" }}>
|
||||
<Typography variant="body1" sx={{ fontWeight: "bold", fontSize: "large" }}>
|
||||
علت خاتمه فرایند
|
||||
</Typography>
|
||||
<IconButton onClick={() => setOpenOfficerDescriptionDialog(false)} size="small">
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<Card elevation={0}>
|
||||
<CardContent>
|
||||
<Typography variant="body2">{description || "هیچ توضیحی موجود نیست"} </Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default FinishDescriptionForm;
|
||||
@@ -0,0 +1,80 @@
|
||||
import { FINISH_ROAD_SAFETY_BY_SUPERVISOR } from "@/core/utils/routes";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import { Button, DialogActions, DialogContent, Stack, TextField } from "@mui/material";
|
||||
import { useForm } from "react-hook-form";
|
||||
import * as Yup from "yup";
|
||||
|
||||
const FinishContent = ({ rowId, mutate, setOpenFinishDialog }) => {
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
description: Yup.string().required("لطفاً توضیحات را وارد کنید."),
|
||||
});
|
||||
|
||||
const {
|
||||
register,
|
||||
handleSubmit,
|
||||
formState: { errors, isSubmitting },
|
||||
} = useForm({
|
||||
defaultValues: {
|
||||
description: "",
|
||||
},
|
||||
resolver: yupResolver(validationSchema),
|
||||
mode: "all",
|
||||
});
|
||||
|
||||
const onSubmit = async (data) => {
|
||||
const formData = new FormData();
|
||||
formData.append("final_description", data.description);
|
||||
requestServer(`${FINISH_ROAD_SAFETY_BY_SUPERVISOR}/${rowId}`, "post", {
|
||||
data: formData,
|
||||
hasSidebarUpdate: true,
|
||||
})
|
||||
.then(() => {
|
||||
mutate();
|
||||
setOpenFinishDialog(false);
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<DialogContent>
|
||||
<Stack spacing={2}>
|
||||
<Stack>
|
||||
<TextField
|
||||
{...register("description")}
|
||||
multiline
|
||||
rows={8}
|
||||
label="توضیحات و دلایل خاتمه"
|
||||
placeholder="لطفاً علت خاتمه خود را توضیح دهید"
|
||||
error={!!errors.description}
|
||||
helperText={errors.description?.message}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
sx={{ mt: 1 }}
|
||||
InputLabelProps={{ shrink: true }}
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button
|
||||
onClick={() => setOpenFinishDialog(false)}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
disabled={isSubmitting}
|
||||
autoFocus
|
||||
>
|
||||
بستن
|
||||
</Button>
|
||||
<Button onClick={handleSubmit(onSubmit)} variant="contained" color="primary" disabled={isSubmitting}>
|
||||
{isSubmitting ? "درحال ثبت خاتمه..." : "ثبت خاتمه"}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default FinishContent;
|
||||
@@ -0,0 +1,29 @@
|
||||
import DoneAllIcon from "@mui/icons-material/DoneAll";
|
||||
import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
|
||||
import { useState } from "react";
|
||||
import FinishContent from "./FinishContent";
|
||||
const FinishForm = ({ rowId, mutate }) => {
|
||||
const [openFinishDialog, setOpenFinishDialog] = useState(false);
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="خاتمه فرایند">
|
||||
<IconButton color="primary" onClick={() => setOpenFinishDialog(true)}>
|
||||
<DoneAllIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
fullWidth
|
||||
open={openFinishDialog}
|
||||
PaperProps={{
|
||||
sx: {
|
||||
boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<DialogTitle>خاتمه فرایند</DialogTitle>
|
||||
<FinishContent mutate={mutate} rowId={rowId} setOpenFinishDialog={setOpenFinishDialog} />
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default FinishForm;
|
||||
@@ -0,0 +1,51 @@
|
||||
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 OperatorDescriptionForm = ({ description }) => {
|
||||
const [openOfficerDescriptionDialog, setOpenOfficerDescriptionDialog] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="توضیحات کارشناس">
|
||||
<IconButton color="primary" onClick={() => setOpenOfficerDescriptionDialog(true)}>
|
||||
<RemoveRedEyeIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
open={openOfficerDescriptionDialog}
|
||||
onClose={() => 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"
|
||||
>
|
||||
<DialogTitle sx={{ display: "flex", justifyContent: "space-between", padding: "16px 24px" }}>
|
||||
<Typography variant="body1" sx={{ fontWeight: "bold", fontSize: "large" }}>
|
||||
توضیحات کارشناس
|
||||
</Typography>
|
||||
<IconButton onClick={() => setOpenOfficerDescriptionDialog(false)} size="small">
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<Card elevation={0}>
|
||||
<CardContent>
|
||||
<Typography variant="body2">{description || "هیچ توضیحی موجود نیست"} </Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default OperatorDescriptionForm;
|
||||
@@ -4,21 +4,20 @@ import EditAxisType from "../Form/EditAxisType";
|
||||
import StepThree from "../Form/StepThree";
|
||||
import StepTwo from "../Form/StepTwo";
|
||||
import DeleteForm from "./DeleteDialog";
|
||||
import FinishForm from "./FinishForm";
|
||||
|
||||
const RowActions = ({ row, mutate }) => {
|
||||
const { data: userPermissions } = usePermissions();
|
||||
const hasDeletePermission = userPermissions?.includes("delete-safety-and-privacy");
|
||||
const hasUpdatePermission = userPermissions?.includes("update-safety-and-privacy");
|
||||
const hasEdarateShahriPermission = userPermissions?.includes(
|
||||
"show-safety-and-privacy-operator-cartable-edarate-shahri"
|
||||
);
|
||||
return (
|
||||
<Box sx={{ display: "flex", gap: 1 }}>
|
||||
{hasUpdatePermission && row.original?.axis_type_id == null && <EditAxisType mutate={mutate} row={row} />}
|
||||
{hasEdarateShahriPermission && (
|
||||
{!row.original.is_finished && (
|
||||
<>
|
||||
{row.original?.step === 1 && <StepTwo mutate={mutate} rowId={row.getValue("id")} />}
|
||||
{row.original?.step === 2 && <StepThree mutate={mutate} rowId={row.getValue("id")} />}
|
||||
<FinishForm mutate={mutate} rowId={row.getValue("id")} />
|
||||
</>
|
||||
)}
|
||||
{hasDeletePermission && <DeleteForm rowId={row.getValue("id")} mutate={mutate} />}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
import DataTableFilterDataStructure from "@/core/utils/DataTableFilterDataStructure";
|
||||
import isArrayEmpty from "@/core/utils/isArrayEmpty";
|
||||
import { EXPORT_SUPERVISOR_ROAD_SAFETY } from "@/core/utils/routes";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import { useTheme } from "@emotion/react";
|
||||
import DescriptionIcon from "@mui/icons-material/Description";
|
||||
import { Button, CircularProgress, IconButton, useMediaQuery } from "@mui/material";
|
||||
import FileSaver from "file-saver";
|
||||
import moment from "jalali-moment";
|
||||
import { useMemo, useState } from "react";
|
||||
|
||||
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_SUPERVISOR_ROAD_SAFETY}?${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 ? (
|
||||
<IconButton aria-label="خروجی اکسل" color="primary" onClick={clickHandler}>
|
||||
<DescriptionIcon sx={{ fontSize: "25px" }} />
|
||||
</IconButton>
|
||||
) : (
|
||||
<Button
|
||||
color="primary"
|
||||
variant="contained"
|
||||
size="small"
|
||||
disabled={loading}
|
||||
sx={{ textTransform: "unset", alignSelf: "center" }}
|
||||
startIcon={loading ? <CircularProgress size={18} color="inherit" /> : <DescriptionIcon />}
|
||||
onClick={clickHandler}
|
||||
>
|
||||
خروجی اکسل
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default PrintExcel;
|
||||
@@ -0,0 +1,44 @@
|
||||
import { Box, Stack, Typography, useTheme } from "@mui/material";
|
||||
import Image from "next/image";
|
||||
|
||||
const ActionPictureContent = ({ image, title }) => {
|
||||
const theme = useTheme();
|
||||
return (
|
||||
<Stack
|
||||
spacing={2}
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
sx={{
|
||||
my: 2,
|
||||
padding: 2,
|
||||
borderRadius: "12px",
|
||||
border: `1px solid ${theme.palette.primary.main}`,
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
variant="h6"
|
||||
sx={{
|
||||
color: theme.palette.primary.dark,
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
{title}
|
||||
</Typography>
|
||||
<Box sx={{ width: "100%", position: "relative", aspectRatio: "16/9" }}>
|
||||
<Image
|
||||
src={image}
|
||||
alt="Image"
|
||||
fill={true}
|
||||
loading="lazy"
|
||||
style={{
|
||||
objectFit: "contain",
|
||||
marginBottom: "16px",
|
||||
borderRadius: "12px",
|
||||
border: `1px solid ${theme.palette.divider}`,
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
export default ActionPictureContent;
|
||||
@@ -0,0 +1,40 @@
|
||||
import PhotoLibraryIcon from "@mui/icons-material/PhotoLibrary";
|
||||
import { Button, Dialog, DialogActions, DialogContent, IconButton, Tooltip } from "@mui/material";
|
||||
import { useState } from "react";
|
||||
import ActionPictureContent from "./ActionPictureContent";
|
||||
|
||||
const ActionPictureDialog = ({ image }) => {
|
||||
const [openImageDialog, setOpenImageDialog] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="تصویر اقدام">
|
||||
<IconButton color="primary" onClick={() => setOpenImageDialog(true)}>
|
||||
<PhotoLibraryIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
fullWidth
|
||||
open={openImageDialog}
|
||||
onClose={() => 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"
|
||||
>
|
||||
<DialogContent>
|
||||
<ActionPictureContent image={image} title={"تصویر اقدام"} />
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setOpenImageDialog(false)} variant="outlined" color="secondary">
|
||||
بستن
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default ActionPictureDialog;
|
||||
@@ -0,0 +1,70 @@
|
||||
import { CONFIRM_ROAD_SAFETY_BY_SUPERVISOR } from "@/core/utils/routes";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import { Button, DialogActions, DialogContent, Stack, TextField } from "@mui/material";
|
||||
import { useForm } from "react-hook-form";
|
||||
|
||||
const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog }) => {
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
|
||||
const {
|
||||
register,
|
||||
handleSubmit,
|
||||
formState: { isSubmitting },
|
||||
} = useForm({
|
||||
defaultValues: {
|
||||
supervisor_description: "",
|
||||
},
|
||||
});
|
||||
|
||||
const onSubmit = async (data) => {
|
||||
const formData = new FormData();
|
||||
data.supervisor_description !== "" && formData.append("supervisor_description", data.supervisor_description);
|
||||
requestServer(`${CONFIRM_ROAD_SAFETY_BY_SUPERVISOR}/${rowId}`, "post", {
|
||||
data: formData,
|
||||
hasSidebarUpdate: true,
|
||||
})
|
||||
.then(() => {
|
||||
mutate();
|
||||
setOpenConfirmDialog(false);
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<DialogContent>
|
||||
<Stack spacing={2}>
|
||||
<Stack>
|
||||
<TextField
|
||||
{...register("supervisor_description")}
|
||||
multiline
|
||||
rows={8}
|
||||
label="توضیحات و دلایل تأیید (اختیاری)"
|
||||
placeholder="لطفاً علت تأیید خود را توضیح دهید"
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
sx={{ mt: 1 }}
|
||||
InputLabelProps={{ shrink: true }}
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button
|
||||
onClick={() => setOpenConfirmDialog(false)}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
disabled={isSubmitting}
|
||||
autoFocus
|
||||
>
|
||||
بستن
|
||||
</Button>
|
||||
<Button onClick={handleSubmit(onSubmit)} variant="contained" color="primary" disabled={isSubmitting}>
|
||||
{isSubmitting ? "درحال ثبت تایید..." : "ثبت تایید"}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default ConfirmContent;
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
|
||||
import { useState } from "react";
|
||||
import ConfirmContent from "./ConfirmContent";
|
||||
import DoneIcon from "@mui/icons-material/Done";
|
||||
const ConfirmForm = ({ rowId, mutate }) => {
|
||||
const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="تایید فعالیت">
|
||||
<IconButton color="primary" onClick={() => setOpenConfirmDialog(true)}>
|
||||
<DoneIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
fullWidth
|
||||
open={openConfirmDialog}
|
||||
PaperProps={{
|
||||
sx: {
|
||||
boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<DialogTitle>تایید فعالیت</DialogTitle>
|
||||
<ConfirmContent mutate={mutate} rowId={rowId} setOpenConfirmDialog={setOpenConfirmDialog} />
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default ConfirmForm;
|
||||
@@ -0,0 +1,42 @@
|
||||
import { Button, DialogActions, DialogContent, Stack, Typography } from "@mui/material";
|
||||
import React, { useState } from "react";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import { DELETE_SAFETY_AND_PRIVACY } from "@/core/utils/routes";
|
||||
|
||||
const DeleteContent = ({ rowId, mutate, setOpenDeleteDialog }) => {
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
const handleClick = () => {
|
||||
setSubmitting(true);
|
||||
requestServer(`${DELETE_SAFETY_AND_PRIVACY}/${rowId}`, "delete", {
|
||||
hasSidebarUpdate: true,
|
||||
})
|
||||
.then(() => {
|
||||
mutate();
|
||||
setOpenDeleteDialog(false);
|
||||
setSubmitting(false);
|
||||
})
|
||||
.catch(() => {
|
||||
setSubmitting(false);
|
||||
});
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<DialogContent>
|
||||
<Stack alignItems="center" spacing={2}>
|
||||
<Typography mt={2}>آیا از حذف فعالیت اطمینان دارید؟</Typography>
|
||||
</Stack>
|
||||
</DialogContent>
|
||||
<DialogActions sx={{ justifyContent: "center", paddingBottom: 2, width: "100%" }}>
|
||||
<Button onClick={() => setOpenDeleteDialog(false)} variant="outlined" color="secondary">
|
||||
خیر !
|
||||
</Button>
|
||||
<Button onClick={handleClick} variant="contained" color="error" disabled={submitting}>
|
||||
{submitting ? "درحال حذف..." : "بله اطمینان دارم"}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default DeleteContent;
|
||||
@@ -0,0 +1,32 @@
|
||||
import DeleteIcon from "@mui/icons-material/Delete";
|
||||
import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
|
||||
import { useState } from "react";
|
||||
import DeleteContent from "./DeleteContent";
|
||||
const DeleteForm = ({ rowId, mutate }) => {
|
||||
const [openDeleteDialog, setOpenDeleteDialog] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="حذف">
|
||||
<IconButton color="error" onClick={() => setOpenDeleteDialog(true)}>
|
||||
<DeleteIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
open={openDeleteDialog}
|
||||
onClose={() => setOpenDeleteDialog(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"}
|
||||
>
|
||||
<DialogTitle>حذف فعالیت</DialogTitle>
|
||||
<DeleteContent rowId={rowId} mutate={mutate} setOpenDeleteDialog={setOpenDeleteDialog} />
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default DeleteForm;
|
||||
@@ -0,0 +1,51 @@
|
||||
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 }) => {
|
||||
const [openOfficerDescriptionDialog, setOpenOfficerDescriptionDialog] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="توضیحات ناظر">
|
||||
<IconButton color="primary" onClick={() => setOpenOfficerDescriptionDialog(true)}>
|
||||
<RemoveRedEyeIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
open={openOfficerDescriptionDialog}
|
||||
onClose={() => 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"
|
||||
>
|
||||
<DialogTitle sx={{ display: "flex", justifyContent: "space-between", padding: "16px 24px" }}>
|
||||
<Typography variant="body1" sx={{ fontWeight: "bold", fontSize: "large" }}>
|
||||
توضیحات ناظر
|
||||
</Typography>
|
||||
<IconButton onClick={() => setOpenOfficerDescriptionDialog(false)} size="small">
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<Card elevation={0}>
|
||||
<CardContent>
|
||||
<Typography variant="body2">{description || "هیچ توضیحی موجود نیست"} </Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default DescriptionForm;
|
||||
@@ -0,0 +1,51 @@
|
||||
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 FinishDescriptionForm = ({ description }) => {
|
||||
const [openOfficerDescriptionDialog, setOpenOfficerDescriptionDialog] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="علت خاتمه فرایند">
|
||||
<IconButton color="primary" onClick={() => setOpenOfficerDescriptionDialog(true)}>
|
||||
<RemoveRedEyeIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
open={openOfficerDescriptionDialog}
|
||||
onClose={() => 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"
|
||||
>
|
||||
<DialogTitle sx={{ display: "flex", justifyContent: "space-between", padding: "16px 24px" }}>
|
||||
<Typography variant="body1" sx={{ fontWeight: "bold", fontSize: "large" }}>
|
||||
علت خاتمه فرایند
|
||||
</Typography>
|
||||
<IconButton onClick={() => setOpenOfficerDescriptionDialog(false)} size="small">
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<Card elevation={0}>
|
||||
<CardContent>
|
||||
<Typography variant="body2">{description || "هیچ توضیحی موجود نیست"} </Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default FinishDescriptionForm;
|
||||
@@ -0,0 +1,43 @@
|
||||
import { Box, Button, Chip, Divider, Grid, Typography } from "@mui/material";
|
||||
import DownloadIcon from "@mui/icons-material/Download";
|
||||
import ArticleIcon from "@mui/icons-material/Article";
|
||||
|
||||
const JudiciaryDocumentContent = ({ judiciaryDocumentDetails }) => {
|
||||
return (
|
||||
<Grid container spacing={3} sx={{ alignItems: "center", justifyContent: "space-around" }}>
|
||||
{judiciaryDocumentDetails.map((judiciaryDocument, index) => {
|
||||
return (
|
||||
<Grid key={index} item xs={12} sm={12} sx={{ display: "flex", alignItems: "center" }}>
|
||||
<Box sx={{ display: "flex", alignItems: "center" }}>
|
||||
<Chip
|
||||
icon={<ArticleIcon />}
|
||||
label={
|
||||
<Typography variant="body2" sx={{ fontWeight: 600, color: "grey.700" }}>
|
||||
مستندات قضایی {index + 1}
|
||||
</Typography>
|
||||
}
|
||||
/>
|
||||
</Box>
|
||||
<Divider sx={{ flex: 1, mx: 2 }} />
|
||||
<Button
|
||||
variant="contained"
|
||||
color="primary"
|
||||
size="small"
|
||||
startIcon={<DownloadIcon />}
|
||||
onClick={() => {
|
||||
if (judiciaryDocument) {
|
||||
window.open(judiciaryDocument, "_blank");
|
||||
} else {
|
||||
alert("فایلی برای دانلود موجود نیست.");
|
||||
}
|
||||
}}
|
||||
>
|
||||
دانلود فایل
|
||||
</Button>
|
||||
</Grid>
|
||||
);
|
||||
})}
|
||||
</Grid>
|
||||
);
|
||||
};
|
||||
export default JudiciaryDocumentContent;
|
||||
@@ -0,0 +1,35 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import DialogLoading from "@/core/components/DialogLoading";
|
||||
import JudiciaryDocumentContent from "./JudiciaryDocumentContent";
|
||||
import { DESERIALIZE_JUDICIARY_DOCUMENT } from "@/core/utils/routes";
|
||||
import { Typography } from "@mui/material";
|
||||
|
||||
const JudiciaryDocumentController = ({ rowId }) => {
|
||||
const requestServer = useRequest();
|
||||
const [judiciaryDocumentDetails, setJudiciaryDocumentDetails] = useState([]);
|
||||
const [judiciaryDocumentDetailsLoading, setJudiciaryDocumentDetailsLoading] = useState(false);
|
||||
useEffect(() => {
|
||||
setJudiciaryDocumentDetailsLoading(true);
|
||||
requestServer(`${DESERIALIZE_JUDICIARY_DOCUMENT}/${rowId}`, "get")
|
||||
.then((response) => {
|
||||
setJudiciaryDocumentDetails(response.data.data);
|
||||
setJudiciaryDocumentDetailsLoading(false);
|
||||
})
|
||||
.catch((e) => {
|
||||
setJudiciaryDocumentDetailsLoading(false);
|
||||
});
|
||||
}, [rowId]);
|
||||
return (
|
||||
<>
|
||||
{judiciaryDocumentDetailsLoading ? (
|
||||
<DialogLoading />
|
||||
) : judiciaryDocumentDetails.length > 0 ? (
|
||||
<JudiciaryDocumentContent judiciaryDocumentDetails={judiciaryDocumentDetails} />
|
||||
) : (
|
||||
<Typography textAlign={"center"}>بدون مستندات</Typography>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default JudiciaryDocumentController;
|
||||
@@ -0,0 +1,40 @@
|
||||
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Tooltip } from "@mui/material";
|
||||
import ArticleIcon from "@mui/icons-material/Article";
|
||||
import React, { useState } from "react";
|
||||
import JudiciaryDocumentController from "./JudiciaryDocumentController";
|
||||
|
||||
const JudiciaryDocumentDialog = ({ rowId }) => {
|
||||
const [openJudiciaryDocumentDialog, setOpenJudiciaryDocumentDialog] = useState(false);
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="مستندات قضایی">
|
||||
<IconButton color="primary" onClick={() => setOpenJudiciaryDocumentDialog(true)}>
|
||||
<ArticleIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
open={openJudiciaryDocumentDialog}
|
||||
onClose={() => setOpenJudiciaryDocumentDialog(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={"sm"}
|
||||
fullWidth
|
||||
>
|
||||
<DialogTitle>مشاهده مستندات قضایی</DialogTitle>
|
||||
<DialogContent dividers>
|
||||
<JudiciaryDocumentController rowId={rowId} />
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setOpenJudiciaryDocumentDialog(false)} variant="outlined" color="secondary">
|
||||
بستن
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default JudiciaryDocumentDialog;
|
||||
@@ -0,0 +1,35 @@
|
||||
"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: () => <MapLoading />,
|
||||
ssr: false,
|
||||
});
|
||||
|
||||
const LocationFormContent = ({ setOpenLocationDialog, start_lat, start_lng, end_lat, end_lng }) => {
|
||||
return (
|
||||
<>
|
||||
<DialogContent>
|
||||
<Box sx={{ width: "400px", height: "400px" }}>
|
||||
<MapLayer>
|
||||
<ShowLocationMarker
|
||||
start_lat={start_lat}
|
||||
start_lng={start_lng}
|
||||
end_lat={end_lat}
|
||||
end_lng={end_lng}
|
||||
/>
|
||||
</MapLayer>
|
||||
</Box>
|
||||
</DialogContent>
|
||||
<DialogActions sx={{ justifyContent: "center", paddingBottom: 2, width: "100%" }}>
|
||||
<Button onClick={() => setOpenLocationDialog(false)} variant="outlined" color="secondary">
|
||||
بستن
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default LocationFormContent;
|
||||
@@ -0,0 +1,40 @@
|
||||
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, end_lat, end_lng }) => {
|
||||
const [openLocationDialog, setOpenLocationDialog] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="موقعیت">
|
||||
<IconButton color="primary" onClick={() => setOpenLocationDialog(true)}>
|
||||
<ExploreIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
open={openLocationDialog}
|
||||
onClose={() => 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"}
|
||||
>
|
||||
<DialogTitle>موقعیت</DialogTitle>
|
||||
{openLocationDialog && (
|
||||
<LocationFormContent
|
||||
start_lat={start_lat}
|
||||
start_lng={start_lng}
|
||||
end_lat={end_lat}
|
||||
end_lng={end_lng}
|
||||
setOpenLocationDialog={setOpenLocationDialog}
|
||||
/>
|
||||
)}
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default LocationForm;
|
||||
@@ -0,0 +1,51 @@
|
||||
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 OperatorDescriptionForm = ({ description }) => {
|
||||
const [openOfficerDescriptionDialog, setOpenOfficerDescriptionDialog] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="توضیحات کارشناس">
|
||||
<IconButton color="primary" onClick={() => setOpenOfficerDescriptionDialog(true)}>
|
||||
<RemoveRedEyeIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
open={openOfficerDescriptionDialog}
|
||||
onClose={() => 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"
|
||||
>
|
||||
<DialogTitle sx={{ display: "flex", justifyContent: "space-between", padding: "16px 24px" }}>
|
||||
<Typography variant="body1" sx={{ fontWeight: "bold", fontSize: "large" }}>
|
||||
توضیحات کارشناس
|
||||
</Typography>
|
||||
<IconButton onClick={() => setOpenOfficerDescriptionDialog(false)} size="small">
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
</DialogTitle>
|
||||
<DialogContent>
|
||||
<Card elevation={0}>
|
||||
<CardContent>
|
||||
<Typography variant="body2">{description || "هیچ توضیحی موجود نیست"} </Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default OperatorDescriptionForm;
|
||||
@@ -0,0 +1,44 @@
|
||||
import { Box, Stack, Typography, useTheme } from "@mui/material";
|
||||
import Image from "next/image";
|
||||
|
||||
const RecognizePictureContent = ({ image, title }) => {
|
||||
const theme = useTheme();
|
||||
return (
|
||||
<Stack
|
||||
spacing={2}
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
sx={{
|
||||
my: 2,
|
||||
padding: 2,
|
||||
borderRadius: "12px",
|
||||
border: `1px solid ${theme.palette.primary.main}`,
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
variant="h6"
|
||||
sx={{
|
||||
color: theme.palette.primary.dark,
|
||||
fontWeight: "bold",
|
||||
}}
|
||||
>
|
||||
{title}
|
||||
</Typography>
|
||||
<Box sx={{ width: "100%", position: "relative", aspectRatio: "16/9" }}>
|
||||
<Image
|
||||
src={image}
|
||||
alt="Image"
|
||||
fill={true}
|
||||
loading="lazy"
|
||||
style={{
|
||||
objectFit: "contain",
|
||||
marginBottom: "16px",
|
||||
borderRadius: "12px",
|
||||
border: `1px solid ${theme.palette.divider}`,
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
export default RecognizePictureContent;
|
||||
@@ -0,0 +1,40 @@
|
||||
import PhotoLibraryIcon from "@mui/icons-material/PhotoLibrary";
|
||||
import { Button, Dialog, DialogActions, DialogContent, IconButton, Tooltip } from "@mui/material";
|
||||
import { useState } from "react";
|
||||
import RecognizePictureContent from "./RecognizePictureContent";
|
||||
|
||||
const RecognizePictureDialog = ({ image }) => {
|
||||
const [openImageDialog, setOpenImageDialog] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="تصویر بازدید">
|
||||
<IconButton color="primary" onClick={() => setOpenImageDialog(true)}>
|
||||
<PhotoLibraryIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
fullWidth
|
||||
open={openImageDialog}
|
||||
onClose={() => 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"
|
||||
>
|
||||
<DialogContent>
|
||||
<RecognizePictureContent image={image} title={"تصویر بازدید"} />
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setOpenImageDialog(false)} variant="outlined" color="secondary">
|
||||
بستن
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default RecognizePictureDialog;
|
||||
@@ -0,0 +1,83 @@
|
||||
import { REJECT_ROAD_SAFETY_BY_SUPERVISOR } from "@/core/utils/routes";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import { yupResolver } from "@hookform/resolvers/yup";
|
||||
import { Button, DialogActions, DialogContent, Stack, TextField } from "@mui/material";
|
||||
import { useForm } from "react-hook-form";
|
||||
import * as Yup from "yup";
|
||||
|
||||
const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
supervisor_description: Yup.string().required("لطفاً توضیحات را وارد کنید."),
|
||||
});
|
||||
|
||||
const {
|
||||
register,
|
||||
handleSubmit,
|
||||
formState: { errors, isSubmitting },
|
||||
reset,
|
||||
} = useForm({
|
||||
defaultValues: {
|
||||
supervisor_description: "",
|
||||
},
|
||||
resolver: yupResolver(validationSchema),
|
||||
mode: "all",
|
||||
});
|
||||
|
||||
const onSubmit = async (data) => {
|
||||
const formData = new FormData();
|
||||
formData.append("supervisor_description", data.supervisor_description);
|
||||
await requestServer(`${REJECT_ROAD_SAFETY_BY_SUPERVISOR}/${rowId}`, "post", {
|
||||
data: formData,
|
||||
hasSidebarUpdate: true,
|
||||
})
|
||||
.then(() => {
|
||||
mutate();
|
||||
setOpenRejectDialog(false);
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
reset();
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<DialogContent>
|
||||
<Stack spacing={2}>
|
||||
<Stack>
|
||||
<TextField
|
||||
{...register("supervisor_description")}
|
||||
multiline
|
||||
rows={8}
|
||||
label="توضیحات و دلایل عدم تأیید"
|
||||
placeholder="لطفاً علت عدم تأیید خود را توضیح دهید"
|
||||
error={!!errors.supervisor_description}
|
||||
helperText={errors.supervisor_description?.message}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
sx={{ mt: 1 }}
|
||||
InputLabelProps={{ shrink: true }}
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button
|
||||
onClick={() => setOpenRejectDialog(false)}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
disabled={isSubmitting}
|
||||
autoFocus
|
||||
>
|
||||
بستن
|
||||
</Button>
|
||||
<Button onClick={handleSubmit(onSubmit)} variant="contained" color="primary" disabled={isSubmitting}>
|
||||
{isSubmitting ? "درحال ثبت عدم تایید..." : "ثبت عدم تایید"}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default RejectContent;
|
||||
@@ -0,0 +1,29 @@
|
||||
import { Dialog, DialogTitle, IconButton, Tooltip } from "@mui/material";
|
||||
import { useState } from "react";
|
||||
import RejectContent from "./RejectContent";
|
||||
import ClearIcon from "@mui/icons-material/Clear";
|
||||
const RejectForm = ({ rowId, mutate }) => {
|
||||
const [openRejectDialog, setOpenRejectDialog] = useState(false);
|
||||
return (
|
||||
<>
|
||||
<Tooltip title="عدم تایید فعالیت">
|
||||
<IconButton color="primary" onClick={() => setOpenRejectDialog(true)}>
|
||||
<ClearIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog
|
||||
fullWidth
|
||||
open={openRejectDialog}
|
||||
PaperProps={{
|
||||
sx: {
|
||||
boxShadow: "rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px",
|
||||
},
|
||||
}}
|
||||
>
|
||||
<DialogTitle>عدم تایید فعالیت</DialogTitle>
|
||||
<RejectContent mutate={mutate} rowId={rowId} setOpenRejectDialog={setOpenRejectDialog} />
|
||||
</Dialog>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default RejectForm;
|
||||
@@ -0,0 +1,22 @@
|
||||
import { usePermissions } from "@/lib/hooks/usePermissions";
|
||||
import { Box } from "@mui/material";
|
||||
import ConfirmForm from "./ConfirmForm";
|
||||
import DeleteForm from "./DeleteDialog";
|
||||
import RejectForm from "./RejectForm";
|
||||
|
||||
const RowActions = ({ row, mutate }) => {
|
||||
const { data: userPermissions } = usePermissions();
|
||||
const hasDeletePermission = userPermissions?.includes("delete-safety-and-privacy");
|
||||
return (
|
||||
<Box sx={{ display: "flex", gap: 1 }}>
|
||||
{row.original.is_finished == 1 && row.original.status === 0 && (
|
||||
<>
|
||||
<ConfirmForm mutate={mutate} rowId={row.getValue("id")} />
|
||||
<RejectForm mutate={mutate} rowId={row.getValue("id")} />
|
||||
</>
|
||||
)}
|
||||
{hasDeletePermission && <DeleteForm rowId={row.getValue("id")} mutate={mutate} />}
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
export default RowActions;
|
||||
@@ -0,0 +1,606 @@
|
||||
"use client";
|
||||
import CustomSelectByDependency from "@/core/components/DataTable/filter/fieldsType/CustomSelectByDependency";
|
||||
import DataTableWithAuth from "@/core/components/DataTableWithAuth";
|
||||
import { GET_SAFETY_AND_PRIVACY_SUPERVISOR } from "@/core/utils/routes";
|
||||
import useSafetyAndPrivacyGetItems from "@/lib/hooks/useSafetyAndPrivacyGetItems";
|
||||
import { Box, Stack } from "@mui/material";
|
||||
import moment from "jalali-moment";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import RowActions from "./RowActions";
|
||||
import ActionPictureDialog from "./RowActions/ActionPictureDialog";
|
||||
import DescriptionForm from "./RowActions/DescriptionForm";
|
||||
import FinishDescriptionForm from "./RowActions/FinishDescriptionForm";
|
||||
import JudiciaryDocumentDialog from "./RowActions/JudiciaryDocumentDialog";
|
||||
import LocationForm from "./RowActions/LocationForm";
|
||||
import OperatorDescriptionForm from "./RowActions/OperatorDescriptionForm";
|
||||
import RecognizePictureDialog from "./RowActions/RecognizePictureDialog";
|
||||
import Toolbar from "./Toolbar";
|
||||
import { usePermissions } from "@/lib/hooks/usePermissions";
|
||||
import { useAuth } from "@/lib/contexts/auth";
|
||||
import useProvinces from "@/lib/hooks/useProvince";
|
||||
import useEdaratLists from "@/lib/hooks/useEdaratLists";
|
||||
import BlinkingCell from "@/core/components/BlinkingCell";
|
||||
|
||||
const stepOptions = [
|
||||
{ value: "", label: "همه گام ها" },
|
||||
{ value: 1, label: "گام اول (شناسایی)" },
|
||||
{ value: 2, label: "گام دوم (مستندات قضایی)" },
|
||||
{ value: 3, label: "گام سوم (برخورد)" },
|
||||
];
|
||||
const statusOptions = [
|
||||
{ value: "", label: "همه وضعیت ها" },
|
||||
{ value: 0, label: "درحال بررسی" },
|
||||
{ value: 1, label: "تایید" },
|
||||
{ value: 2, label: "عدم تایید" },
|
||||
];
|
||||
const finishOptions = [
|
||||
{ value: "", label: "همه موارد" },
|
||||
{ value: 0, label: "در جریان" },
|
||||
{ value: 1, label: "خاتمه یافته" },
|
||||
];
|
||||
const axisOptions = [
|
||||
{ value: "", label: "همه محور ها" },
|
||||
{ value: 1, label: "آزادراه" },
|
||||
{ value: 2, label: "بزرگراه" },
|
||||
{ value: 3, label: "اصلی" },
|
||||
{ value: 4, label: "فرعی" },
|
||||
{ value: 5, label: "روستایی" },
|
||||
];
|
||||
const SupervisorList = () => {
|
||||
const { data: userPermissions } = usePermissions();
|
||||
const hasCountryPermission = userPermissions?.includes("show-safety-and-privacy-operator-cartable");
|
||||
const { user } = useAuth();
|
||||
|
||||
const columns = useMemo(() => {
|
||||
const provinceColumn = {
|
||||
header: "استان",
|
||||
id: "province_id",
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
grow: false,
|
||||
size: 130,
|
||||
ColumnSelectComponent: (props) => {
|
||||
const { provinces, errorProvinces, loadingProvinces } = useProvinces();
|
||||
const getColumnSelectOptions = useMemo(() => {
|
||||
if (loadingProvinces) {
|
||||
return [{ value: "loading", label: "در حال بارگذاری..." }];
|
||||
}
|
||||
if (errorProvinces) {
|
||||
return [{ value: "error", label: "خطا در بارگذاری" }];
|
||||
}
|
||||
return [
|
||||
{ value: "", label: "کل کشور" },
|
||||
...provinces.map((province) => ({
|
||||
value: province.id,
|
||||
label: province.name_fa,
|
||||
})),
|
||||
];
|
||||
}, [provinces, errorProvinces, loadingProvinces]);
|
||||
return (
|
||||
<CustomSelectByDependency
|
||||
{...props}
|
||||
value={loadingProvinces ? "loading" : props.filterParameters.value}
|
||||
columnSelectOption={getColumnSelectOptions}
|
||||
/>
|
||||
);
|
||||
},
|
||||
Cell: ({ renderedCellValue, row }) => <>{row.original.province_fa}</>,
|
||||
};
|
||||
return [
|
||||
{
|
||||
accessorKey: "id",
|
||||
header: "کد یکتا",
|
||||
id: "id",
|
||||
enableColumnFilter: true,
|
||||
datatype: "text",
|
||||
filterMode: "equals",
|
||||
sortDescFirst: false,
|
||||
columnFilterModeOptions: ["equals", "contains"],
|
||||
grow: false,
|
||||
size: 100,
|
||||
Cell: ({ row }) => (
|
||||
<BlinkingCell
|
||||
value={row.original.id}
|
||||
visible={row.original.status == 0 && row.original.is_finished == 1}
|
||||
/>
|
||||
),
|
||||
},
|
||||
...(hasCountryPermission ? [provinceColumn] : []),
|
||||
{
|
||||
header: "اداره",
|
||||
id: "edare_shahri_id",
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
dependencyId: hasCountryPermission ? "province_id" : null,
|
||||
grow: false,
|
||||
size: 120,
|
||||
ColumnSelectComponent: (props) => {
|
||||
const { edaratList, loadingEdaratList, errorEdaratList } = useEdaratLists(
|
||||
hasCountryPermission ? props.dependencyFieldValue.value : user.province_id
|
||||
);
|
||||
const [prevDependency, setPrevDependency] = useState(
|
||||
hasCountryPermission ? props.dependencyFieldValue.value : user.province_id
|
||||
);
|
||||
|
||||
const getColumnSelectOptions = useMemo(() => {
|
||||
if (hasCountryPermission && props.dependencyFieldValue.value === "") {
|
||||
return [{ value: "empty", label: "ابتدا استان را انتخاب کنید" }];
|
||||
}
|
||||
if (loadingEdaratList) {
|
||||
return [{ value: "loading", label: "در حال بارگذاری..." }];
|
||||
}
|
||||
if (errorEdaratList) {
|
||||
return [{ value: "error", label: "خطا در بارگذاری" }];
|
||||
}
|
||||
return [
|
||||
{ value: "", label: "کل ادارات" },
|
||||
...edaratList.map((edare) => ({
|
||||
value: edare.id,
|
||||
label: edare.name_fa,
|
||||
})),
|
||||
];
|
||||
}, [edaratList, loadingEdaratList, errorEdaratList]);
|
||||
useEffect(() => {
|
||||
if (hasCountryPermission) return;
|
||||
if (prevDependency === props.dependencyFieldValue?.value) return;
|
||||
props.handleChange({ ...props.filterParameters, value: "" });
|
||||
setPrevDependency(props.dependencyFieldValue?.value);
|
||||
}, [props.dependencyFieldValue?.value, hasCountryPermission]);
|
||||
return (
|
||||
<CustomSelectByDependency
|
||||
{...props}
|
||||
value={
|
||||
props.dependencyFieldValue?.value === ""
|
||||
? "empty"
|
||||
: loadingEdaratList
|
||||
? "loading"
|
||||
: props.filterParameters.value
|
||||
}
|
||||
columnSelectOption={getColumnSelectOptions}
|
||||
/>
|
||||
);
|
||||
},
|
||||
Cell: ({ renderedCellValue, row }) => <>{row.original.edare_shahri_name}</>,
|
||||
},
|
||||
{
|
||||
header: "اطلاعات فعالیت",
|
||||
id: "info",
|
||||
enableColumnFilter: false,
|
||||
enableSorting: false,
|
||||
datatype: "text",
|
||||
grow: false,
|
||||
size: 50,
|
||||
columns: [
|
||||
{
|
||||
accessorKey: "info_id",
|
||||
header: "مورد مشاهده شده",
|
||||
id: "info_id",
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
grow: false,
|
||||
size: 100,
|
||||
ColumnSelectComponent: (props) => {
|
||||
const { itemsList, loadingItemsList, errorItemsList } = useSafetyAndPrivacyGetItems();
|
||||
|
||||
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 (
|
||||
<CustomSelectByDependency
|
||||
{...props}
|
||||
value={loadingItemsList ? "loading" : props.filterParameters.value}
|
||||
columnSelectOption={getColumnSelectOptions}
|
||||
/>
|
||||
);
|
||||
},
|
||||
Cell: ({ row }) => <>{row.original.info_fa}</>,
|
||||
},
|
||||
{
|
||||
accessorKey: "axis_type_id",
|
||||
header: "نوع محور",
|
||||
id: "axis_type_id",
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
sortDescFirst: true,
|
||||
grow: false,
|
||||
size: 100,
|
||||
columnSelectOption: () => {
|
||||
return axisOptions.map((status) => ({
|
||||
value: status.value,
|
||||
label: status.label,
|
||||
}));
|
||||
},
|
||||
Cell: ({ row }) => (row.original?.axis_type_name ? <>{row.original.axis_type_name}</> : <>-</>),
|
||||
},
|
||||
{
|
||||
accessorKey: "location",
|
||||
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 (
|
||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||
<LocationForm start_lat={row.original?.lat} start_lng={row.original?.lon} />
|
||||
</Stack>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
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,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
header: "وضعیت فعالیت",
|
||||
id: "allstatus",
|
||||
enableColumnFilter: false,
|
||||
enableSorting: false,
|
||||
datatype: "text",
|
||||
grow: false,
|
||||
size: 50,
|
||||
columns: [
|
||||
{
|
||||
header: "وضعیت گام ها",
|
||||
id: "step",
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
sortDescFirst: true,
|
||||
grow: false,
|
||||
size: 100,
|
||||
columnSelectOption: () => {
|
||||
return stepOptions.map((status) => ({
|
||||
value: status.value,
|
||||
label: status.label,
|
||||
}));
|
||||
},
|
||||
Cell: ({ row }) => <>{row.original.step_fa}</>,
|
||||
},
|
||||
{
|
||||
header: "وضعیت فرایند",
|
||||
id: "is_finished",
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
sortDescFirst: true,
|
||||
grow: false,
|
||||
size: 100,
|
||||
columnSelectOption: () => {
|
||||
return finishOptions.map((status) => ({
|
||||
value: status.value,
|
||||
label: status.label,
|
||||
}));
|
||||
},
|
||||
Cell: ({ row }) => (
|
||||
<>
|
||||
{row.original.is_finished == 1
|
||||
? "خاتمه یافته"
|
||||
: row.original.is_finished == 0
|
||||
? "در جریان"
|
||||
: "-"}
|
||||
</>
|
||||
),
|
||||
},
|
||||
{
|
||||
header: "علت خاتمه فرایند",
|
||||
id: "finished_description",
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
grow: false,
|
||||
size: 100,
|
||||
muiTableBodyCellProps: {
|
||||
sx: {
|
||||
borderLeft: "1px solid #e1e1e1",
|
||||
py: 0,
|
||||
"&:first-of-type": {
|
||||
borderLeft: "unset",
|
||||
},
|
||||
},
|
||||
},
|
||||
Cell: ({ row }) =>
|
||||
row.original.final_description ? (
|
||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||
<FinishDescriptionForm description={row.original.final_description} />
|
||||
</Stack>
|
||||
) : (
|
||||
"-"
|
||||
),
|
||||
},
|
||||
{
|
||||
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 || "-"}</>,
|
||||
},
|
||||
{
|
||||
header: "توضیحات ناظر",
|
||||
id: "supervisor_description",
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
grow: false,
|
||||
size: 100,
|
||||
muiTableBodyCellProps: {
|
||||
sx: {
|
||||
borderLeft: "1px solid #e1e1e1",
|
||||
py: 0,
|
||||
"&:first-of-type": {
|
||||
borderLeft: "unset",
|
||||
},
|
||||
},
|
||||
},
|
||||
Cell: ({ row }) =>
|
||||
row.original.supervisor_description ? (
|
||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||
<DescriptionForm description={row.original.supervisor_description} />
|
||||
</Stack>
|
||||
) : (
|
||||
"-"
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
header: "گام اول (شناسایی)",
|
||||
id: "stepOne",
|
||||
enableColumnFilter: false,
|
||||
enableSorting: false,
|
||||
datatype: "text",
|
||||
grow: false,
|
||||
size: 50,
|
||||
columns: [
|
||||
{
|
||||
accessorKey: "recognize_picture",
|
||||
header: "تصویر بازدید",
|
||||
id: "recognize_picture",
|
||||
enableColumnFilter: false,
|
||||
enableSorting: false,
|
||||
datatype: "text",
|
||||
grow: false,
|
||||
size: 100,
|
||||
muiTableBodyCellProps: {
|
||||
sx: {
|
||||
borderLeft: "1px solid #e1e1e1",
|
||||
py: 0,
|
||||
"&:first-of-type": {
|
||||
borderLeft: "unset",
|
||||
},
|
||||
},
|
||||
},
|
||||
Cell: ({ renderedCellValue }) => {
|
||||
return renderedCellValue ? (
|
||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||
<RecognizePictureDialog image={renderedCellValue} />
|
||||
</Stack>
|
||||
) : (
|
||||
<>-</>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
accessorFn: (row) =>
|
||||
row.activity_date_time ? (
|
||||
moment(row.activity_date_time).locale("fa").format("HH:mm | yyyy/MM/DD")
|
||||
) : (
|
||||
<>-</>
|
||||
),
|
||||
header: "تاریخ بازدید",
|
||||
id: "activity_date_time",
|
||||
enableColumnFilter: true,
|
||||
datatype: "date",
|
||||
filterMode: "between",
|
||||
grow: false,
|
||||
size: 100,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
header: "گام دوم (مستندات قضایی)",
|
||||
id: "stepTwo",
|
||||
enableColumnFilter: false,
|
||||
enableSorting: false,
|
||||
datatype: "text",
|
||||
grow: false,
|
||||
size: 50,
|
||||
columns: [
|
||||
{
|
||||
header: "مستندات قضایی",
|
||||
id: "judiciary_document",
|
||||
enableColumnFilter: false,
|
||||
enableSorting: false,
|
||||
datatype: "text",
|
||||
grow: false,
|
||||
size: 100,
|
||||
muiTableBodyCellProps: {
|
||||
sx: {
|
||||
borderLeft: "1px solid #e1e1e1",
|
||||
py: 0,
|
||||
"&:first-of-type": {
|
||||
borderLeft: "unset",
|
||||
},
|
||||
},
|
||||
},
|
||||
Cell: ({ row }) => {
|
||||
return (
|
||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||
{row.original.judiciary_document_upload_date !== "0000-00-00 00:00:00" &&
|
||||
row.original.judiciary_document_upload_date ? (
|
||||
<JudiciaryDocumentDialog rowId={row.getValue("id")} />
|
||||
) : (
|
||||
<>-</>
|
||||
)}
|
||||
</Stack>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => {
|
||||
const date = row.judiciary_document_upload_date;
|
||||
if (!date || date === "0000-00-00 00:00:00") {
|
||||
return <>-</>;
|
||||
}
|
||||
return moment(date, "YYYY-MM-DD HH:mm:ss").locale("fa").format("HH:mm | yyyy/MM/DD");
|
||||
},
|
||||
|
||||
header: "تاریخ بارگذاری مستندات",
|
||||
id: "judiciary_document_upload_date",
|
||||
enableColumnFilter: true,
|
||||
datatype: "date",
|
||||
filterMode: "between",
|
||||
grow: false,
|
||||
size: 100,
|
||||
},
|
||||
{
|
||||
header: "توضیحات کارشناس",
|
||||
id: "operator_description",
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
filterMode: "equals",
|
||||
grow: false,
|
||||
size: 100,
|
||||
muiTableBodyCellProps: {
|
||||
sx: {
|
||||
borderLeft: "1px solid #e1e1e1",
|
||||
py: 0,
|
||||
"&:first-of-type": {
|
||||
borderLeft: "unset",
|
||||
},
|
||||
},
|
||||
},
|
||||
Cell: ({ row }) =>
|
||||
row.original.operator_description ? (
|
||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||
<OperatorDescriptionForm description={row.original.operator_description} />
|
||||
</Stack>
|
||||
) : (
|
||||
"-"
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
header: "گام سوم (برخورد)",
|
||||
id: "stepThree",
|
||||
enableColumnFilter: false,
|
||||
enableSorting: false,
|
||||
datatype: "text",
|
||||
grow: false,
|
||||
size: 50,
|
||||
columns: [
|
||||
{
|
||||
accessorKey: "action_picture",
|
||||
header: "تصویر اقدام",
|
||||
id: "action_picture",
|
||||
enableColumnFilter: false,
|
||||
enableSorting: false,
|
||||
datatype: "text",
|
||||
grow: false,
|
||||
size: 100,
|
||||
muiTableBodyCellProps: {
|
||||
sx: {
|
||||
borderLeft: "1px solid #e1e1e1",
|
||||
py: 0,
|
||||
"&:first-of-type": {
|
||||
borderLeft: "unset",
|
||||
},
|
||||
},
|
||||
},
|
||||
Cell: ({ renderedCellValue }) => {
|
||||
return renderedCellValue ? (
|
||||
<Stack alignItems={"center"} justifyContent={"center"}>
|
||||
<ActionPictureDialog image={renderedCellValue} />
|
||||
</Stack>
|
||||
) : (
|
||||
<>-</>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
accessorFn: (row) =>
|
||||
row.action_date ? (
|
||||
moment(row.action_date).locale("fa").format("HH:mm | yyyy/MM/DD")
|
||||
) : (
|
||||
<>-</>
|
||||
),
|
||||
header: "تاریخ اقدام",
|
||||
id: "action_date",
|
||||
enableColumnFilter: true,
|
||||
datatype: "date",
|
||||
filterMode: "between",
|
||||
grow: false,
|
||||
size: 100,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box sx={{ p: 1, border: 1, borderColor: "divider", borderRadius: 1 }}>
|
||||
<DataTableWithAuth
|
||||
need_filter={true}
|
||||
columns={columns}
|
||||
sorting={[{ id: "id", desc: true }]}
|
||||
table_url={GET_SAFETY_AND_PRIVACY_SUPERVISOR}
|
||||
page_name={"roadSafetyOperator"}
|
||||
table_name={"roadSafetyOperatorList"}
|
||||
TableToolbar={Toolbar}
|
||||
enableRowActions
|
||||
positionActionsColumn={"last"}
|
||||
RowActions={RowActions}
|
||||
/>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default SupervisorList;
|
||||
11
src/components/dashboard/roadSafety/supervisor/Toolbar.jsx
Normal file
11
src/components/dashboard/roadSafety/supervisor/Toolbar.jsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Stack } from "@mui/material";
|
||||
import PrintExcel from "./ExcelPrint";
|
||||
|
||||
const Toolbar = ({ table, filterData, mutate }) => {
|
||||
return (
|
||||
<Stack direction={"row"} spacing={1}>
|
||||
<PrintExcel filterData={filterData} table={table} />
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
export default Toolbar;
|
||||
14
src/components/dashboard/roadSafety/supervisor/index.jsx
Normal file
14
src/components/dashboard/roadSafety/supervisor/index.jsx
Normal file
@@ -0,0 +1,14 @@
|
||||
"use client";
|
||||
import PageTitle from "@/core/components/PageTitle";
|
||||
import { Stack } from "@mui/material";
|
||||
import SupervisorList from "./SupervisorList";
|
||||
|
||||
const SupervisorPage = () => {
|
||||
return (
|
||||
<Stack spacing={1}>
|
||||
<PageTitle title={"کارتابل ارزیابی نگهداری حریم راه"} />
|
||||
<SupervisorList />
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
export default SupervisorPage;
|
||||
@@ -4,6 +4,7 @@ import DialogLoading from "@/core/components/DialogLoading";
|
||||
import useRequest from "@/lib/hooks/useRequest";
|
||||
import { GET_TOLL_HOUSE_IMAGES } from "@/core/utils/routes";
|
||||
import { Typography } from "@mui/material";
|
||||
const titles = ["نمای کلی از راهداری", "آشیانه ماشین آلات", "انباری شن و ماسه", "محیط کاری", "سایر تصاویر"];
|
||||
|
||||
const ImagesContent = ({ rowId }) => {
|
||||
const requestServer = useRequest();
|
||||
@@ -27,7 +28,7 @@ const ImagesContent = ({ rowId }) => {
|
||||
<DialogLoading />
|
||||
) : tollHouseImages ? (
|
||||
tollHouseImages.map((image, index) => {
|
||||
return <ImageFormContent key={index} image={image.path} />;
|
||||
return <ImageFormContent key={index} image={image.path} title={titles[index]} />;
|
||||
})
|
||||
) : (
|
||||
<Typography textAlign={"center"}>تصویری در سامانه یافت نشد</Typography>
|
||||
|
||||
@@ -7,6 +7,7 @@ import Profile from "@/core/components/Profile";
|
||||
import { filterMenuItems } from "@/core/utils/filterMenuItems";
|
||||
import { pageMenu } from "@/core/utils/pageMenu";
|
||||
import SidebarListItems from "./SidebarListItems";
|
||||
import { pageMenuDev } from "@/core/utils/pageMenuDev";
|
||||
|
||||
function selectPage(item, route) {
|
||||
if (item.type === "page") {
|
||||
@@ -76,7 +77,7 @@ function reducer(state, action) {
|
||||
|
||||
const SidebarMenu = () => {
|
||||
const { data: userPermissions } = usePermissions();
|
||||
const [menuItems, dispatch] = useReducer(reducer, pageMenu);
|
||||
const [menuItems, dispatch] = useReducer(reducer, process.env.NODE_ENV == "production" ? pageMenu : pageMenuDev);
|
||||
const pathname = usePathname();
|
||||
const [selectedKey, setSelectedKey] = useState(null);
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ const HeaderWithSidebar = ({ children }) => {
|
||||
setOpen(!isMobile); // Toggle state when screen size changes
|
||||
}, [isMobile]);
|
||||
|
||||
const now = moment().locale("fa").format("YYYY/MM/DD");
|
||||
const now = moment().locale("fa").format("dddd YYYY/MM/DD");
|
||||
|
||||
const handleDrawerOpen = () => {
|
||||
setOpen(true);
|
||||
|
||||
26
src/core/components/HourSelect.jsx
Normal file
26
src/core/components/HourSelect.jsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { FormControl, FormHelperText, InputLabel, MenuItem, Select } from "@mui/material";
|
||||
|
||||
const HourSelect = ({ label, error, name, value, onChange }) => {
|
||||
return (
|
||||
<FormControl fullWidth size="small" error={!!error}>
|
||||
<InputLabel>{label}</InputLabel>
|
||||
<Select
|
||||
label={label}
|
||||
name={name}
|
||||
size="small"
|
||||
value={value}
|
||||
onChange={(e) => {
|
||||
onChange(e.target.value);
|
||||
}}
|
||||
>
|
||||
{Array.from({ length: 24 }, (_, i) => (
|
||||
<MenuItem key={i} value={i}>
|
||||
{`${i.toString().padStart(2, "0")}:00`}
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
<FormHelperText>{error?.message}</FormHelperText>
|
||||
</FormControl>
|
||||
);
|
||||
};
|
||||
export default HourSelect;
|
||||
@@ -15,6 +15,7 @@ import AdminPanelSettingsIcon from "@mui/icons-material/AdminPanelSettings";
|
||||
import MapIcon from "@mui/icons-material/Map";
|
||||
import SpeedIcon from "@mui/icons-material/Speed";
|
||||
import EngineeringIcon from "@mui/icons-material/Engineering";
|
||||
import ReportIcon from "@mui/icons-material/Report";
|
||||
import AssessmentIcon from "@mui/icons-material/Assessment";
|
||||
import AssignmentLateIcon from "@mui/icons-material/AssignmentLate";
|
||||
import LockPersonIcon from "@mui/icons-material/LockPerson";
|
||||
@@ -109,7 +110,7 @@ export const pageMenu = [
|
||||
id: "roadItemManagmentSupervisorCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/road-items/supervisor",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_items/supervisor/cartable",
|
||||
permissions: [
|
||||
"show-road-item-supervise-cartable",
|
||||
"show-road-item-supervise-cartable-province",
|
||||
@@ -125,11 +126,18 @@ export const pageMenu = [
|
||||
hasSubitems: true,
|
||||
badges: [{ key: "roadItem.operation_cnt" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadItemManagmentOparationCreate",
|
||||
label: "ثبت فعالیت",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_items/operator/create",
|
||||
permissions: ["create-road-item"],
|
||||
},
|
||||
{
|
||||
id: "roadItemManagmentOparationCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/road-items/operator",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_items/operator/cartable",
|
||||
permissions: ["create-road-item"],
|
||||
},
|
||||
],
|
||||
@@ -138,7 +146,7 @@ export const pageMenu = [
|
||||
id: "roadItemManagmentMap",
|
||||
label: "پراکندگی بر روی نقشه",
|
||||
type: "page",
|
||||
route: "/dashboard/road-items/reports/map",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=road_items",
|
||||
icon: <MapIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: [
|
||||
"show-road-item-supervise-cartable",
|
||||
@@ -149,32 +157,13 @@ export const pageMenu = [
|
||||
{
|
||||
id: "roadItemManagmentReport",
|
||||
label: "گزارش ها",
|
||||
type: "menu",
|
||||
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadItemManagmentReportProvince",
|
||||
label: "تعداد فعالیت ها به تفکیک آیتم",
|
||||
type: "page",
|
||||
route: "/dashboard/road-items/reports/items-report",
|
||||
permissions: [
|
||||
"show-road-item-supervise-cartable",
|
||||
"show-road-item-supervise-cartable-province",
|
||||
"create-road-item",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadItemManagmentReportItems",
|
||||
label: "تعداد و حجم فعالیت ها به تفکیک موارد اقدام شده",
|
||||
type: "page",
|
||||
route: "/dashboard/road-items/reports/sub-items-report",
|
||||
permissions: [
|
||||
"show-road-item-supervise-cartable",
|
||||
"show-road-item-supervise-cartable-province",
|
||||
"create-road-item",
|
||||
],
|
||||
},
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_items/report",
|
||||
icon: <ReportIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: [
|
||||
"show-road-item-supervise-cartable",
|
||||
"show-road-item-supervise-cartable-province",
|
||||
"create-road-item",
|
||||
],
|
||||
},
|
||||
],
|
||||
@@ -197,7 +186,7 @@ export const pageMenu = [
|
||||
id: "roadPatrolManagmentSupervisorCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/road-patrols/supervisor",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_patrols/supervisor/cartable",
|
||||
permissions: [
|
||||
"show-road-patrol-supervise-cartable",
|
||||
"show-road-patrol-supervise-cartable-province",
|
||||
@@ -212,11 +201,18 @@ export const pageMenu = [
|
||||
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadPatrolManagmentOparationCreate",
|
||||
label: "ثبت اقدام",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_patrols/operator/create",
|
||||
permissions: ["add-road-patrol"],
|
||||
},
|
||||
{
|
||||
id: "roadPatrolManagmentOparationCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/road-patrols/operator",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_patrols/operator/cartable",
|
||||
permissions: ["add-road-patrol"],
|
||||
},
|
||||
],
|
||||
@@ -237,8 +233,8 @@ export const pageMenu = [
|
||||
id: "roadPatrolManagmentReport",
|
||||
label: "گزارش ها",
|
||||
type: "page",
|
||||
route: "/dashboard/road-patrols/reports",
|
||||
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_patrols/report",
|
||||
icon: <ReportIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: [
|
||||
"add-road-patrol",
|
||||
"show-road-patrol-supervise-cartable",
|
||||
@@ -291,10 +287,31 @@ export const pageMenu = [
|
||||
icon: <RouteIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: [
|
||||
{ key: "safetyAndPrivacy.supervise_cnt" },
|
||||
{ key: "safetyAndPrivacy.step_one", color: "warning" },
|
||||
{ key: "safetyAndPrivacy.step_two", color: "error" },
|
||||
],
|
||||
Subitems: [
|
||||
{
|
||||
id: "safetyAndPrivacyManagmentSupervisor",
|
||||
label: "ارزیابی",
|
||||
type: "menu",
|
||||
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: [{ key: "safetyAndPrivacy.supervise_cnt" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "safetyAndPrivacyManagmentSupervisorCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/road-safety/supervisor",
|
||||
permissions: [
|
||||
"show-safety-and-privacy-operator-cartable",
|
||||
"show-safety-and-privacy-operator-cartable-province",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "safetyAndPrivacyManagmentOparation",
|
||||
label: "عملیات",
|
||||
@@ -311,11 +328,7 @@ export const pageMenu = [
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/road-safety/operator",
|
||||
permissions: [
|
||||
"show-safety-and-privacy-operator-cartable",
|
||||
"show-safety-and-privacy-operator-cartable-province",
|
||||
"show-safety-and-privacy-operator-cartable-edarate-shahri",
|
||||
],
|
||||
permissions: ["show-safety-and-privacy-operator-cartable-edarate-shahri"],
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -365,11 +378,19 @@ export const pageMenu = [
|
||||
id: "roadObservationsManagmentSupervisorCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/fast-react/supervisor",
|
||||
permissions: ["show-fast-react", "show-fast-react-province"],
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_observations/supervisor/cartable",
|
||||
permissions: ["supervise-fast-react", "supervise-fast-react-province"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadObservationsManagmentList",
|
||||
label: "رسیدگی به شکایات",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_observations",
|
||||
icon: <AssignmentLateIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["show-fast-react", "show-fast-react-province", "show-fast-react-edarate-shahri"],
|
||||
},
|
||||
{
|
||||
id: "roadObservationsManagmentOparation",
|
||||
label: "عملیات",
|
||||
@@ -382,8 +403,8 @@ export const pageMenu = [
|
||||
id: "roadObservationsManagmentOparationCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/fast-react/operator",
|
||||
permissions: ["show-fast-react-edarate-shahri"],
|
||||
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"],
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -400,7 +421,7 @@ export const pageMenu = [
|
||||
label: "گزارش ها",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_observations/report/index",
|
||||
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
icon: <ReportIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["all"],
|
||||
},
|
||||
],
|
||||
@@ -433,7 +454,7 @@ export const pageMenu = [
|
||||
label: "گزارش ها",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=campNew",
|
||||
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
icon: <ReportIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["show-camp", "show-camp-province"],
|
||||
},
|
||||
],
|
||||
@@ -456,17 +477,17 @@ export const pageMenu = [
|
||||
id: "receiptManagmentOparationCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/damages/operator",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/receipt",
|
||||
permissions: ["all"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "damagesManagmentReport",
|
||||
id: "receiptManagmentReport",
|
||||
label: "گزارش ها",
|
||||
type: "page",
|
||||
route: "/dashboard/damages/report",
|
||||
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
icon: <ReportIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["show-receipt", "show-receipt-province"],
|
||||
},
|
||||
],
|
||||
|
||||
548
src/core/utils/pageMenuDev.js
Normal file
548
src/core/utils/pageMenuDev.js
Normal file
@@ -0,0 +1,548 @@
|
||||
import SpaceDashboardIcon from "@mui/icons-material/SpaceDashboard";
|
||||
import GroupsIcon from "@mui/icons-material/Groups";
|
||||
import AccountTreeIcon from "@mui/icons-material/AccountTree";
|
||||
import FactCheckIcon from "@mui/icons-material/FactCheck";
|
||||
import FireTruckIcon from "@mui/icons-material/FireTruck";
|
||||
import RouteIcon from "@mui/icons-material/Route";
|
||||
import DoorbellIcon from "@mui/icons-material/Doorbell";
|
||||
import ElectricBoltIcon from "@mui/icons-material/ElectricBolt";
|
||||
import CottageIcon from "@mui/icons-material/Cottage";
|
||||
import GppMaybeIcon from "@mui/icons-material/GppMaybe";
|
||||
import GavelIcon from "@mui/icons-material/Gavel";
|
||||
import BallotIcon from "@mui/icons-material/Ballot";
|
||||
import AssistantIcon from "@mui/icons-material/Assistant";
|
||||
import AdminPanelSettingsIcon from "@mui/icons-material/AdminPanelSettings";
|
||||
import MapIcon from "@mui/icons-material/Map";
|
||||
import SpeedIcon from "@mui/icons-material/Speed";
|
||||
import EngineeringIcon from "@mui/icons-material/Engineering";
|
||||
import AssessmentIcon from "@mui/icons-material/Assessment";
|
||||
import AssignmentLateIcon from "@mui/icons-material/AssignmentLate";
|
||||
import LockPersonIcon from "@mui/icons-material/LockPerson";
|
||||
import LineAxisIcon from "@mui/icons-material/LineAxis";
|
||||
import ScienceIcon from "@mui/icons-material/Science";
|
||||
import DriveEtaIcon from "@mui/icons-material/DriveEta";
|
||||
import BiotechIcon from "@mui/icons-material/Biotech";
|
||||
|
||||
export const pageMenuDev = [
|
||||
{
|
||||
id: "dashboard",
|
||||
label: "پیشخوان",
|
||||
type: "page",
|
||||
route: "/dashboard",
|
||||
icon: <SpaceDashboardIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["all"],
|
||||
},
|
||||
{
|
||||
id: "userManagement",
|
||||
label: "مدیریت کاربران",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/user_management",
|
||||
icon: <GroupsIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["full-user-management", "limited-user-management"],
|
||||
},
|
||||
{
|
||||
id: "projectsManagment",
|
||||
label: "پروژه های راهداری",
|
||||
type: "menu",
|
||||
icon: <AccountTreeIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
Subitems: [
|
||||
{
|
||||
id: "projectsManagmentFinance",
|
||||
label: "ثبت قرارداد و پروژه",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/rahdari_projects/finance",
|
||||
icon: <GavelIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["show-contract", "show-contract-province"],
|
||||
},
|
||||
{
|
||||
id: "projectsManagmentList",
|
||||
label: "لیست پروژه ها",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/rahdari_projects/projects_list",
|
||||
icon: <BallotIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["all"],
|
||||
},
|
||||
{
|
||||
id: "projectsManagmentProposal",
|
||||
label: "پروژه های پیشنهادی",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/rahdari_projects/proposal",
|
||||
icon: <AssistantIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["show-proposal", "show-proposal-province"],
|
||||
},
|
||||
{
|
||||
id: "projectsManagmentLawmaker",
|
||||
label: "درخواست نمایندگان",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/rahdari_projects/lawmakers",
|
||||
icon: <AdminPanelSettingsIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["show-lawmaker", "show-lawmaker-province"],
|
||||
},
|
||||
{
|
||||
id: "projectsManagmentMap",
|
||||
label: "پراکندگی بر روی نقشه",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=rahdari_projects",
|
||||
icon: <MapIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["all"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadItemManagment",
|
||||
label: "فعالیت های روزانه",
|
||||
type: "menu",
|
||||
icon: <FactCheckIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: [{ key: "roadItem.total" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadItemManagmentSupervisor",
|
||||
label: "ارزیابی",
|
||||
type: "menu",
|
||||
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: [{ key: "roadItem.supervise_cnt" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadItemManagmentSupervisorCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/road-items/supervisor",
|
||||
permissions: [
|
||||
"show-road-item-supervise-cartable",
|
||||
"show-road-item-supervise-cartable-province",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadItemManagmentOparation",
|
||||
label: "عملیات",
|
||||
type: "menu",
|
||||
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: [{ key: "roadItem.operation_cnt" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadItemManagmentOparationCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/road-items/operator",
|
||||
permissions: ["create-road-item"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadItemManagmentMap",
|
||||
label: "پراکندگی بر روی نقشه",
|
||||
type: "page",
|
||||
route: "/dashboard/road-items/reports/map",
|
||||
icon: <MapIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: [
|
||||
"show-road-item-supervise-cartable",
|
||||
"show-road-item-supervise-cartable-province",
|
||||
"create-road-item",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadItemManagmentReport",
|
||||
label: "گزارش ها",
|
||||
type: "menu",
|
||||
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadItemManagmentReportProvince",
|
||||
label: "تعداد فعالیت ها به تفکیک آیتم",
|
||||
type: "page",
|
||||
route: "/dashboard/road-items/reports/items-report",
|
||||
permissions: [
|
||||
"show-road-item-supervise-cartable",
|
||||
"show-road-item-supervise-cartable-province",
|
||||
"create-road-item",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadItemManagmentReportItems",
|
||||
label: "تعداد و حجم فعالیت ها به تفکیک موارد اقدام شده",
|
||||
type: "page",
|
||||
route: "/dashboard/road-items/reports/sub-items-report",
|
||||
permissions: [
|
||||
"show-road-item-supervise-cartable",
|
||||
"show-road-item-supervise-cartable-province",
|
||||
"create-road-item",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadPatrolManagment",
|
||||
label: "گشت راهداری و ترابری",
|
||||
type: "menu",
|
||||
icon: <FireTruckIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadPatrolManagmentSupervisor",
|
||||
label: "ارزیابی",
|
||||
type: "menu",
|
||||
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadPatrolManagmentSupervisorCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/road-patrols/supervisor",
|
||||
permissions: [
|
||||
"show-road-patrol-supervise-cartable",
|
||||
"show-road-patrol-supervise-cartable-province",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadPatrolManagmentOparation",
|
||||
label: "عملیات",
|
||||
type: "menu",
|
||||
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadPatrolManagmentOparationCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/road-patrols/operator",
|
||||
permissions: ["add-road-patrol"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadPatrolManagmentMap",
|
||||
label: "پراکندگی بر روی نقشه",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=road_patrols",
|
||||
icon: <MapIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: [
|
||||
"add-road-patrol",
|
||||
"show-road-patrol-supervise-cartable",
|
||||
"show-road-patrol-supervise-cartable-province",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadPatrolManagmentReport",
|
||||
label: "گزارش ها",
|
||||
type: "page",
|
||||
route: "/dashboard/road-patrols/reports",
|
||||
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: [
|
||||
"add-road-patrol",
|
||||
"show-road-patrol-supervise-cartable",
|
||||
"show-road-patrol-supervise-cartable-province",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "inquiryPrivacyManagment",
|
||||
label: "استعلام حریم راه",
|
||||
type: "menu",
|
||||
icon: <DoorbellIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
Subitems: [
|
||||
{
|
||||
id: "cityAdminZaminGov",
|
||||
label: "استعلام حرائم پنجره واحد",
|
||||
type: "page",
|
||||
route: "/dashboard/inquiry-privacy/city-admin/zamin-gov",
|
||||
permissions: [],
|
||||
},
|
||||
{
|
||||
id: "provinceAdminZaminGov",
|
||||
label: "استعلام حرائم پنجره واحد",
|
||||
type: "page",
|
||||
route: "/dashboard/inquiry-privacy/province-admin/zamin-gov",
|
||||
permissions: [],
|
||||
},
|
||||
{
|
||||
id: "assistantZaminGov",
|
||||
label: "استعلام حرائم پنجره واحد",
|
||||
type: "page",
|
||||
route: "/dashboard/inquiry-privacy/assistant/zamin-gov",
|
||||
permissions: [],
|
||||
},
|
||||
{
|
||||
id: "generalManagerZaminGov",
|
||||
label: "استعلام حرائم پنجره واحد",
|
||||
type: "page",
|
||||
route: "/dashboard/inquiry-privacy/general-manager/zamin-gov",
|
||||
permissions: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "safetyAndPrivacyManagment",
|
||||
label: "نگهداری حریم راه",
|
||||
type: "menu",
|
||||
icon: <RouteIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: [
|
||||
{ key: "safetyAndPrivacy.supervise_cnt" },
|
||||
{ key: "safetyAndPrivacy.step_one", color: "warning" },
|
||||
{ key: "safetyAndPrivacy.step_two", color: "error" },
|
||||
],
|
||||
Subitems: [
|
||||
{
|
||||
id: "safetyAndPrivacyManagmentSupervisor",
|
||||
label: "ارزیابی",
|
||||
type: "menu",
|
||||
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: [{ key: "safetyAndPrivacy.supervise_cnt" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "safetyAndPrivacyManagmentSupervisorCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/road-safety/supervisor",
|
||||
permissions: [
|
||||
"show-safety-and-privacy-operator-cartable",
|
||||
"show-safety-and-privacy-operator-cartable-province",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "safetyAndPrivacyManagmentOparation",
|
||||
label: "عملیات",
|
||||
type: "menu",
|
||||
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: [
|
||||
{ key: "safetyAndPrivacy.step_one", color: "warning" },
|
||||
{ key: "safetyAndPrivacy.step_two", color: "error" },
|
||||
],
|
||||
Subitems: [
|
||||
{
|
||||
id: "safetyAndPrivacyManagmentOparationCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/road-safety/operator",
|
||||
permissions: ["show-safety-and-privacy-operator-cartable-edarate-shahri"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "safetyAndPrivacyManagmentMap",
|
||||
label: "پراکندگی بر روی نقشه",
|
||||
type: "page",
|
||||
route: "/dashboard/road-safety/reports/map",
|
||||
icon: <MapIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: [
|
||||
"show-safety-and-privacy-operator-cartable",
|
||||
"show-safety-and-privacy-operator-cartable-province",
|
||||
"show-safety-and-privacy-operator-cartable-edarate-shahri",
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "safetyAndPrivacyManagmentReport",
|
||||
label: "گزارش ها",
|
||||
type: "page",
|
||||
route: "/dashboard/road-safety/reports",
|
||||
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: [
|
||||
"show-safety-and-privacy-operator-cartable",
|
||||
"show-safety-and-privacy-operator-cartable-province",
|
||||
"show-safety-and-privacy-operator-cartable-edarate-shahri",
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadObservationsManagment",
|
||||
label: "واکنش سریع",
|
||||
type: "menu",
|
||||
icon: <ElectricBoltIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: [{ key: "roadObserved.total" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadObservationsManagmentSupervisor",
|
||||
label: "ارزیابی",
|
||||
type: "menu",
|
||||
icon: <SpeedIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: [{ key: "roadObserved.supervise_cnt" }, { key: "roadObserved.complaint_cnt", color: "info" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadObservationsManagmentSupervisorCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/fast-react/supervisor",
|
||||
permissions: ["show-fast-react", "show-fast-react-province"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadObservationsManagmentOparation",
|
||||
label: "عملیات",
|
||||
type: "menu",
|
||||
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
badges: [{ key: "roadObserved.operation_cnt" }, { key: "roadObserved.complaint_cnt", color: "info" }],
|
||||
Subitems: [
|
||||
{
|
||||
id: "roadObservationsManagmentOparationCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/fast-react/operator",
|
||||
permissions: ["show-fast-react-edarate-shahri"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "roadObservationsManagmentMap",
|
||||
label: "پراکندگی بر روی نقشه",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=road_observations",
|
||||
icon: <MapIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["all"],
|
||||
},
|
||||
{
|
||||
id: "roadObservationsManagmentReport",
|
||||
label: "گزارش ها",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/road_observations/report/index",
|
||||
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["all"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "winterCampManagment",
|
||||
label: "قرارگاه زمستانی",
|
||||
type: "menu",
|
||||
icon: <CottageIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
Subitems: [
|
||||
{
|
||||
id: "winterCampManagmentBlocking",
|
||||
label: "محور های انسدادی",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/winter_camp",
|
||||
icon: <LineAxisIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["show-camp", "show-camp-province"],
|
||||
},
|
||||
{
|
||||
id: "winterCampManagmentFirstRing",
|
||||
label: "محور های حلقه اول",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=camp",
|
||||
icon: <LineAxisIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["show-camp", "show-camp-province"],
|
||||
},
|
||||
{
|
||||
id: "winterCampManagmentReport",
|
||||
label: "گزارش ها",
|
||||
type: "page",
|
||||
route: process.env.NEXT_PUBLIC_API_URL + "/v2/map?type=campNew",
|
||||
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["show-camp", "show-camp-province"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "receiptManagment",
|
||||
label: "خسارات وارده بر ابنیه فنی و تاسیسات راه",
|
||||
type: "menu",
|
||||
icon: <GppMaybeIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
Subitems: [
|
||||
{
|
||||
id: "receiptManagmentOparation",
|
||||
label: "عملیات",
|
||||
type: "menu",
|
||||
icon: <EngineeringIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
Subitems: [
|
||||
{
|
||||
id: "receiptManagmentOparationCartable",
|
||||
label: "کارتابل",
|
||||
type: "page",
|
||||
route: "/dashboard/damages/operator",
|
||||
permissions: ["all"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "damagesManagmentReport",
|
||||
label: "گزارش ها",
|
||||
type: "page",
|
||||
route: "/dashboard/damages/report",
|
||||
icon: <AssessmentIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["show-receipt", "show-receipt-province"],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "azmayesh",
|
||||
label: "آزمایشات (OPTS)",
|
||||
type: "page",
|
||||
route: "/dashboard/azmayesh",
|
||||
icon: <ScienceIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["azmayesh-management"],
|
||||
},
|
||||
{
|
||||
id: "azmayeshType",
|
||||
label: "نوع آزمایشات",
|
||||
type: "page",
|
||||
route: "/dashboard/azmayesh_type",
|
||||
icon: <BiotechIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["azmayesh-type-management"],
|
||||
},
|
||||
{
|
||||
id: "adminManagement",
|
||||
label: "مدیریت سامانه",
|
||||
type: "menu",
|
||||
icon: <AdminPanelSettingsIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
hasSubitems: true,
|
||||
Subitems: [
|
||||
{
|
||||
id: "permissionItem",
|
||||
label: "سطح دسترسی ها",
|
||||
type: "page",
|
||||
route: "/dashboard/permissions",
|
||||
icon: <LockPersonIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["manage-permissions"],
|
||||
},
|
||||
{
|
||||
id: "userActivities",
|
||||
label: "انواع فعالیت کاربران",
|
||||
type: "page",
|
||||
route: "/dashboard/user-activities",
|
||||
icon: <AssignmentLateIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["manage-log-list"],
|
||||
},
|
||||
{
|
||||
id: "damageItems",
|
||||
label: "آیتم خسارات وارده بر ابنیه فنی",
|
||||
type: "page",
|
||||
route: "/dashboard/damage-items",
|
||||
icon: <GppMaybeIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: ["manage-damage"],
|
||||
},
|
||||
{
|
||||
id: "CarDetails",
|
||||
label: "اطلاعات خودرو",
|
||||
type: "page",
|
||||
route: "/dashboard/car-details",
|
||||
icon: <DriveEtaIcon sx={{ width: "inherit", height: "inherit" }} />,
|
||||
permissions: [""],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -130,15 +130,22 @@ export const EXPORT_FAST_REACT_OPERATOR_LIST = api + "/api/v3/road_observations/
|
||||
export const EXPORT_FAST_REACT_COMPLAINT_LIST = api + "/api/v3/road_observations/complaints_report";
|
||||
|
||||
// road safety
|
||||
export const GET_SAFETY_AND_PRIVACY = api + "/api/v3/safety_and_privacy";
|
||||
export const DELETE_SAFETY_AND_PRIVACY = api + "/api/v3/safety_and_privacy";
|
||||
export const GET_SAFETY_AND_PRIVACY_OPERATOR = api + "/api/v3/safety_and_privacy/operator";
|
||||
export const DELETE_SAFETY_AND_PRIVACY = api + "/api/v3/safety_and_privacy/operator";
|
||||
export const FIRST_STEP_STORE = api + "/api/v3/safety_and_privacy/operator/first_step_store";
|
||||
export const SECOND_STEP_STORE = api + "/api/v3/safety_and_privacy/operator/second_step_store";
|
||||
export const THIRD_STEP_STORE = api + "/api/v3/safety_and_privacy/operator/third_step_store";
|
||||
export const UPDATE_SAFETY_AND_PRIVACY = api + "/api/v3/safety_and_privacy/operator";
|
||||
export const FINISH_ROAD_SAFETY_BY_SUPERVISOR = api + "/api/v3/safety_and_privacy/operator/finish";
|
||||
export const EXPORT_OPERATOR_ROAD_SAFETY = api + "/api/v3/safety_and_privacy/operator/excel_report";
|
||||
|
||||
export const GET_SAFETY_AND_PRIVACY_SUPERVISOR = api + "/api/v3/safety_and_privacy/supervisor";
|
||||
export const EXPORT_SUPERVISOR_ROAD_SAFETY = api + "/api/v3/safety_and_privacy/supervisor/excel_report";
|
||||
export const CONFIRM_ROAD_SAFETY_BY_SUPERVISOR = api + "/api/v3/safety_and_privacy/supervisor/confirm";
|
||||
export const REJECT_ROAD_SAFETY_BY_SUPERVISOR = api + "/api/v3/safety_and_privacy/supervisor/reject";
|
||||
|
||||
export const DESERIALIZE_JUDICIARY_DOCUMENT = api + "/api/v3/safety_and_privacy/deserialize";
|
||||
export const GET_SAFETY_AND_PRIVACY_ITEM = api + "/api/v3/safety_and_privacy/sub_items";
|
||||
export const FIRST_STEP_STORE = api + "/api/v3/safety_and_privacy/first_step_store";
|
||||
export const SECOND_STEP_STORE = api + "/api/v3/safety_and_privacy/second_step_store";
|
||||
export const THIRD_STEP_STORE = api + "/api/v3/safety_and_privacy/third_step_store";
|
||||
export const UPDATE_SAFETY_AND_PRIVACY = api + "/api/v3/safety_and_privacy";
|
||||
export const EXPORT_OPERATOR_ROAD_SAFETY = api + "/api/v3/safety_and_privacy/excel_report";
|
||||
export const GET_ROAD_SAFETY_PROVINCE_ACTIVITY_REPORT = api + "/api/v3/safety_and_privacy_report/country_activity";
|
||||
export const GET_ROAD_SAFETY_CITY_ACTIVITY_REPORT = api + "/api/v3/safety_and_privacy_report/province_activity";
|
||||
export const GET_ROAD_SAFETY_REPORT_MAP = api + "/api/v3/safety_and_privacy/map";
|
||||
|
||||
Reference in New Issue
Block a user