From 51ac260c74fa3c689bf50b8483175e79cd08c787 Mon Sep 17 00:00:00 2001 From: goodmice Date: Mon, 21 Nov 2022 12:04:48 +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=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D0=BA=D1=80=D0=BE=D1=88=D0=B5=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Telemetry/TelemetryView/TelemetrySummary.jsx | 4 ++-- .../OperationEditor/WellOperationsEditor.jsx | 8 +++----- src/pages/Well/WellOperations/Tvd/index.jsx | 14 ++++++-------- src/pages/Well/index.jsx | 4 +--- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/pages/Well/Telemetry/TelemetryView/TelemetrySummary.jsx b/src/pages/Well/Telemetry/TelemetryView/TelemetrySummary.jsx index 7cc6cad..fec6b1a 100644 --- a/src/pages/Well/Telemetry/TelemetryView/TelemetrySummary.jsx +++ b/src/pages/Well/Telemetry/TelemetryView/TelemetrySummary.jsx @@ -74,8 +74,8 @@ const params = [ { label: 'Рот.', unit: 'об/мин', accessorName: 'rotorSpeed', iconRenderer }, { label: 'Долото', unit: 'м', accessorName: 'bitDepth', iconRenderer, format: 2 }, { label: 'Забой', unit: 'м', accessorName: 'wellDepth', iconRenderer, format: 2 }, - { label: 'Расход', unit: 'м³/ч', accessorName: 'flow', iconRenderer }, - { label: 'Расход х.х.', unit: 'м³/ч', accessorName: 'flowIdle', iconRenderer }, + { label: 'Расход', unit: 'л/ч', accessorName: 'flow', iconRenderer }, + { label: 'Расход х.х.', unit: 'л/ч', accessorName: 'flowIdle', iconRenderer }, { label: 'MSE', unit: '%', accessorName: 'mse', format: 2 }, ] diff --git a/src/pages/Well/WellOperations/OperationEditor/WellOperationsEditor.jsx b/src/pages/Well/WellOperations/OperationEditor/WellOperationsEditor.jsx index 0da5b75..60b624c 100644 --- a/src/pages/Well/WellOperations/OperationEditor/WellOperationsEditor.jsx +++ b/src/pages/Well/WellOperations/OperationEditor/WellOperationsEditor.jsx @@ -138,11 +138,9 @@ export const WellOperationsEditor = memo(({ idType, showNpt, ...other }) => { ) }, [well]) - useEffect(() => { - setTopRightBlock( - - ) - }, [well, setTopRightBlock, updateOperations]) + useEffect(() => setTopRightBlock((well) => ( + + )), [setTopRightBlock, updateOperations]) return ( diff --git a/src/pages/Well/WellOperations/Tvd/index.jsx b/src/pages/Well/WellOperations/Tvd/index.jsx index 1082b00..ba4f036 100644 --- a/src/pages/Well/WellOperations/Tvd/index.jsx +++ b/src/pages/Well/WellOperations/Tvd/index.jsx @@ -229,14 +229,12 @@ const Tvd = memo(({ well: givenWell, title, ...other }) => { ) }, [well]) - useEffect(() => { - setTopRightBlock( -
- - -
- ) - }, [well, setTopRightBlock]) + useEffect(() => setTopRightBlock((well) => ( +
+ + +
+ )), [setTopRightBlock]) return (
diff --git a/src/pages/Well/index.jsx b/src/pages/Well/index.jsx index c54347c..a8145c5 100644 --- a/src/pages/Well/index.jsx +++ b/src/pages/Well/index.jsx @@ -78,11 +78,9 @@ const Well = memo(() => { useEffect(() => setLayoutProps({ sider: , breadcrumb: makeMenuBreadcrumbItems(menuItems, location.pathname, /^\/well\/[0-9]+\//), - topRightBlock: topRightBlock, + topRightBlock: topRightBlock?.(well), }), [well, location.pathname, setLayoutProps, topRightBlock]) - useEffect(() => setTopRightBlock(undefined), [location]) - return (