From fd5014b0416db8193118d816798884394a82ea76 Mon Sep 17 00:00:00 2001 From: Amirhossein Mahmoodi Date: Sun, 14 Jul 2024 09:51:03 +0330 Subject: [PATCH] add form create inquiryPrivacyFencing --- src/app/template.js | 6 +- .../Create/Form/index.jsx | 120 +++++++++--------- .../inquiryPrivacyFencing/Create/index.jsx | 2 +- 3 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/app/template.js b/src/app/template.js index 3e14053..dc647c5 100644 --- a/src/app/template.js +++ b/src/app/template.js @@ -16,15 +16,15 @@ const Template = ({ children }) => { scrollbarColor: `#155175 transparent`, }, "*&::-webkit-scrollbar": { - width: "5px", + width: "4px", }, "*&::-webkit-scrollbar-track": { boxShadow: "inset 0 0 5px #fff", - borderRadius: "5px", + borderRadius: "4px", }, "*&::-webkit-scrollbar-thumb": { background: "#155175", - borderRadius: "5px", + borderRadius: "4px", }, }} /> diff --git a/src/components/dashboard/inquiryPrivacyFencing/Create/Form/index.jsx b/src/components/dashboard/inquiryPrivacyFencing/Create/Form/index.jsx index 9fff4da..523d509 100644 --- a/src/components/dashboard/inquiryPrivacyFencing/Create/Form/index.jsx +++ b/src/components/dashboard/inquiryPrivacyFencing/Create/Form/index.jsx @@ -9,66 +9,66 @@ 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 CreateForm = ({ handleClose, mutate }) => { - const { control, watch, register, handleSubmit, setValue } = useForm({ - defaultValues: { - 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 request = useRequest() + const { control, watch, register, handleSubmit, setValue, formState: { isSubmitting } } = useForm({ defaultValues: initValues }); const onSubmit = async (data) => { const formData = new FormData() @@ -561,8 +561,8 @@ const CreateForm = ({ handleClose, mutate }) => { - - + + ); diff --git a/src/components/dashboard/inquiryPrivacyFencing/Create/index.jsx b/src/components/dashboard/inquiryPrivacyFencing/Create/index.jsx index 9010277..6a3032c 100644 --- a/src/components/dashboard/inquiryPrivacyFencing/Create/index.jsx +++ b/src/components/dashboard/inquiryPrivacyFencing/Create/index.jsx @@ -9,7 +9,7 @@ const InquiryPrivacyFencingCreate = ({ open, handleClose, mutate }) => { return ( <> - + ایجاد پاسخ به استعلام