2021-08-31 11:14:35 +05:00
|
|
|
|
2022-01-24 17:32:45 +05:00
|
|
|
import { Table } from 'antd'
|
|
|
|
|
|
|
|
import { makeTextColumn, makeNumericColumnPlanFact } from '@components/Table'
|
2021-08-31 11:14:35 +05:00
|
|
|
|
2022-01-24 17:32:45 +05:00
|
|
|
import { getPrecision } from './functions'
|
2021-08-31 11:14:35 +05:00
|
|
|
|
2022-01-24 17:32:45 +05:00
|
|
|
export const WellOperationsTable = ({ wellOperations }) => {
|
2021-08-31 11:14:35 +05:00
|
|
|
const columns = [
|
2021-10-13 16:32:01 +05:00
|
|
|
makeTextColumn('Конструкция секции','sectionType'),
|
|
|
|
makeTextColumn('Операция','operationName'),
|
|
|
|
makeNumericColumnPlanFact('Глубина забоя', 'depth', null, null, getPrecision),
|
|
|
|
makeNumericColumnPlanFact('Часы', 'durationHours', null, null, getPrecision),
|
|
|
|
makeNumericColumnPlanFact('Комментарий', 'comment', null, null, (text) => text ?? '-')
|
2022-01-24 17:32:45 +05:00
|
|
|
]
|
2021-08-31 11:14:35 +05:00
|
|
|
|
2022-01-24 17:32:45 +05:00
|
|
|
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 ?? '-'
|
|
|
|
}))
|
2021-08-31 11:14:35 +05:00
|
|
|
|
2021-08-31 11:46:55 +05:00
|
|
|
return(
|
2021-08-31 11:14:35 +05:00
|
|
|
<Table
|
2022-01-24 17:32:45 +05:00
|
|
|
bordered
|
|
|
|
size={'small'}
|
2021-08-31 11:14:35 +05:00
|
|
|
columns={columns}
|
|
|
|
dataSource={operations}
|
2021-09-02 17:31:58 +05:00
|
|
|
rowKey={(record) => record.key}
|
2022-01-24 17:32:45 +05:00
|
|
|
pagination={{ defaultPageSize: 10 }}
|
2021-08-31 11:14:35 +05:00
|
|
|
/>
|
|
|
|
)
|
2021-10-13 16:32:01 +05:00
|
|
|
}
|
2022-01-24 17:32:45 +05:00
|
|
|
|
|
|
|
export default WellOperationsTable
|