Merge branch 'feature/page_permission_middleware' into 'develop'
formatting and complete permission part of pages and removing _fencing page... See merge request witel-front-end/rms!33
This commit is contained in:
@@ -1,7 +1,12 @@
|
|||||||
import AzmayeshPage from "@/components/dashboard/azmayesh";
|
import AzmayeshPage from "@/components/dashboard/azmayesh";
|
||||||
|
import WithPermission from "@/core/middlewares/withPermission";
|
||||||
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
return <AzmayeshPage />;
|
return (
|
||||||
|
<WithPermission permission_name={["azmayesh-management"]}>
|
||||||
|
<AzmayeshPage />
|
||||||
|
</WithPermission>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Page;
|
export default Page;
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
import AzmayeshTypePage from "@/components/dashboard/azmayeshType";
|
import AzmayeshTypePage from "@/components/dashboard/azmayeshType";
|
||||||
|
import WithPermission from "@/core/middlewares/withPermission";
|
||||||
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
return <AzmayeshTypePage />;
|
return (
|
||||||
|
<WithPermission permission_name={["azmayesh-type-management"]}>
|
||||||
|
<AzmayeshTypePage />
|
||||||
|
</WithPermission>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Page;
|
export default Page;
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
import InquiryPrivacyFencingPage from "@/components/dashboard/inquiryPrivacyFencing";
|
|
||||||
|
|
||||||
const Page = () => {
|
|
||||||
return <InquiryPrivacyFencingPage />;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default Page;
|
|
||||||
@@ -1,7 +1,12 @@
|
|||||||
import AssistantZaminGovComponent from "@/components/dashboard/inquiryPrivacy/assistant/zaminGov";
|
import AssistantZaminGovComponent from "@/components/dashboard/inquiryPrivacy/assistant/zaminGov";
|
||||||
|
import WithPermission from "@/core/middlewares/withPermission";
|
||||||
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
return <AssistantZaminGovComponent />;
|
return (
|
||||||
|
<WithPermission>
|
||||||
|
<AssistantZaminGovComponent />
|
||||||
|
</WithPermission>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Page;
|
export default Page;
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
import CityAdminZaminGovComponent from "@/components/dashboard/inquiryPrivacy/cityAdmin/zaminGov";
|
import CityAdminZaminGovComponent from "@/components/dashboard/inquiryPrivacy/cityAdmin/zaminGov";
|
||||||
|
import WithPermission from "@/core/middlewares/withPermission";
|
||||||
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
return <CityAdminZaminGovComponent />;
|
return (
|
||||||
|
<WithPermission>
|
||||||
|
<CityAdminZaminGovComponent />
|
||||||
|
</WithPermission>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Page;
|
export default Page;
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
import GeneralManagerZaminGovComponent from "@/components/dashboard/inquiryPrivacy/generalManager/zaminGov";
|
import GeneralManagerZaminGovComponent from "@/components/dashboard/inquiryPrivacy/generalManager/zaminGov";
|
||||||
|
import WithPermission from "@/core/middlewares/withPermission";
|
||||||
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
return <GeneralManagerZaminGovComponent />;
|
return (
|
||||||
|
<WithPermission>
|
||||||
|
<GeneralManagerZaminGovComponent />
|
||||||
|
</WithPermission>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Page;
|
export default Page;
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
import ProvinceAdminZaminGovComponent from "@/components/dashboard/inquiryPrivacy/provinceAdmin/zaminGov";
|
import ProvinceAdminZaminGovComponent from "@/components/dashboard/inquiryPrivacy/provinceAdmin/zaminGov";
|
||||||
|
import WithPermission from "@/core/middlewares/withPermission";
|
||||||
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
return <ProvinceAdminZaminGovComponent />;
|
return (
|
||||||
|
<WithPermission>
|
||||||
|
<ProvinceAdminZaminGovComponent />
|
||||||
|
</WithPermission>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Page;
|
export default Page;
|
||||||
|
|||||||
@@ -1,55 +0,0 @@
|
|||||||
"use client";
|
|
||||||
import DialogTransition from "@/core/components/DialogTransition";
|
|
||||||
import { AddCircle, Close } from "@mui/icons-material";
|
|
||||||
import { Button, Dialog, DialogTitle, IconButton, useMediaQuery } from "@mui/material";
|
|
||||||
import CreateOrUpdateForm from "../../Forms/CreateOrUpdate";
|
|
||||||
import { SET_INQUIRE_PRIVACY_FENCING } from "@/core/utils/routes";
|
|
||||||
import { useState } from "react";
|
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
|
|
||||||
const InquiryPrivacyFencingCreate = ({ mutate }) => {
|
|
||||||
const theme = useTheme();
|
|
||||||
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
|
||||||
const [open, setOpen] = useState(false);
|
|
||||||
|
|
||||||
const handleOpen = () => {
|
|
||||||
setOpen(true);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleClose = () => {
|
|
||||||
setOpen(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{isMobile ? (
|
|
||||||
<IconButton aria-label="ایجاد پاسخ به استعلام" color="primary" onClick={handleOpen}>
|
|
||||||
<AddCircle sx={{ fontSize: "25px" }} />
|
|
||||||
</IconButton>
|
|
||||||
) : (
|
|
||||||
<Button variant="contained" color="primary" startIcon={<AddCircle />} onClick={handleOpen}>
|
|
||||||
ایجاد پاسخ به استعلام
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
<Dialog open={open} fullScreen TransitionComponent={DialogTransition}>
|
|
||||||
<DialogTitle sx={{ m: 0, p: 2, borderBottom: 1, borderColor: "divider" }} id="create-dialog">
|
|
||||||
ایجاد پاسخ به استعلام
|
|
||||||
</DialogTitle>
|
|
||||||
<IconButton
|
|
||||||
aria-label="close"
|
|
||||||
onClick={handleClose}
|
|
||||||
sx={{
|
|
||||||
position: "absolute",
|
|
||||||
right: 8,
|
|
||||||
top: 8,
|
|
||||||
color: (theme) => theme.palette.grey[500],
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Close />
|
|
||||||
</IconButton>
|
|
||||||
<CreateOrUpdateForm handleClose={handleClose} mutate={mutate} url={SET_INQUIRE_PRIVACY_FENCING} />
|
|
||||||
</Dialog>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default InquiryPrivacyFencingCreate;
|
|
||||||
@@ -1,869 +0,0 @@
|
|||||||
import LtrTextField from "@/core/components/LtrTextField";
|
|
||||||
import StyledForm from "@/core/components/StyledForm";
|
|
||||||
import useRequest from "@/lib/hooks/useRequest";
|
|
||||||
import {
|
|
||||||
Autocomplete,
|
|
||||||
Box,
|
|
||||||
Button,
|
|
||||||
Chip,
|
|
||||||
Container,
|
|
||||||
DialogActions,
|
|
||||||
DialogContent,
|
|
||||||
Fade,
|
|
||||||
Grid,
|
|
||||||
InputAdornment,
|
|
||||||
Stack,
|
|
||||||
TextField,
|
|
||||||
Typography,
|
|
||||||
} from "@mui/material";
|
|
||||||
import { DatePicker, LocalizationProvider, faIR } from "@mui/x-date-pickers";
|
|
||||||
import { AdapterDateFnsJalali } from "@mui/x-date-pickers/AdapterDateFnsJalali";
|
|
||||||
import moment from "jalali-moment";
|
|
||||||
import { Controller, useForm } from "react-hook-form";
|
|
||||||
import LocationOnMap from "./LocationOnMap";
|
|
||||||
|
|
||||||
const initValues = {
|
|
||||||
dabirkhaneh_number: "",
|
|
||||||
nameh_date: moment(),
|
|
||||||
nameh_date_fa: "",
|
|
||||||
marjae_pasokh: "",
|
|
||||||
motaghazi_is_legal_id: null,
|
|
||||||
motaghazi_is_legal: "",
|
|
||||||
motaghazi_type_id: "",
|
|
||||||
motaghazi_type: null,
|
|
||||||
motaghazi_firstname: "",
|
|
||||||
motaghazi_lastname: "",
|
|
||||||
national_id: "",
|
|
||||||
shenase_melli: "",
|
|
||||||
tel_number: "",
|
|
||||||
mobile_number: "",
|
|
||||||
address: "",
|
|
||||||
edare_kol_id: null,
|
|
||||||
edare_kol: "",
|
|
||||||
edare_shahri_id: null,
|
|
||||||
edare_shahri: "",
|
|
||||||
rah_type_id: null,
|
|
||||||
rah_type: "",
|
|
||||||
name_mehvar_id: "",
|
|
||||||
name_mehvar_fa: null,
|
|
||||||
mizan_harim: null,
|
|
||||||
arze_navar: null,
|
|
||||||
samt_id: null,
|
|
||||||
samt: "",
|
|
||||||
kilometr: "",
|
|
||||||
lat: "",
|
|
||||||
lon: "",
|
|
||||||
zone: null,
|
|
||||||
karbari_type_id: null,
|
|
||||||
karbari_type: "",
|
|
||||||
tarh_title: "",
|
|
||||||
masahat_zirbana: "",
|
|
||||||
ehdasat_type_id: [],
|
|
||||||
ehdasat_type: "",
|
|
||||||
divarkeshi_distance: "",
|
|
||||||
mostahadesat_distance: "",
|
|
||||||
mahale_ejra_id: null,
|
|
||||||
mahale_ejra: "",
|
|
||||||
traffic_id: null,
|
|
||||||
traffic: "",
|
|
||||||
vaziat_eghtesadi_id: null,
|
|
||||||
vaziat_eghtesadi: "",
|
|
||||||
has_access_id: null,
|
|
||||||
has_access: "",
|
|
||||||
shomare_estelam_harim: "",
|
|
||||||
max_month: "",
|
|
||||||
max_day: "",
|
|
||||||
shomare_tahaodname: "",
|
|
||||||
shomare_daftarkhaneh: "",
|
|
||||||
description: "",
|
|
||||||
ronevesht: "",
|
|
||||||
};
|
|
||||||
|
|
||||||
const CreateOrUpdateForm = ({ handleClose, mutate, defaultValues, url }) => {
|
|
||||||
const request = useRequest();
|
|
||||||
const {
|
|
||||||
control,
|
|
||||||
watch,
|
|
||||||
register,
|
|
||||||
handleSubmit,
|
|
||||||
setValue,
|
|
||||||
formState: { isSubmitting },
|
|
||||||
} = useForm({ defaultValues: defaultValues || initValues });
|
|
||||||
|
|
||||||
const onSubmit = async (data) => {
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append("dabirkhaneh_number", data.dabirkhaneh_number);
|
|
||||||
formData.append("nameh_date", data.nameh_date.format("YYYY-MM-DD"));
|
|
||||||
formData.append("nameh_date_fa", data.nameh_date);
|
|
||||||
formData.append("marjae_pasokh", data.marjae_pasokh);
|
|
||||||
formData.append("motaghazi_is_legal_id", data.motaghazi_is_legal_id);
|
|
||||||
formData.append("motaghazi_is_legal", data.motaghazi_is_legal_id);
|
|
||||||
formData.append("motaghazi_type_id", 1);
|
|
||||||
formData.append("motaghazi_type", data.motaghazi_type);
|
|
||||||
formData.append("motaghazi_firstname", data.motaghazi_firstname);
|
|
||||||
formData.append("motaghazi_lastname", data.motaghazi_lastname);
|
|
||||||
formData.append("national_id", data.national_id);
|
|
||||||
formData.append("shenase_melli", data.national_id);
|
|
||||||
formData.append("tel_number", data.tel_number);
|
|
||||||
formData.append("mobile_number", data.mobile_number);
|
|
||||||
formData.append("address", data.address);
|
|
||||||
formData.append("edare_kol_id", data.edare_kol_id);
|
|
||||||
formData.append("edare_kol", data.edare_kol_id);
|
|
||||||
formData.append("edare_shahri_id", data.edare_shahri_id);
|
|
||||||
formData.append("edare_shahri", data.edare_shahri_id);
|
|
||||||
formData.append("rah_type_id", data.rah_type_id);
|
|
||||||
formData.append("rah_type", data.rah_type_id);
|
|
||||||
formData.append("name_mehvar_id", 1);
|
|
||||||
formData.append("name_mehvar_fa", data.name_mehvar_fa);
|
|
||||||
formData.append("mizan_harim", data.mizan_harim);
|
|
||||||
formData.append("arze_navar", data.arze_navar);
|
|
||||||
formData.append("samt_id", data.samt_id);
|
|
||||||
formData.append("samt", data.samt_id);
|
|
||||||
formData.append("kilometr", data.kilometr);
|
|
||||||
formData.append("lat", data.lat);
|
|
||||||
formData.append("lon", data.lon);
|
|
||||||
formData.append("zone", data.zone);
|
|
||||||
formData.append("karbari_type_id", data.karbari_type_id);
|
|
||||||
formData.append("karbari_type", data.karbari_type_id);
|
|
||||||
formData.append("tarh_title", data.tarh_title);
|
|
||||||
formData.append("masahat_zirbana", data.masahat_zirbana);
|
|
||||||
formData.append("ehdasat_type_id", data.ehdasat_type_id.join("|"));
|
|
||||||
formData.append("ehdasat_type", data.ehdasat_type_id.join("|"));
|
|
||||||
formData.append("divarkeshi_distance", data.divarkeshi_distance);
|
|
||||||
formData.append("mostahadesat_distance", data.mostahadesat_distance);
|
|
||||||
formData.append("mahale_ejra_id", data.mahale_ejra_id);
|
|
||||||
formData.append("mahale_ejra", data.mahale_ejra);
|
|
||||||
formData.append("traffic_id", data.traffic_id);
|
|
||||||
formData.append("traffic", data.traffic_id);
|
|
||||||
formData.append("vaziat_eghtesadi_id", data.vaziat_eghtesadi_id);
|
|
||||||
formData.append("vaziat_eghtesadi", data.vaziat_eghtesadi);
|
|
||||||
formData.append("has_access_id", data.has_access_id);
|
|
||||||
formData.append("has_access", data.has_access_id);
|
|
||||||
formData.append("shomare_estelam_harim", data.shomare_estelam_harim);
|
|
||||||
formData.append("max_month", data.max_month);
|
|
||||||
formData.append("max_day", data.max_day);
|
|
||||||
formData.append("shomare_tahaodname", data.shomare_tahaodname);
|
|
||||||
formData.append("shomare_daftarkhaneh", data.shomare_daftarkhaneh);
|
|
||||||
formData.append("description", data.description);
|
|
||||||
formData.append("ronevesht", data.ronevesht);
|
|
||||||
|
|
||||||
try {
|
|
||||||
await request(url, "post", { data: formData });
|
|
||||||
handleClose();
|
|
||||||
mutate();
|
|
||||||
} catch (error) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<LocalizationProvider
|
|
||||||
dateAdapter={AdapterDateFnsJalali}
|
|
||||||
localeText={faIR.components.MuiLocalizationProvider.defaultProps.localeText}
|
|
||||||
>
|
|
||||||
<DialogContent>
|
|
||||||
<Container maxWidth="lg">
|
|
||||||
<StyledForm onSubmit={handleSubmit(onSubmit)} id={"InquiryPrivacyFencingCreateForm"}>
|
|
||||||
<Grid container columns={{ xs: 1, sm: 2, md: 3 }} spacing={4}>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("dabirkhaneh_number")}
|
|
||||||
label="شماره دبیرخانه درخواست *"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
type="tel"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="nameh_date"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<DatePicker
|
|
||||||
value={value.toDate()}
|
|
||||||
onChange={(newValue) => onChange(moment(newValue))}
|
|
||||||
label="تاریخ نامه درخواست *"
|
|
||||||
slotProps={{
|
|
||||||
textField: { fullWidth: true, size: "small", autoComplete: "off" },
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("marjae_pasokh")}
|
|
||||||
label="مرجع درخواست کننده پاسخ به استعلام"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="motaghazi_is_legal_id"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["حقوقی", "حقیقی"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField autoComplete="off" fullWidth {...params} label="متقاضی *" />
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Fade
|
|
||||||
in={watch("motaghazi_is_legal_id") === "حقوقی"}
|
|
||||||
mountOnEnter={true}
|
|
||||||
unmountOnExit={true}
|
|
||||||
>
|
|
||||||
<Box>
|
|
||||||
<Controller
|
|
||||||
name="motaghazi_type"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["دولتی", "خصوصی"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
fullWidth
|
|
||||||
{...params}
|
|
||||||
label="نوع متقاضی *"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
</Fade>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}></Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("motaghazi_firstname")}
|
|
||||||
label="نام متقاضی *"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Fade
|
|
||||||
in={watch("motaghazi_is_legal_id") === "حقیقی"}
|
|
||||||
mountOnEnter={true}
|
|
||||||
unmountOnExit={true}
|
|
||||||
>
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("motaghazi_lastname")}
|
|
||||||
label="نام خانوادگی متقاضی *"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
</Fade>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("national_id")}
|
|
||||||
label="کد ملی/شناسه ملی *"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
type="tel"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("tel_number")}
|
|
||||||
label="تلفن"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
type="tel"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Fade
|
|
||||||
in={
|
|
||||||
watch("motaghazi_type") !== "دولتی" ||
|
|
||||||
watch("formik.values.motaghazi_is_legal_id") === "حقیقی"
|
|
||||||
}
|
|
||||||
mountOnEnter={true}
|
|
||||||
unmountOnExit={true}
|
|
||||||
>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("mobile_number")}
|
|
||||||
label="تلفن همراه *"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
type="tel"
|
|
||||||
/>
|
|
||||||
</Fade>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("address")}
|
|
||||||
label="آدرس *"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="edare_kol_id"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["تهران"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
fullWidth
|
|
||||||
{...params}
|
|
||||||
label="اداره كل راهداری و حمل و نقل جاده ای *"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="edare_shahri_id"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["تهران"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
fullWidth
|
|
||||||
{...params}
|
|
||||||
label="اداره شهرستان *"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="rah_type_id"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["آزاد راه", "بزرگراه", "راه فرعی درجه 3"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField autoComplete="off" fullWidth {...params} label="نوع راه *" />
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="name_mehvar_fa"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["سایر"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
fullWidth
|
|
||||||
{...params}
|
|
||||||
label="نام محور *"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Fade in={watch("name_mehvar_fa") === "سایر"} mountOnEnter={true} unmountOnExit={true}>
|
|
||||||
<TextField autoComplete="off" label="سایر محورها" size="small" fullWidth />
|
|
||||||
</Fade>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="samt_id"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["چپ", "راست"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField autoComplete="off" fullWidth {...params} label="سمت *" />
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="mizan_harim"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["12.5", "17.5"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
fullWidth
|
|
||||||
{...params}
|
|
||||||
label="میزان حریم *"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Fade
|
|
||||||
in={watch("rah_type_id") !== "راه فرعی درجه 3"}
|
|
||||||
mountOnEnter={true}
|
|
||||||
unmountOnExit={true}
|
|
||||||
>
|
|
||||||
<Box>
|
|
||||||
<Controller
|
|
||||||
name="arze_navar"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["15", "30"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
fullWidth
|
|
||||||
{...params}
|
|
||||||
label="عرض نوار تاسیساتی زیربنایی *"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
</Fade>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("kilometr")}
|
|
||||||
label="كيلومتر *"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
type="tel"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1} sm={2} sx={{ height: 300 }}>
|
|
||||||
<LocationOnMap
|
|
||||||
setValue={setValue}
|
|
||||||
defaultLatLon={defaultValues ? [defaultValues.lat, defaultValues.lon] : null}
|
|
||||||
defaultValues
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Stack spacing={3}>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("lat")}
|
|
||||||
label="عرض جغرافیایی"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
disabled={true}
|
|
||||||
/>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("lon")}
|
|
||||||
label="طول جغرافیایی"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
disabled={true}
|
|
||||||
/>
|
|
||||||
<Controller
|
|
||||||
name="zone"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["38", "39"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
fullWidth
|
|
||||||
{...params}
|
|
||||||
label="Zone *"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="karbari_type_id"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["اتاقک نگهبانی", "دولتی"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
fullWidth
|
|
||||||
{...params}
|
|
||||||
label="نوع کاربری *"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("tarh_title")}
|
|
||||||
label="عنوان طرح *"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("masahat_zirbana")}
|
|
||||||
label="مساحت زیربنا"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
type="tel"
|
|
||||||
InputProps={{
|
|
||||||
endAdornment: <InputAdornment position="end">مترمربع</InputAdornment>,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="ehdasat_type_id"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
multiple
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
renderTags={(value, getTagProps) =>
|
|
||||||
value.map((option, index) => {
|
|
||||||
const { key, ...tagProps } = getTagProps({ index });
|
|
||||||
return (
|
|
||||||
<Chip
|
|
||||||
label={option}
|
|
||||||
key={key}
|
|
||||||
size="small"
|
|
||||||
sx={{ "&.MuiAutocomplete-tag": { my: 0 } }}
|
|
||||||
{...tagProps}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
options={["تعمیرات", "احداث بنا"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
fullWidth
|
|
||||||
{...params}
|
|
||||||
label="نوع احداثات *"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("divarkeshi_distance")}
|
|
||||||
label="فاصله دیوارکشی از آکس محور"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
type="tel"
|
|
||||||
InputProps={{
|
|
||||||
endAdornment: <InputAdornment position="end">متر</InputAdornment>,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("mostahadesat_distance")}
|
|
||||||
label="فاصله مستحدثات از آکس محور"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
type="tel"
|
|
||||||
InputProps={{
|
|
||||||
endAdornment: <InputAdornment position="end">متر</InputAdornment>,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="mahale_ejra_id"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["داخل حریم"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField autoComplete="off" fullWidth {...params} label="محل اجرا" />
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="traffic_id"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["سبک (ضریب ۱)"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
fullWidth
|
|
||||||
{...params}
|
|
||||||
label="میزان ترافیک *"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="vaziat_eghtesadi_id"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["تست"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
fullWidth
|
|
||||||
{...params}
|
|
||||||
label="وضعیت اقتصادی"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Controller
|
|
||||||
name="has_access_id"
|
|
||||||
control={control}
|
|
||||||
render={({ field: { onChange, value } }) => (
|
|
||||||
<Autocomplete
|
|
||||||
size="small"
|
|
||||||
disablePortal
|
|
||||||
value={value}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
onChange(newValue);
|
|
||||||
}}
|
|
||||||
options={["بله", "خیر"]}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
fullWidth
|
|
||||||
{...params}
|
|
||||||
label="آیا راه دسترسی از قبل وجود دارد؟ *"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("shomare_estelam_harim")}
|
|
||||||
label="شماره استعلام دفتر ایمنی و حریم"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
type="tel"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<Stack direction={"row"} spacing={1} alignItems={"center"}>
|
|
||||||
<Typography sx={{ flex: 2 }} variant="body2">
|
|
||||||
حداکثر مدت زمان شروع عملیات: *
|
|
||||||
</Typography>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("max_month")}
|
|
||||||
sx={{ width: 60 }}
|
|
||||||
label="ماه"
|
|
||||||
size="small"
|
|
||||||
type="tel"
|
|
||||||
/>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("max_day")}
|
|
||||||
sx={{ width: 60 }}
|
|
||||||
label="روز"
|
|
||||||
size="small"
|
|
||||||
type="tel"
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("shomare_tahaodname")}
|
|
||||||
label="شماره تعهدنامه"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
type="tel"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<LtrTextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("shomare_daftarkhaneh")}
|
|
||||||
label="شماره دفترخانه"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
type="tel"
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}></Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("description")}
|
|
||||||
multiline
|
|
||||||
rows={2}
|
|
||||||
label="توضیحات"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}>
|
|
||||||
<TextField
|
|
||||||
autoComplete="off"
|
|
||||||
{...register("ronevesht")}
|
|
||||||
multiline
|
|
||||||
rows={2}
|
|
||||||
label="رونوشت"
|
|
||||||
size="small"
|
|
||||||
fullWidth
|
|
||||||
/>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={1}></Grid>
|
|
||||||
</Grid>
|
|
||||||
</StyledForm>
|
|
||||||
</Container>
|
|
||||||
</DialogContent>
|
|
||||||
<DialogActions sx={{ p: 2, borderTop: 1, borderColor: "divider" }}>
|
|
||||||
<Button
|
|
||||||
variant="contained"
|
|
||||||
size="large"
|
|
||||||
sx={{ width: 150 }}
|
|
||||||
type="submit"
|
|
||||||
form={"InquiryPrivacyFencingCreateForm"}
|
|
||||||
disabled={isSubmitting}
|
|
||||||
>
|
|
||||||
ثبت
|
|
||||||
</Button>
|
|
||||||
</DialogActions>
|
|
||||||
</LocalizationProvider>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default CreateOrUpdateForm;
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
import { useRef } from "react";
|
|
||||||
import { Marker, useMapEvents } from "react-leaflet";
|
|
||||||
import LocationMarker from "@/assets/images/locationMarker.png";
|
|
||||||
|
|
||||||
const locationMarker = L.icon({
|
|
||||||
iconUrl: LocationMarker.src,
|
|
||||||
iconSize: [50, 50],
|
|
||||||
iconAnchor: [25, 50],
|
|
||||||
});
|
|
||||||
|
|
||||||
const MarkerLocation = ({ setValue, defaultLatLon }) => {
|
|
||||||
const location = useRef();
|
|
||||||
const map = useMapEvents({
|
|
||||||
move: (e) => {
|
|
||||||
const latlon = e.target.getCenter();
|
|
||||||
location.current?.setLatLng(latlon);
|
|
||||||
setValue("lat", latlon.lat);
|
|
||||||
setValue("lon", latlon.lng);
|
|
||||||
},
|
|
||||||
zoom: (e) => {
|
|
||||||
const latlon = e.target.getCenter();
|
|
||||||
location.current?.setLatLng(latlon);
|
|
||||||
setValue("lat", latlon.lat);
|
|
||||||
setValue("lon", latlon.lng);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Marker
|
|
||||||
ref={location}
|
|
||||||
icon={locationMarker}
|
|
||||||
position={defaultLatLon ? L.LatLng(defaultLatLon.lat, defaultLatLon.lon) : map.getCenter()}
|
|
||||||
key="location"
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default MarkerLocation;
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import MapLoading from "@/core/components/MapLayer/Loading";
|
|
||||||
import { Paper, Stack } from "@mui/material";
|
|
||||||
import dynamic from "next/dynamic";
|
|
||||||
import MarkerLocation from "./MarkerLocation";
|
|
||||||
|
|
||||||
const MapLayer = dynamic(() => import("@/core/components/MapLayer"), {
|
|
||||||
loading: () => <MapLoading />,
|
|
||||||
ssr: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
const LocationOnMap = ({ setValue, defaultLatLon }) => {
|
|
||||||
return (
|
|
||||||
<Stack sx={{ height: "100%", position: "relative" }}>
|
|
||||||
<Paper sx={{ flexGrow: 1, border: 1, borderRadius: 1, borderColor: "divider" }} elevation={0}>
|
|
||||||
<MapLayer style={{ borderRadius: "4px" }}>
|
|
||||||
<MarkerLocation setValue={setValue} defaultLatLon={defaultLatLon} />
|
|
||||||
</MapLayer>
|
|
||||||
</Paper>
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default LocationOnMap;
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import InquiryPrivacyFencingCreate from "./Actions/Create";
|
|
||||||
|
|
||||||
const Toolbar = ({ mutate }) => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<InquiryPrivacyFencingCreate mutate={mutate} />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default Toolbar;
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import PageTitle from "@/core/components/PageTitle";
|
|
||||||
import InquiryPrivacyFencingList from "./inquiryPrivacyFencingList";
|
|
||||||
import { Stack } from "@mui/material";
|
|
||||||
|
|
||||||
const InquiryPrivacyFencingPage = () => {
|
|
||||||
return (
|
|
||||||
<Stack spacing={1}>
|
|
||||||
<PageTitle title={"احداث و بهره برداری دیوارکشی و مستحدثات"} />
|
|
||||||
<InquiryPrivacyFencingList />
|
|
||||||
</Stack>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default InquiryPrivacyFencingPage;
|
|
||||||
@@ -1,254 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { useMemo } from "react";
|
|
||||||
import Toolbar from "@/components/dashboard/inquiryPrivacyFencing/Toolbar";
|
|
||||||
import DataTable from "@/core/components/DataTable";
|
|
||||||
import { GET_INQUIRY_PRIVACY_FENCING_ROUTE } from "@/core/utils/routes";
|
|
||||||
import { Box } from "@mui/material";
|
|
||||||
import PageTitle from "@/core/components/PageTitle";
|
|
||||||
|
|
||||||
const InquiryPrivacyFencingList = () => {
|
|
||||||
const columns = useMemo(
|
|
||||||
() => [
|
|
||||||
{
|
|
||||||
accessorKey: "dabirkhaneh_number",
|
|
||||||
header: "شماره دبیرخانه درخواست",
|
|
||||||
id: "dabirkhaneh_number",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
datatype: "text",
|
|
||||||
filterFn: "notEquals",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "marjae_pasokh",
|
|
||||||
header: "مرجع درخواست کننده پاسخ به استعلام",
|
|
||||||
id: "marjae_pasokh",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
datatype: "text",
|
|
||||||
filterFn: "equals",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "motaghazi_is_legal",
|
|
||||||
header: "متقاضی",
|
|
||||||
id: "motaghazi_is_legal",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "nameh_date",
|
|
||||||
header: "تاریخ نامه درخواست",
|
|
||||||
id: "nameh_date",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "motaghazi_type",
|
|
||||||
header: "نوع متقاضی",
|
|
||||||
id: "motaghazi_type",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "motaghazi_firstname",
|
|
||||||
header: "نام متقاضی",
|
|
||||||
id: "motaghazi_firstname",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "motaghazi_lastname",
|
|
||||||
header: "نام خانوادگی متقاضی",
|
|
||||||
id: "motaghazi_lastname",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "national_id",
|
|
||||||
header: "کد ملی/شناسه ملی",
|
|
||||||
id: "national_id",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "tel_number",
|
|
||||||
header: "تلفن",
|
|
||||||
id: "tel_number",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "mobile_number",
|
|
||||||
header: "تلفن همراه",
|
|
||||||
id: "mobile_number",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "address",
|
|
||||||
header: "آدرس",
|
|
||||||
id: "address",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "edare_kol",
|
|
||||||
header: "اداره كل راهداری",
|
|
||||||
id: "edare_kol",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "edare_shahri",
|
|
||||||
header: "اداره شهرستان",
|
|
||||||
id: "edare_shahri",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "rah_type",
|
|
||||||
header: "نوع راه",
|
|
||||||
id: "rah_type",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "name_mehvar_fa",
|
|
||||||
header: "نام محور",
|
|
||||||
id: "name_mehvar_fa",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "mizan_harim",
|
|
||||||
header: "میزان حریم",
|
|
||||||
id: "mizan_harim",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "arze_navar",
|
|
||||||
header: "عرض نوار تاسیساتی زیربنایی",
|
|
||||||
id: "arze_navar",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "samt",
|
|
||||||
header: "سمت",
|
|
||||||
id: "samt",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "kilometr",
|
|
||||||
header: "كيلومتر",
|
|
||||||
id: "kilometr",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "zone",
|
|
||||||
header: "zone",
|
|
||||||
id: "zone",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "karbari_type",
|
|
||||||
header: "نوع کاربری",
|
|
||||||
id: "karbari_type",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "tarh_title",
|
|
||||||
header: "عنوان طرح",
|
|
||||||
id: "tarh_title",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "masahat_zirbana",
|
|
||||||
header: "مساحت زیربنا",
|
|
||||||
id: "masahat_zirbana",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "ehdasat_type",
|
|
||||||
header: "نوع احداثات",
|
|
||||||
id: "ehdasat_type",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "divarkeshi_distance",
|
|
||||||
header: "فاصله دیوارکشی از آکس محور",
|
|
||||||
id: "divarkeshi_distance",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "mahale_ejra",
|
|
||||||
header: "محل اجرا",
|
|
||||||
id: "mahale_ejra",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "traffic",
|
|
||||||
header: "میزان ترافیک",
|
|
||||||
id: "traffic",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "vaziat_eghtesadi",
|
|
||||||
header: "وضعیت اقتصادی",
|
|
||||||
id: "vaziat_eghtesadi",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "has_access",
|
|
||||||
header: "آیا راه دسترسی از قبل وجود دارد؟",
|
|
||||||
id: "has_access",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "shomare_estelam_harim",
|
|
||||||
header: "شماره استعلام دفتر ایمنی و حریم",
|
|
||||||
id: "shomare_estelam_harim",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "max_month",
|
|
||||||
header: "ماه",
|
|
||||||
id: "max_month",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "max_day",
|
|
||||||
header: "روز",
|
|
||||||
id: "max_day",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "shomare_tahaodname",
|
|
||||||
header: "شماره تعهدنامه",
|
|
||||||
id: "shomare_tahaodname",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "shomare_daftarkhaneh",
|
|
||||||
header: "شماره دفترخانه",
|
|
||||||
id: "shomare_daftarkhaneh",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "description",
|
|
||||||
header: "توضیحات",
|
|
||||||
id: "description",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
accessorKey: "ronevesht",
|
|
||||||
header: "رونوشت",
|
|
||||||
id: "ronevesht",
|
|
||||||
enableColumnFilter: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Box sx={{ p: 1, border: 1, borderColor: "divider", borderRadius: 1 }}>
|
|
||||||
<DataTable
|
|
||||||
table_title={"لیست استعلام ها"}
|
|
||||||
need_filter={false}
|
|
||||||
columns={columns}
|
|
||||||
table_url={GET_INQUIRY_PRIVACY_FENCING_ROUTE}
|
|
||||||
user_id={0}
|
|
||||||
page_name={"inquiryPrivacyFencing"}
|
|
||||||
table_name={"inquiryPrivacyFencingList"}
|
|
||||||
TableToolbar={Toolbar}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
export default InquiryPrivacyFencingList;
|
|
||||||
@@ -151,11 +151,7 @@ const Form = ({ handleCloseForm, setLoading }) => {
|
|||||||
<CloudUploadIcon sx={{ fontSize: "2rem" }} color="inherit" />
|
<CloudUploadIcon sx={{ fontSize: "2rem" }} color="inherit" />
|
||||||
</Backdrop>
|
</Backdrop>
|
||||||
</Box>
|
</Box>
|
||||||
<VisuallyHiddenInput
|
<VisuallyHiddenInput type="file" accept="image/*" onChange={handleFileChange} />
|
||||||
type="file"
|
|
||||||
accept="image/*"
|
|
||||||
onChange={handleFileChange}
|
|
||||||
/>
|
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
<Grid container columns={{ xs: 1, sm: 2 }} spacing={2}>
|
<Grid container columns={{ xs: 1, sm: 2 }} spacing={2}>
|
||||||
|
|||||||
29
src/core/middlewares/withPermission.js
Normal file
29
src/core/middlewares/withPermission.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { Box, Typography } from "@mui/material";
|
||||||
|
import { usePermissions } from "@/lib/hooks/usePermissions";
|
||||||
|
|
||||||
|
function WithPermission({ children, permission_name }) {
|
||||||
|
const { data, error, isLoading } = usePermissions();
|
||||||
|
|
||||||
|
if (error || isLoading || !data || !permission_name) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const hasPermission =
|
||||||
|
permission_name.includes("all") || permission_name.some((permission) => data.includes(permission));
|
||||||
|
|
||||||
|
if (!hasPermission) {
|
||||||
|
return (
|
||||||
|
<Box sx={{ display: "flex", alignItems: "center", justifyContent: "center", height: "100%" }}>
|
||||||
|
<Typography variant="h5" sx={{ letterSpacing: "2px", color: "error.main" }}>
|
||||||
|
شما دسترسی لازم به این صفحه را ندارید
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return <>{children}</>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default WithPermission;
|
||||||
@@ -255,28 +255,28 @@ export const pageMenu = [
|
|||||||
label: "استعلام حرائم پنجره واحد",
|
label: "استعلام حرائم پنجره واحد",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: "/dashboard/inquiry-privacy/city-admin/zamin-gov",
|
route: "/dashboard/inquiry-privacy/city-admin/zamin-gov",
|
||||||
permissions: ["all"],
|
permissions: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "provinceAdminZaminGov",
|
id: "provinceAdminZaminGov",
|
||||||
label: "استعلام حرائم پنجره واحد",
|
label: "استعلام حرائم پنجره واحد",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: "/dashboard/inquiry-privacy/province-admin/zamin-gov",
|
route: "/dashboard/inquiry-privacy/province-admin/zamin-gov",
|
||||||
permissions: ["all"],
|
permissions: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "assistantZaminGov",
|
id: "assistantZaminGov",
|
||||||
label: "استعلام حرائم پنجره واحد",
|
label: "استعلام حرائم پنجره واحد",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: "/dashboard/inquiry-privacy/assistant/zamin-gov",
|
route: "/dashboard/inquiry-privacy/assistant/zamin-gov",
|
||||||
permissions: ["all"],
|
permissions: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "generalManagerZaminGov",
|
id: "generalManagerZaminGov",
|
||||||
label: "استعلام حرائم پنجره واحد",
|
label: "استعلام حرائم پنجره واحد",
|
||||||
type: "page",
|
type: "page",
|
||||||
route: "/dashboard/inquiry-privacy/general-manager/zamin-gov",
|
route: "/dashboard/inquiry-privacy/general-manager/zamin-gov",
|
||||||
permissions: ["all"],
|
permissions: [],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user