From 7574b08b253345ad5f9eec34a44d30f8278bac33 Mon Sep 17 00:00:00 2001 From: andrei Date: Tue, 10 Jun 2025 08:37:49 +0500 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20UI=20=D0=B8=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Исправлены ошибки UI, API и добавлены улучшения. --- web-app/src/Api/lensesApi.js | 6 ++--- web-app/src/Api/patientsApi.js | 8 +++---- .../AppointmentFormModal.jsx | 3 ++- .../useAppointmentFormModalUI.js | 1 + web-app/src/Components/Layouts/MainLayout.jsx | 24 +++++++++---------- .../Pages/PatientsPage/PatientsPage.jsx | 2 +- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/web-app/src/Api/lensesApi.js b/web-app/src/Api/lensesApi.js index 1d6953c..a4900cc 100644 --- a/web-app/src/Api/lensesApi.js +++ b/web-app/src/Api/lensesApi.js @@ -44,7 +44,7 @@ export const lensesApi = createApi({ method: 'POST', body: lens }), - invalidatesTags: ['Lens'] + invalidatesTags: ['Lenses'] }), updateLens: builder.mutation({ query: ({id, ...lens}) => ({ @@ -52,14 +52,14 @@ export const lensesApi = createApi({ method: 'PUT', body: lens }), - invalidatesTags: ['Lens'] + invalidatesTags: ['Lenses'] }), deleteLens: builder.mutation({ query: (id) => ({ url: `/lenses/${id}/`, method: 'DELETE' }), - invalidatesTags: ['Lens'] + invalidatesTags: ['Lenses'] }), }), }); diff --git a/web-app/src/Api/patientsApi.js b/web-app/src/Api/patientsApi.js index 0f6f826..3a88710 100644 --- a/web-app/src/Api/patientsApi.js +++ b/web-app/src/Api/patientsApi.js @@ -23,7 +23,7 @@ export const patientsApi = createApi({ url: '/patients/', params: { all_params: true }, }), - providesTags: ['Patient'], + providesTags: ['Patients'], transformResponse: (response) => { if (!response || !Array.isArray(response.patients)) { console.warn('Unexpected patients API response:', response); @@ -38,7 +38,7 @@ export const patientsApi = createApi({ method: 'POST', body: patient }), - invalidatesTags: ['Patient'] + invalidatesTags: ['Patients'] }), updatePatient: builder.mutation({ query: ({id, ...patient}) => ({ @@ -46,14 +46,14 @@ export const patientsApi = createApi({ method: 'PUT', body: patient }), - invalidatesTags: ['Patient'] + invalidatesTags: ['Patients'] }), deletePatient: builder.mutation({ query: (id) => ({ url: `/patients/${id}/`, method: 'DELETE' }), - invalidatesTags: ['Patient'] + invalidatesTags: ['Patients'] }), }), }); diff --git a/web-app/src/Components/Dummies/AppointmentFormModal/AppointmentFormModal.jsx b/web-app/src/Components/Dummies/AppointmentFormModal/AppointmentFormModal.jsx index acc5474..baea0c8 100644 --- a/web-app/src/Components/Dummies/AppointmentFormModal/AppointmentFormModal.jsx +++ b/web-app/src/Components/Dummies/AppointmentFormModal/AppointmentFormModal.jsx @@ -229,6 +229,7 @@ const AppointmentFormModal = () => { const ConfirmStep = useMemo(() => { const values = appointmentFormModalUI.form.getFieldsValue(); + const formValues = appointmentFormModalUI.formValues; const patient = appointmentFormModalData.patients.find((p) => p.id === values.patient_id); const appointmentType = appointmentFormModalData.appointmentTypes.find((t) => t.id === values.type_id); @@ -251,7 +252,7 @@ const AppointmentFormModal = () => {

Результаты приема:

-
+

Прикрепленные файлы:

diff --git a/web-app/src/Components/Dummies/AppointmentFormModal/useAppointmentFormModalUI.js b/web-app/src/Components/Dummies/AppointmentFormModal/useAppointmentFormModalUI.js index da82d62..5206740 100644 --- a/web-app/src/Components/Dummies/AppointmentFormModal/useAppointmentFormModalUI.js +++ b/web-app/src/Components/Dummies/AppointmentFormModal/useAppointmentFormModalUI.js @@ -422,6 +422,7 @@ const useAppointmentFormModalUI = (createAppointment, patients, cancelAppointmen screenXS, direction, isDrawerVisible, + formValues, showDrawer, closeDrawer, isLoadingPreviousAppointments, diff --git a/web-app/src/Components/Layouts/MainLayout.jsx b/web-app/src/Components/Layouts/MainLayout.jsx index 4ac17c1..9129c53 100644 --- a/web-app/src/Components/Layouts/MainLayout.jsx +++ b/web-app/src/Components/Layouts/MainLayout.jsx @@ -21,23 +21,23 @@ const MainLayout = () => { const mainLayoutUI = useMainLayoutUI(mainLayoutData.user); const menuItems = [ - mainLayoutUI.getItem("Главная", "/", ), - mainLayoutUI.getItem("Приёмы", "/appointments", ), - mainLayoutUI.getItem("Выдачи линз", "/issues", ), - mainLayoutUI.getItem("Линзы и наборы", "/Lenses", ), - mainLayoutUI.getItem("Пациенты", "/Patients", ), - mainLayoutUI.getItem("Рассылки", "/mailing", ), - { type: "divider" } + mainLayoutUI.getItem("Главная", "/", ), + mainLayoutUI.getItem("Приёмы", "/appointments", ), + mainLayoutUI.getItem("Выдачи линз", "/issues", ), + mainLayoutUI.getItem("Линзы и наборы", "/Lenses", ), + mainLayoutUI.getItem("Пациенты", "/Patients", ), + mainLayoutUI.getItem("Рассылки", "/mailing", ), + {type: "divider"} ]; if (mainLayoutData.user?.role.title === "Администратор") { - menuItems.push(mainLayoutUI.getItem("Панель администратора", "/admin", )); + menuItems.push(mainLayoutUI.getItem("Панель администратора", "/admin", )); } menuItems.push( - mainLayoutUI.getItem("Мой профиль", "profile", , [ - mainLayoutUI.getItem("Перейти в профиль", "/profile", ), - mainLayoutUI.getItem("Выйти", "logout", ) + mainLayoutUI.getItem("Мой профиль", "profile", , [ + mainLayoutUI.getItem("Перейти в профиль", "/profile", ), + mainLayoutUI.getItem("Выйти", "logout", ) ]) ); @@ -51,7 +51,7 @@ const MainLayout = () => { collapsible={!mainLayoutUI.screens.xs} collapsed={mainLayoutUI.collapsed} onCollapse={mainLayoutUI.setCollapsed} - style={{height: "100vh", position: "fixed", left: 0}} + style={{height: "100vh", position: "fixed", left: 0, overflow: "auto"}} >
{ {patientsData.isLoading ? : patientsData.viewMode === "tile" ? ( (