forked from ddrilling/asb_cloud_front
43 lines
1.5 KiB
JavaScript
43 lines
1.5 KiB
JavaScript
|
|
import { Table } from 'antd'
|
|
|
|
import { makeTextColumn, makeNumericColumnPlanFact } from '@components/Table'
|
|
|
|
import { getPrecision } from './functions'
|
|
|
|
export const WellOperationsTable = ({ wellOperations }) => {
|
|
const columns = [
|
|
makeTextColumn('Конструкция секции','sectionType'),
|
|
makeTextColumn('Операция','operationName'),
|
|
makeNumericColumnPlanFact('Глубина забоя', 'depth', null, null, getPrecision),
|
|
makeNumericColumnPlanFact('Часы', 'durationHours', null, null, getPrecision),
|
|
makeNumericColumnPlanFact('Комментарий', 'comment', null, null, (text) => text ?? '-')
|
|
]
|
|
|
|
const operations = wellOperations?.map(el => ({
|
|
key: el.plan?.id ?? el.fact.id,
|
|
sectionType: el.plan?.wellSectionTypeName ?? el.fact?.wellSectionTypeName,
|
|
operationName: `${el.plan?.categoryName ?? el.fact?.categoryName ?? ''} ${' '}
|
|
${el.plan?.categoryInfo ?? el.fact?.categoryInfo ?? ''}`,
|
|
depthPlan: el.plan?.wellDepth,
|
|
depthFact: el.fact?.wellDepth,
|
|
durationHoursPlan: el.plan?.durationHours,
|
|
durationHoursFact: el.fact?.durationHours,
|
|
commentPlan: el.plan?.comment ?? '-',
|
|
commentFact: el.fact?.comment ?? '-'
|
|
}))
|
|
|
|
return(
|
|
<Table
|
|
bordered
|
|
size={'small'}
|
|
columns={columns}
|
|
dataSource={operations}
|
|
rowKey={(record) => record.key}
|
|
pagination={{ defaultPageSize: 10 }}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export default WellOperationsTable
|