asb_cloud_front/src/components/CustomColumn.jsx
Фролов 98c26132d2 CF2-19 Настроить формат числовых параметров
CF2-7 В компонент DisplayValue внедрить стрелки роста/убывания значения
2021-07-26 14:44:00 +05:00

34 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {Display} from './Display'
import RigMnemo from '../components/RigMnemo'
const params = [
{label:'Рот., об/мин', accessorName:'rotorSpeed', isArrowVisible:true},
{label:'Долото, м', accessorName:'bitDepth', isArrowVisible:true, format:2},
{label:'Забой, м', accessorName:'wellDepth', isArrowVisible:true, format:2},
{label:'Расход, м³/ч', accessorName:'flow', isArrowVisible:true},
{label:'Расход х.х., м³/ч', accessorName:'flowIdle', isArrowVisible:true},
{label: 'Время', accessorName: 'date', format:'HH:mm:ss'},
]
export const CustomColumn = ({data}) => {
const dataLast = data[data.length -1]
if(dataLast)
params.forEach(param => param.value = dataLast[param.accessorName])
else
params.forEach(param => param.value = '-' )
return (<>
{params.map(param => <Display className='border_small display_flex_container'
key={param.label}
label={param.label}
value={param.value}
suffix={param.units}
isArrowVisible = {param.isArrowVisible}
format = {param.format}
/>)}
<RigMnemo
blockPosition={dataLast?.blockPosition??0}
bitPosition={dataLast?.bitDepth??3200}/>
</>)
}