forked from ddrilling/asb_cloud_front
Улучшена TelemetryView и страница просмотра телеметрий
This commit is contained in:
parent
978a26e455
commit
8c2c1b7913
@ -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<string, string> = {
|
||||
timeZoneId: 'Временная зона',
|
||||
@ -30,12 +31,17 @@ export const TelemetryView = memo<TelemetryViewProps>(({ telemetry }) => telemet
|
||||
overlayInnerStyle={{ width: '400px' }}
|
||||
title={
|
||||
<Grid>
|
||||
{(Object.keys(telemetry.info) as Array<keyof TelemetryInfoDto>).map((key, i) => (
|
||||
<Fragment key={i}>
|
||||
<GridItem row={i+1} col={1}>{lables[key] ?? key}:</GridItem>
|
||||
<GridItem row={i+1} col={2}>{telemetry.info?.[key]}</GridItem>
|
||||
</Fragment>
|
||||
))}
|
||||
{(Object.keys(telemetry.info) as Array<keyof TelemetryInfoDto>).map((key, i) => {
|
||||
let value = telemetry.info?.[key]
|
||||
value = key === 'drillingStartDate' ? formatDate(value) : value
|
||||
|
||||
return (
|
||||
<Fragment key={i}>
|
||||
<GridItem row={i+1} col={1}>{lables[key] ?? key}:</GridItem>
|
||||
<GridItem row={i+1} col={2}>{value}</GridItem>
|
||||
</Fragment>
|
||||
)
|
||||
})}
|
||||
</Grid>
|
||||
}
|
||||
>
|
||||
|
@ -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'),
|
||||
|
Loading…
Reference in New Issue
Block a user