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