From 871e71e777f405ede10889a120ac011365eba9ce Mon Sep 17 00:00:00 2001 From: goodmice Date: Mon, 21 Nov 2022 08:49:21 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=B0=D1=82=D0=B0=20=D1=83=D0=B4=D0=B0?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=B8=D0=B7=20=D1=82=D0=B5=D0=BA?= =?UTF-8?q?=D1=83=D1=89=D0=B8=D1=85=20=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TelemetryView/TelemetrySummary.jsx | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/src/pages/Well/Telemetry/TelemetryView/TelemetrySummary.jsx b/src/pages/Well/Telemetry/TelemetryView/TelemetrySummary.jsx index f85fd09..7cc6cad 100644 --- a/src/pages/Well/Telemetry/TelemetryView/TelemetrySummary.jsx +++ b/src/pages/Well/Telemetry/TelemetryView/TelemetrySummary.jsx @@ -1,7 +1,6 @@ import { isValidElement, memo, useEffect, useMemo, useState } from 'react' import { CaretUpOutlined, CaretDownOutlined, CaretRightOutlined } from '@ant-design/icons' -import { Tooltip, Typography } from 'antd' -import moment from 'moment' +import { Tooltip } from 'antd' import { formatDate, isRawDate } from '@utils' @@ -10,10 +9,10 @@ import '@styles/components/data_summary.less' export const parseValue = (value, formatter) => { if (!value || String(value).trim().length <= 0) return '---' if (typeof formatter === 'function') return formatter(value) - if (isRawDate(value)) return formatDate(value) const v = +value if (Number.isFinite(v)) return Number.isInteger(formatter) ? v.toFixed(formatter) : v.toPrecision(4) + if (isRawDate(value)) return formatDate(value) return value } @@ -42,19 +41,6 @@ export const DashboardDisplay = memo(({ label, title, unit, iconRenderer, value, ) }) -const getTimeFormat = (value) => { - const date = moment(value) - - return ( - - {date.isSame(new Date(), 'day') || ( - {date.format('DD.MM.YYYY')} - )} - {date.format('HH:mm:ss')} - - ) -} - const iconRenderer = (value, prev) => { if (!Number.isFinite(+value)) return null if (prev?.prevDate + 1000 >= Date.now()) return prev @@ -90,7 +76,6 @@ const params = [ { label: 'Забой', unit: 'м', accessorName: 'wellDepth', iconRenderer, format: 2 }, { label: 'Расход', unit: 'м³/ч', accessorName: 'flow', iconRenderer }, { label: 'Расход х.х.', unit: 'м³/ч', accessorName: 'flowIdle', iconRenderer }, - { label: 'Время', accessorName: 'date', format: getTimeFormat }, { label: 'MSE', unit: '%', accessorName: 'mse', format: 2 }, ]