From e33f45f119bd7726776c9615ea28ff9e9fa9779e Mon Sep 17 00:00:00 2001 From: KharchenkoVV Date: Tue, 31 Aug 2021 12:44:39 +0500 Subject: [PATCH] Changed well name to router link --- src/pages/Cluster/ClusterSections.jsx | 8 +++++--- src/pages/Cluster/WellOperationsTable.jsx | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/pages/Cluster/ClusterSections.jsx b/src/pages/Cluster/ClusterSections.jsx index 05a2fd9..7847b33 100644 --- a/src/pages/Cluster/ClusterSections.jsx +++ b/src/pages/Cluster/ClusterSections.jsx @@ -1,5 +1,5 @@ import { Table, Tag, Button, Badge, Divider, Modal } from "antd"; -import { useParams } from "react-router-dom"; +import { useParams, Link } from "react-router-dom"; import { LineChartOutlined, ProfileOutlined } from "@ant-design/icons"; import { useState, useEffect } from "react"; import { @@ -61,7 +61,9 @@ const ModalWindowButton = ({ }; const columns = [ - makeTextColumn("скв №", "caption"), + makeTextColumn("скв №", "caption", null, null, (_, item) => ( + {item.caption} + )), makeTextColumn("Секция", "sectionType", filtersSectionsType), makeNumericColumnPlanFact("Глубина", "sectionWellDepth", filtersMinMax, makeFilterMinMaxFunction), makeNumericColumnPlanFact( @@ -152,7 +154,7 @@ export default function ClusterSections({ clusterData }) { well.sections.forEach((section) => { let row = { key: well.caption + section.id, - id: well.caption + section.id, + id: well.id, caption: well.caption, sectionType: section.caption, sectionWellDepthPlan: section.plan.wellDepthEnd, diff --git a/src/pages/Cluster/WellOperationsTable.jsx b/src/pages/Cluster/WellOperationsTable.jsx index bebb25c..8c36d3b 100644 --- a/src/pages/Cluster/WellOperationsTable.jsx +++ b/src/pages/Cluster/WellOperationsTable.jsx @@ -18,8 +18,9 @@ export default function WellOperationsTable({wellOperations}) { const operations = wellOperations.map(el => { return { key: el.plan?.id ?? el.fact.id, - sectionType: el.plan?.wellSectionTypeName ?? el.fact.wellSectionTypeName, - operationName: el.plan?.categoryName ?? el.fact.categoryName, + sectionType: el.plan?.wellSectionTypeName ?? el.fact?.wellSectionTypeName, + operationName: `${el.plan?.categoryName ?? el.fact?.categoryName} ${' '} + ${el.plan?.categoryInfo ?? el.fact?.categoryInfo ?? ''}`, depthPlan: el.plan?.wellDepth?.toFixed(0) ?? '-', depthFact: el.fact?.wellDepth?.toFixed(0) ?? '-', durationHoursPlan: el.plan?.durationHours?.toFixed(2) ?? '-',