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 { Fragment, memo } from 'react'
|
||||||
import { Tooltip } from 'antd'
|
import { Tooltip } from 'antd'
|
||||||
|
|
||||||
import { TelemetryDto, TelemetryInfoDto } from '@api'
|
|
||||||
import { Grid, GridItem } from '@components/Grid'
|
import { Grid, GridItem } from '@components/Grid'
|
||||||
|
import { formatDate } from '@utils'
|
||||||
|
import { TelemetryDto, TelemetryInfoDto } from '@api'
|
||||||
|
|
||||||
export const lables: Record<string, string> = {
|
export const lables: Record<string, string> = {
|
||||||
timeZoneId: 'Временная зона',
|
timeZoneId: 'Временная зона',
|
||||||
@ -30,12 +31,17 @@ export const TelemetryView = memo<TelemetryViewProps>(({ telemetry }) => telemet
|
|||||||
overlayInnerStyle={{ width: '400px' }}
|
overlayInnerStyle={{ width: '400px' }}
|
||||||
title={
|
title={
|
||||||
<Grid>
|
<Grid>
|
||||||
{(Object.keys(telemetry.info) as Array<keyof TelemetryInfoDto>).map((key, i) => (
|
{(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}>
|
<Fragment key={i}>
|
||||||
<GridItem row={i+1} col={1}>{lables[key] ?? key}:</GridItem>
|
<GridItem row={i+1} col={1}>{lables[key] ?? key}:</GridItem>
|
||||||
<GridItem row={i+1} col={2}>{telemetry.info?.[key]}</GridItem>
|
<GridItem row={i+1} col={2}>{value}</GridItem>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
))}
|
)
|
||||||
|
})}
|
||||||
</Grid>
|
</Grid>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
@ -6,7 +6,7 @@ import { Button, Input } from 'antd'
|
|||||||
import {
|
import {
|
||||||
defaultPagination,
|
defaultPagination,
|
||||||
makeColumn,
|
makeColumn,
|
||||||
makeDateSorter,
|
makeDateColumn,
|
||||||
makeNumericColumn,
|
makeNumericColumn,
|
||||||
makeNumericRender,
|
makeNumericRender,
|
||||||
makeTextColumn,
|
makeTextColumn,
|
||||||
@ -53,7 +53,7 @@ const TelemetryController = memo(() => {
|
|||||||
makeNumericColumn('ID', 'id', null, null, makeNumericRender(0)),
|
makeNumericColumn('ID', 'id', null, null, makeNumericRender(0)),
|
||||||
makeTextColumn('UID', 'remoteUid'),
|
makeTextColumn('UID', 'remoteUid'),
|
||||||
makeTextColumn('Назначена на скважину', 'realWell'),
|
makeTextColumn('Назначена на скважину', 'realWell'),
|
||||||
makeTextColumn('Дата начала бурения', 'drillingStartDate', null, makeDateSorter('drillingStartDate')),
|
makeDateColumn('Дата начала бурения', 'drillingStartDate'),
|
||||||
makeTextColumn('Часовой пояс', 'timeZoneId'),
|
makeTextColumn('Часовой пояс', 'timeZoneId'),
|
||||||
makeTextColumn('Скважина', 'well'),
|
makeTextColumn('Скважина', 'well'),
|
||||||
makeTextColumn('Куст', 'cluster'),
|
makeTextColumn('Куст', 'cluster'),
|
||||||
|
Loading…
Reference in New Issue
Block a user