Fixed operations modal window in Cluster info table

This commit is contained in:
KharchenkoVV 2021-08-31 11:46:55 +05:00
parent ab1aa7be90
commit 4ccba24db4

View File

@ -8,35 +8,34 @@ import {
export default function WellOperationsTable({wellOperations}) {
const columns = [
makeTextColumn("","index"),
makeTextColumn("Конструкция секции","sectionType"),
makeTextColumn("Операция","operationName"),
makeNumericColumnPlanFact("Глубина забоя", "depth"),
makeNumericColumnPlanFact("Часы", "durationHours")
makeNumericColumnPlanFact("Часы", "durationHours"),
makeNumericColumnPlanFact("Комментарий", "comment")
];
let i = 1;
const operations = wellOperations.map(el => {
return {
key: el.plan ? el.plan.id : el.fact.id,
index: i++,
sectionType: el.plan ? el.plan.wellSectionTypeName : el.fact.wellSectionTypeName,
operationName: el.plan ? el.plan.categoryName : el.fact.categoryName,
depthPlan: el.plan ? el.plan.wellDepth : '-',
depthFact: el.fact ? el.fact.wellDepth : '-',
durationHoursPlan: el.plan ? el.plan.durationHours : '-',
durationHoursFact: el.fact ? el.fact.durationHours : '-'
key: el.plan?.id ?? el.fact.id,
sectionType: el.plan?.wellSectionTypeName ?? el.fact.wellSectionTypeName,
operationName: el.plan?.categoryName ?? el.fact.categoryName,
depthPlan: el.plan?.wellDepth?.toFixed(2) ?? '-',
depthFact: el.fact?.wellDepth?.toFixed(2) ?? '-',
durationHoursPlan: el.plan?.durationHours ?? '-',
durationHoursFact: el.fact?.durationHours ?? '-',
commentPlan: el.plan?.comment ?? '-',
commentFact: el.fact?.comment ?? '-'
}
})
return(
return(
<Table
columns={columns}
dataSource={operations}
size={"small"}
bordered
pagination={false}
pagination={{ defaultPageSize: 10 }}
rowKey={(record) => record.id}
/>
)