2021-08-31 11:14:35 +05:00
|
|
|
|
|
|
|
import { Table } from "antd";
|
|
|
|
import {
|
|
|
|
makeTextColumn,
|
|
|
|
makeNumericColumnPlanFact
|
|
|
|
} from "../../components/Table"
|
|
|
|
|
|
|
|
export default function WellOperationsTable({wellOperations}) {
|
|
|
|
|
|
|
|
const columns = [
|
|
|
|
makeTextColumn("Конструкция секции","sectionType"),
|
|
|
|
makeTextColumn("Операция","operationName"),
|
2021-08-31 16:41:13 +05:00
|
|
|
makeNumericColumnPlanFact(
|
|
|
|
"Глубина забоя",
|
|
|
|
"depth",
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
(number) => (!Number.isNaN(number) && number !== undefined)
|
|
|
|
? number.toFixed(2)
|
|
|
|
: '-'
|
|
|
|
),
|
|
|
|
makeNumericColumnPlanFact(
|
|
|
|
"Часы",
|
|
|
|
"durationHours",
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
(number) => (!Number.isNaN(number) && number !== undefined)
|
|
|
|
? number.toFixed(2)
|
|
|
|
: '-'
|
|
|
|
),
|
|
|
|
makeNumericColumnPlanFact(
|
|
|
|
"Комментарий",
|
|
|
|
"comment",
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
(text) => text ?? '-'
|
|
|
|
)
|
2021-08-31 11:14:35 +05:00
|
|
|
];
|
|
|
|
|
|
|
|
const operations = wellOperations.map(el => {
|
|
|
|
return {
|
2021-08-31 11:46:55 +05:00
|
|
|
key: el.plan?.id ?? el.fact.id,
|
2021-08-31 12:44:39 +05:00
|
|
|
sectionType: el.plan?.wellSectionTypeName ?? el.fact?.wellSectionTypeName,
|
2021-08-31 16:41:13 +05:00
|
|
|
operationName: `${el.plan?.categoryName ?? el.fact?.categoryName ?? ''} ${' '}
|
2021-08-31 12:44:39 +05:00
|
|
|
${el.plan?.categoryInfo ?? el.fact?.categoryInfo ?? ''}`,
|
2021-08-31 16:41:13 +05:00
|
|
|
depthPlan: el.plan?.wellDepth,
|
|
|
|
depthFact: el.fact?.wellDepth,
|
|
|
|
durationHoursPlan: el.plan?.durationHours,
|
|
|
|
durationHoursFact: el.fact?.durationHours,
|
2021-08-31 11:46:55 +05:00
|
|
|
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
|
|
|
|
columns={columns}
|
|
|
|
dataSource={operations}
|
|
|
|
size={"small"}
|
|
|
|
bordered
|
2021-08-31 11:46:55 +05:00
|
|
|
pagination={{ defaultPageSize: 10 }}
|
2021-08-31 11:14:35 +05:00
|
|
|
rowKey={(record) => record.id}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|