From 8c2c1b7913669cee734dd4c2387866ea9d42831c Mon Sep 17 00:00:00 2001 From: goodmice Date: Tue, 11 Oct 2022 17:36:00 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20TelemetryView=20=D0=B8=20=D1=81=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=86=D0=B0=20=D0=BF=D1=80=D0=BE=D1=81=D0=BC=D0=BE?= =?UTF-8?q?=D1=82=D1=80=D0=B0=20=D1=82=D0=B5=D0=BB=D0=B5=D0=BC=D0=B5=D1=82?= =?UTF-8?q?=D1=80=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/views/TelemetryView.tsx | 20 ++++++++++++------- .../AdminPanel/Telemetry/TelemetryViewer.jsx | 4 ++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/components/views/TelemetryView.tsx b/src/components/views/TelemetryView.tsx index 702ebd2..8758353 100755 --- a/src/components/views/TelemetryView.tsx +++ b/src/components/views/TelemetryView.tsx @@ -1,8 +1,9 @@ import { Fragment, memo } from 'react' import { Tooltip } from 'antd' -import { TelemetryDto, TelemetryInfoDto } from '@api' import { Grid, GridItem } from '@components/Grid' +import { formatDate } from '@utils' +import { TelemetryDto, TelemetryInfoDto } from '@api' export const lables: Record = { timeZoneId: 'Временная зона', @@ -30,12 +31,17 @@ export const TelemetryView = memo(({ telemetry }) => telemet overlayInnerStyle={{ width: '400px' }} title={ - {(Object.keys(telemetry.info) as Array).map((key, i) => ( - - {lables[key] ?? key}: - {telemetry.info?.[key]} - - ))} + {(Object.keys(telemetry.info) as Array).map((key, i) => { + let value = telemetry.info?.[key] + value = key === 'drillingStartDate' ? formatDate(value) : value + + return ( + + {lables[key] ?? key}: + {value} + + ) + })} } > diff --git a/src/pages/AdminPanel/Telemetry/TelemetryViewer.jsx b/src/pages/AdminPanel/Telemetry/TelemetryViewer.jsx index 41f129d..111d930 100755 --- a/src/pages/AdminPanel/Telemetry/TelemetryViewer.jsx +++ b/src/pages/AdminPanel/Telemetry/TelemetryViewer.jsx @@ -6,7 +6,7 @@ import { Button, Input } from 'antd' import { defaultPagination, makeColumn, - makeDateSorter, + makeDateColumn, makeNumericColumn, makeNumericRender, makeTextColumn, @@ -53,7 +53,7 @@ const TelemetryController = memo(() => { makeNumericColumn('ID', 'id', null, null, makeNumericRender(0)), makeTextColumn('UID', 'remoteUid'), makeTextColumn('Назначена на скважину', 'realWell'), - makeTextColumn('Дата начала бурения', 'drillingStartDate', null, makeDateSorter('drillingStartDate')), + makeDateColumn('Дата начала бурения', 'drillingStartDate'), makeTextColumn('Часовой пояс', 'timeZoneId'), makeTextColumn('Скважина', 'well'), makeTextColumn('Куст', 'cluster'),