From 9ee3e89bd1a58b4cd9851c1446025d9ea8369b25 Mon Sep 17 00:00:00 2001 From: goodm2ice Date: Fri, 25 Feb 2022 18:02:41 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D1=81=D0=BA=D0=B0=D1=87=D0=B8=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC?= =?UTF-8?q?=D0=BC=D1=8B=20=D0=B1=D1=83=D1=80=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D1=81=D0=BF=D0=B8=D0=BD?= =?UTF-8?q?=D0=BD=D0=B5=D1=80=D0=B0=20=D0=B2=D1=8B=D0=B3=D1=80=D1=83=D0=B7?= =?UTF-8?q?=D0=BA=D0=B8=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/DrillingProgram/CategoryRender.jsx | 14 ++++++++++++-- src/pages/DrillingProgram/index.jsx | 11 +++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/pages/DrillingProgram/CategoryRender.jsx b/src/pages/DrillingProgram/CategoryRender.jsx index d997135..7d93029 100644 --- a/src/pages/DrillingProgram/CategoryRender.jsx +++ b/src/pages/DrillingProgram/CategoryRender.jsx @@ -74,6 +74,16 @@ export const CategoryRender = memo(({ idWell, partData, onUpdate, onEdit, onHist `Удаление категории "${title}" скважины "${idWell}"` ), [idWell, idFileCategory, onUpdate, title]) + const onUploadComplete = useCallback(() => { + onUpdate?.(idFileCategory) + setIsUploading(false) + }, [onUpdate, idFileCategory]) + + const onUploadError = useCallback((e) => { + notify(e?.message ?? 'Ошибка загрузки файла', 'error') + setIsUploading(false) + }) + return (
@@ -111,8 +121,8 @@ export const CategoryRender = memo(({ idWell, partData, onUpdate, onEdit, onHist url={uploadUrl} style={{ margin: '5px 0 10px 0' }} onUploadStart={() => setIsUploading(true)} - onUploadComplete={() => onUpdate?.(idFileCategory)} - onUploadError={(e) => notify(e?.message ?? 'Ошибка загрузки файла', 'error')} + onUploadComplete={onUploadComplete} + onUploadError={onUploadError} /> )} +
Размер: {program?.size}
Загружен: {formatDate(program?.uploadDate)}