From 56e873323b2d0c4ca69f747cb6a04f0b044b58a2 Mon Sep 17 00:00:00 2001 From: goodmice Date: Thu, 14 Jul 2022 16:08:58 +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=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B8=20=D0=BD=D0=B5=D0=BA=D0=BE=D1=80=D1=80=D0=B5=D0=BA?= =?UTF-8?q?=D1=82=D0=BD=D1=8B=D1=85=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85?= =?UTF-8?q?=20ROP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Telemetry/TelemetryView/index.jsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/pages/Telemetry/TelemetryView/index.jsx b/src/pages/Telemetry/TelemetryView/index.jsx index 2189da5..07768d9 100755 --- a/src/pages/Telemetry/TelemetryView/index.jsx +++ b/src/pages/Telemetry/TelemetryView/index.jsx @@ -370,12 +370,16 @@ export default function TelemetryView() { 'Задание состояния скважины' ), [idWell, wellData]) - const columnAdditionalLabels = { - 1: rop && [ - `ROP сред: ${rop.ropAverage.toFixed(2)} м/ч`, - `ROP макс: ${rop.ropMax.toFixed(2)} м/ч` - ] - } + const columnAdditionalLabels = useMemo(() => { + if (!rop) return {} + const { ropAverage, ropMax } = rop + return { + 1: rop && [ + `ROP сред: ${ropAverage && ropAverage.toFixed?.(2) || '---'} м/ч`, + `ROP макс: ${ropMax && ropMax.toFixed?.(2) || '---'} м/ч` + ] + } + }, [rop]) return (