diff --git a/src/components/WellTreeSelector.jsx b/src/components/WellTreeSelector.jsx index b2b0b76..d25e114 100644 --- a/src/components/WellTreeSelector.jsx +++ b/src/components/WellTreeSelector.jsx @@ -2,7 +2,7 @@ import { useState, useEffect } from 'react' import { DepositService } from '../services/api' import LoaderPortal from './LoaderPortal' import { TreeSelect } from 'antd' -import { useHistory } from 'react-router-dom' +import { useHistory, useRouteMatch } from 'react-router-dom' import { notify } from "./factory" import '../styles/wellTreeSelect.css' @@ -10,6 +10,7 @@ export default function WellTreeSelector() { const [wellsTree, setWellsTree] = useState([]) const [showLoader, setShowLoader] = useState(false) const history = useHistory() + const routeMatch = useRouteMatch('/:route/:id') const updateWellsList = async () => { setShowLoader(true) @@ -21,8 +22,8 @@ export default function WellTreeSelector() { value: `/deposit/${deposit.id}`, children: deposit.clusters.map(cluster => ({ title: cluster.caption, - key: `/cluster/${cluster.id}/all`, - value: `/cluster/${cluster.id}/all`, + key: `/cluster/${cluster.id}`, + value: `/cluster/${cluster.id}`, children: cluster.wells.map(well => ({ title: well.caption, key: `/well/${well.id}`, @@ -56,6 +57,7 @@ export default function WellTreeSelector() { treeData={wellsTree} treeDefaultExpandAll onSelect={onSelect} + value = {routeMatch?.url} /> ) diff --git a/src/pages/Cluster/ClusterSections.jsx b/src/pages/Cluster/ClusterSections.jsx new file mode 100644 index 0000000..194a774 --- /dev/null +++ b/src/pages/Cluster/ClusterSections.jsx @@ -0,0 +1,231 @@ +import { Table, Tag, Button, Badge, Divider, Modal } from "antd"; +import { useParams } from "react-router-dom"; +import { LineChartOutlined, ProfileOutlined } from "@ant-design/icons"; +import { useState, useEffect } from "react"; +import { + makeTextColumn, + makeNumericColumnPlanFact, + calcAndUpdateStatsBySections, +} from "../../components/Table"; + +const filtersMinMax = [ + { + text: "min", + value: "min", + }, + { + text: "max", + value: "max", + }, +]; + +const filtersSectionsType = []; + +const ModalWindowButton = ({ + buttonIcon, + buttonText, + modalTitle, + modalContent, +}) => { + const [isModalVisible, setIsModalVisible] = useState(false); + + let content = + typeof modalContent === "string" ? ( + + ) : ( + modalContent + ); + + return ( + <> + + setIsModalVisible(false)} + onCancel={() => setIsModalVisible(false)} + width={1400} + > + {content} + + + ); +}; + +const columns = [ + makeTextColumn("скв №", "caption"), + makeTextColumn("Секция", "sectionType", filtersSectionsType), + makeNumericColumnPlanFact("Глубина", "sectionWellDepth", filtersMinMax), + makeNumericColumnPlanFact( + "Продолжительность", + "sectionBuildDays", + filtersMinMax + ), //Цикл строительства + makeNumericColumnPlanFact("МСП", "sectionRateOfPenetration", filtersMinMax), + makeNumericColumnPlanFact( + "Рейсовая скорость", + "sectionRouteSpeed", + filtersMinMax + ), + makeNumericColumnPlanFact("Спуск КНБК", "sectionBhaDownSpeed", filtersMinMax), //Скорость спуска КНБК + makeNumericColumnPlanFact("Подъем КНБК", "sectionBhaUpSpeed", filtersMinMax), //Скорость подъема КНБК + makeNumericColumnPlanFact( + "Скорость спуска ОК", + "sectionCasingDownSpeed", + filtersMinMax + ), + makeNumericColumnPlanFact( + "НПВ, сут", + "nonProductiveTime", + filtersMinMax, + "70px" + ), + { + title: "TVD", + render: (_, record) => ( + } + modalTitle={`График по скв.:${record.caption}`} + /> + ), + //modalContent = {resources['Chart' + record.caption]}/>, + }, + { + title: "Операции", + render: (_, record) => ( + } + modalTitle={`Операции по скв.:${record.caption}`} + /> + ), + //modalContent = {resources['Table' + record.caption]}, + }, + { + title: "Подрядчики", + dataIndex: "companies", + render: (item) => + item?.map((company) => {company.caption}), + }, +]; + +export default function ClusterSections({ clusterData }) { + let { id } = useParams(); + const [wellsStat, setWellsStat] = useState([]); + const [selectedWells, setSelectedWells] = useState([]); + const [selectedWellsKeys, setSelectedWellsKeys] = useState([]); + + calcAndUpdateStatsBySections(wellsStat ?? [], [ + "sectionWellDepthPlan", + "sectionWellDepthFact", + "sectionBuildDaysPlan", + "sectionBuildDaysFact", + "sectionRateOfPenetrationPlan", + "sectionRateOfPenetrationFact", + "sectionRouteSpeedPlan", + "sectionRouteSpeedFact", + "sectionBhaDownSpeedPlan", + "sectionBhaDownSpeedFact", + "sectionBhaUpSpeedPlan", + "sectionBhaUpSpeedFact", + "sectionCasingDownSpeedPlan", + "sectionCasingDownSpeedFact", + "nonProductiveTimePlan", + "nonProductiveTimeFact", + ]); + + useEffect(() => { + let rows = []; + + clusterData.statsWells?.forEach((el) => { + el.sections.forEach((section) => { + let row = { + key: el.caption + section.id, + id: el.caption + section.id, + caption: el.caption, + sectionType: section.caption, + sectionWellDepthPlan: section.plan.wellDepthEnd, + sectionWellDepthFact: section.fact.wellDepthEnd, + sectionBuildDaysPlan: ( + Math.abs( + new Date(section.plan.start) - new Date(section.plan.end) + ) / + (1000 * 60 * 60 * 24) + ).toFixed(2), + sectionBuildDaysFact: ( + Math.abs( + new Date(section.fact.start) - new Date(section.fact.end) + ) / + (1000 * 60 * 60 * 24) + ).toFixed(2), + sectionRateOfPenetrationPlan: section.plan.rop.toFixed(2), + sectionRateOfPenetrationFact: section.fact.rop.toFixed(2), + sectionRouteSpeedPlan: section.plan.routeSpeed.toFixed(2), + sectionRouteSpeedFact: section.fact.routeSpeed.toFixed(2), + sectionBhaDownSpeedPlan: section.plan.bhaDownSpeed.toFixed(2), + sectionBhaDownSpeedFact: section.fact.bhaDownSpeed.toFixed(2), + sectionBhaUpSpeedPlan: section.plan.bhaUpSpeed.toFixed(2), + sectionBhaUpSpeedFact: section.fact.bhaUpSpeed.toFixed(2), + sectionCasingDownSpeedPlan: section.plan.casingDownSpeed.toFixed(2), + sectionCasingDownSpeedFact: section.fact.casingDownSpeed.toFixed(2), + nonProductiveTimePlan: section.plan.nonProductiveHours.toFixed(2), + nonProductiveTimeFact: section.fact.nonProductiveHours.toFixed(2), + companies: el.companies, + }; + + rows.push(row); + + if (!filtersSectionsType.some((el) => el.text === section.caption)) + filtersSectionsType.push({ + text: section.caption, + value: section.caption, + }); + }); + }); + + setWellsStat(rows); + }, [id, clusterData]); + + const rowSelection = { + selectedRowKeys: selectedWellsKeys, + onChange: (keys, items) => { + setSelectedWells(items); + setSelectedWellsKeys(keys); + }, + }; + + return ( + <> + + + +

+ Выбранные секции<> +

+
+
+ + ); +} diff --git a/src/pages/Cluster/ClusterWells.jsx b/src/pages/Cluster/ClusterWells.jsx new file mode 100644 index 0000000..9af52e3 --- /dev/null +++ b/src/pages/Cluster/ClusterWells.jsx @@ -0,0 +1,125 @@ +import { useParams } from "react-router-dom"; +import { Link } from "react-router-dom"; +import { useState, useEffect } from "react"; +import { Table, Tag, Button } from "antd"; +import { + makeTextColumn, + makeGroupColumn, + makeNumericColumn, + makeNumericColumnPlanFact, + calcAndUpdateStatsBySections, +} from "../../components/Table"; + +const filtersMinMax = [ + { + text: "min", + value: "min", + }, + { + text: "max", + value: "max", + }, +]; + +const filtersWellsType = [ + { + text: "Наклонно-направленная", + value: "Наклонно-направленная", + }, + { + text: "Горизонтальная", + value: "Горизонтальная", + }, +]; + +export default function ClusterWells({ clusterData }) { + let { id } = useParams(); + const [wellsStat, setWellsStat] = useState([]); + + calcAndUpdateStatsBySections(wellsStat ?? [], [ + "factStart", + "factEnd", + "periodPlan", + "periodFact", + "rateOfPenetrationPlan", + "rateOfPenetrationFact", + "routeSpeedPlan", + "routeSpeedFact", + "notProductiveTime", + ]); + + useEffect(() => { + let tableData = clusterData.statsWells?.map((el) => { + return { + key: el.id, + id: el.id, + caption: el.caption, + wellType: el.wellType, + factStart: new Date(el.total.fact.start).toLocaleString(), + factEnd: new Date(el.total.fact.end).toLocaleString(), + periodPlan: ( + Math.abs( + new Date(el.total.plan.start) - new Date(el.total.plan.end) + ) / + (1000 * 60 * 60 * 24) + ).toFixed(2), + periodFact: ( + Math.abs( + new Date(el.total.fact.start) - new Date(el.total.fact.end) + ) / + (1000 * 60 * 60 * 24) + ).toFixed(2), + rateOfPenetrationPlan: el.total.plan.rop.toFixed(2), + rateOfPenetrationFact: el.total.fact.rop.toFixed(2), + routeSpeedPlan: el.total.plan.routeSpeed.toFixed(2), + routeSpeedFact: el.total.fact.routeSpeed.toFixed(2), + notProductiveTimePlan: el.total.plan.nonProductiveHours.toFixed(2), + notProductiveTimeFact: el.total.fact.nonProductiveHours.toFixed(2), + companies: el.companies, + }; + }); + + setWellsStat(tableData); + }, [id, clusterData]); + + const columns = [ + makeTextColumn("скв №", "caption", null, null, (_, item) => ( + {item.caption} + )), + makeTextColumn("Тип скв.", "wellType", filtersWellsType), + makeGroupColumn("Фактические сроки", [ + makeNumericColumn("начало", "factStart"), + makeNumericColumn("окончание", "factEnd"), + ]), + makeNumericColumnPlanFact("Продолжительность", "period", filtersMinMax), + makeNumericColumnPlanFact("МСП", "rateOfPenetration", filtersMinMax), + makeNumericColumnPlanFact("Рейсовая скорость", "routeSpeed", filtersMinMax), + makeNumericColumnPlanFact("НПВ, сут", "notProductiveTime", filtersMinMax), + { + title: "График глубина-день", + render: (_, item) => , + }, + { + title: "Таблица по операциям", + render: (_) => , + }, + { + title: "Подрядчики", + key: "companies", + dataIndex: "companies", + render: (item) => + item.map((company) => {company.caption}), + }, + ]; + + return ( +
record.id} + /> + ); +} diff --git a/src/pages/Cluster/index.jsx b/src/pages/Cluster/index.jsx new file mode 100644 index 0000000..93ff7a8 --- /dev/null +++ b/src/pages/Cluster/index.jsx @@ -0,0 +1,67 @@ +import { Layout, Menu } from "antd"; +import { Link, Switch, Route, Redirect, useParams } from "react-router-dom"; +import { useState, useEffect } from "react"; +import ClusterWells from "./ClusterWells"; +import ClusterSections from "./ClusterSections"; +import LoaderPortal from "../../components/LoaderPortal"; +import { invokeWebApiWrapperAsync } from "../../components/factory"; +import { WellOperationStatService } from "../../services/api"; + +const { Content } = Layout; + +export default function Cluster() { + let { idClaster, tab } = useParams(); + const [data, setData] = useState([]); + const [showLoader, setShowLoader] = useState(false); + + useEffect(() => { + invokeWebApiWrapperAsync( + async () => { + const clusterData = await WellOperationStatService.getStatCluster( + idClaster + ); + setData(clusterData); + }, + setShowLoader, + `Не удалось загрузить данные по кусту "${idClaster}"` + ); + }, [idClaster]); + + return ( + <> + + + + Скважины + + + Секции + + + + + + + + + + + + + + + + + + + + + + + ); +} diff --git a/src/pages/ClusterInfo.jsx b/src/pages/ClusterInfo.jsx deleted file mode 100644 index d31aa03..0000000 --- a/src/pages/ClusterInfo.jsx +++ /dev/null @@ -1,58 +0,0 @@ -import { Layout, Menu } from "antd"; -import { Link, Switch, Route, useParams } from "react-router-dom"; -import { useState, useEffect } from "react" -import ClusterWells from './ClusterWells' -import ClusterSections from './ClusterSections' -import LoaderPortal from '../components/LoaderPortal' -import {invokeWebApiWrapperAsync} from '../components/factory' -import {WellOperationStatService} from "../services/api"; - -const { Content } = Layout; - -export default function ClusterInfo() { - let { id } = useParams(); - let { tab } = useParams() - const [data, setData] = useState([]); - const [showLoader, setShowLoader] = useState(false) - - useEffect(() => { - invokeWebApiWrapperAsync( - async () => { - const clusterData = await WellOperationStatService.getStatCluster(id) - setData(clusterData) - }, - setShowLoader, - `Не удалось загрузить данные по кусту "${id}"`) - } ,[id]) - - return(<> - - - - Скважины - - - Секции - - - - - - - - - - - - - - - - - - - ) -} \ No newline at end of file diff --git a/src/pages/ClusterSections.jsx b/src/pages/ClusterSections.jsx deleted file mode 100644 index fbc089f..0000000 --- a/src/pages/ClusterSections.jsx +++ /dev/null @@ -1,183 +0,0 @@ -import { Table, Tag, Button, Badge, Divider, Modal} from "antd" -import { useParams } from "react-router-dom"; -import { LineChartOutlined, ProfileOutlined } from '@ant-design/icons' -import { useState, useEffect } from "react" -import { makeTextColumn, makeNumericColumnPlanFact, calcAndUpdateStatsBySections } from '../components/Table/index' - - -const filtersMinMax = [ - { - text: "min", - value: "min", - }, - { - text: "max", - value: "max", - }, -] - -const filtersSectionsType = [ ] - -const ModalWindowButton = ({buttonIcon, buttonText, modalTitle, modalContent}) =>{ - const [isModalVisible, setIsModalVisible] = useState(false) - - let content = (typeof(modalContent)==="string") - ? - : modalContent - - return ( - <> - - setIsModalVisible(false)} - onCancel={() => setIsModalVisible(false)} - width={1400}> - {content} - - - ) -} - -const columns = [ - makeTextColumn('скв №', 'caption'), - makeTextColumn('Секция', 'sectionType', filtersSectionsType), - makeNumericColumnPlanFact('Глубина', 'sectionWellDepth', filtersMinMax), - makeNumericColumnPlanFact('Продолжительность', 'sectionBuildDays', filtersMinMax), //Цикл строительства - makeNumericColumnPlanFact('МСП', 'sectionRateOfPenetration', filtersMinMax), - makeNumericColumnPlanFact('Рейсовая скорость', 'sectionRouteSpeed', filtersMinMax), - makeNumericColumnPlanFact('Спуск КНБК', 'sectionBhaDownSpeed', filtersMinMax),//Скорость спуска КНБК - makeNumericColumnPlanFact('Подъем КНБК', 'sectionBhaUpSpeed', filtersMinMax),//Скорость подъема КНБК - makeNumericColumnPlanFact('Скорость спуска ОК', 'sectionCasingDownSpeed', filtersMinMax), - makeNumericColumnPlanFact('НПВ, сут', 'nonProductiveTime', filtersMinMax, '70px'), - { - title: "TVD", - render: (_, record) => } - modalTitle={`График по скв.:${record.caption}`}/> - //modalContent = {resources['Chart' + record.caption]}/>, - }, - { - title: "Операции", - render: (_, record) => } - modalTitle={`Операции по скв.:${record.caption}`}/> - //modalContent = {resources['Table' + record.caption]}, - }, - { - title: "Подрядчики", - dataIndex: "companies", - render: (item) => - item?.map((company) => {company.caption}), - }, -] - - -export default function ClusterSections({clusterData}) { - let { id } = useParams() - const [wellsStat, setWellsStat] = useState([]) - const [selectedWells, setSelectedWells] = useState([]) - const [selectedWellsKeys, setSelectedWellsKeys] = useState([]) - - calcAndUpdateStatsBySections(wellsStat ?? [], [ - "sectionWellDepthPlan", - "sectionWellDepthFact", - "sectionBuildDaysPlan", - "sectionBuildDaysFact", - "sectionRateOfPenetrationPlan", - "sectionRateOfPenetrationFact", - "sectionRouteSpeedPlan", - "sectionRouteSpeedFact", - "sectionBhaDownSpeedPlan", - "sectionBhaDownSpeedFact", - "sectionBhaUpSpeedPlan", - "sectionBhaUpSpeedFact", - "sectionCasingDownSpeedPlan", - "sectionCasingDownSpeedFact", - "nonProductiveTimePlan", - "nonProductiveTimeFact" - ]) - - useEffect(() => { - let rows = [] - - clusterData.statsWells?.forEach(el => { - el.sections.forEach(section => { - let row = { - key: el.caption + section.id, - id: el.caption + section.id, - caption: el.caption, - sectionType: section.caption, - sectionWellDepthPlan: section.plan.wellDepthEnd, - sectionWellDepthFact: section.fact.wellDepthEnd, - sectionBuildDaysPlan: (Math.abs(new Date(section.plan.start) - - new Date(section.plan.end)) / (1000 * 60 * 60 * 24)).toFixed(2), - sectionBuildDaysFact: (Math.abs(new Date(section.fact.start) - - new Date(section.fact.end)) / (1000 * 60 * 60 * 24)).toFixed(2), - sectionRateOfPenetrationPlan: section.plan.rop.toFixed(2), - sectionRateOfPenetrationFact: section.fact.rop.toFixed(2), - sectionRouteSpeedPlan: section.plan.routeSpeed.toFixed(2), - sectionRouteSpeedFact: section.fact.routeSpeed.toFixed(2), - sectionBhaDownSpeedPlan: section.plan.bhaDownSpeed.toFixed(2), - sectionBhaDownSpeedFact: section.fact.bhaDownSpeed.toFixed(2), - sectionBhaUpSpeedPlan: section.plan.bhaUpSpeed.toFixed(2), - sectionBhaUpSpeedFact: section.fact.bhaUpSpeed.toFixed(2), - sectionCasingDownSpeedPlan: section.plan.casingDownSpeed.toFixed(2), - sectionCasingDownSpeedFact: section.fact.casingDownSpeed.toFixed(2), - nonProductiveTimePlan: section.plan.nonProductiveHours.toFixed(2), - nonProductiveTimeFact: section.fact.nonProductiveHours.toFixed(2), - companies: el.companies - } - - rows.push(row) - - if(!filtersSectionsType.some(el => el.text === section.caption)) - filtersSectionsType.push({text: section.caption, value: section.caption}) - }) - }) - - setWellsStat(rows) - - }, [id, clusterData]) - - const rowSelection = { - selectedRowKeys: selectedWellsKeys, - onChange: (keys, items) => { - setSelectedWells(items) - setSelectedWellsKeys(keys) - }, - } - - return ( - <> -
- - -

Выбранные секции<>

-
-
- - ) -} diff --git a/src/pages/ClusterStat.jsx b/src/pages/ClusterStat.jsx deleted file mode 100644 index 9f8e181..0000000 --- a/src/pages/ClusterStat.jsx +++ /dev/null @@ -1,143 +0,0 @@ -import {useParams} from "react-router-dom"; -import {Link} from "react-router-dom"; -import LoaderPortal from '../components/LoaderPortal' -import { useState, useEffect } from "react"; -import {ClusterService} from '../services/api' -import { notify } from "../components/factory" -import {Table, Tag, Button} from 'antd'; - -const columns = [ - { - title: 'скв №', - key: 'caption', - dataIndex: 'caption', - render: (_, item) => {item.caption} - }, - { - title: 'Тип скв.', - key: 'wellType', - dataIndex: 'wellType', - }, - { - title: 'Фактические сроки бурения', - children: [ - { - title: 'начало', - key: 'factStart', - dataIndex: 'factStart', - }, - { - title: 'окончание', - key: 'factEnd', - dataIndex: 'factEnd', - }, - ] - }, - { - title: 'Продолжительность бурения', - children: [ - { - title: 'план', - key: 'periodPlan', - dataIndex: 'periodPlan', - }, - { - title: 'факт', - key: 'periodFact', - dataIndex: 'periodFact', - }, - ] - }, - { - title: 'МСП за скв', - children: [ - { - title: 'план', - key: 'rateOfPenetrationPlan', - dataIndex: 'rateOfPenetrationPlan', - }, - { - title: 'факт', - key: 'rateOfPenetrationFact', - dataIndex: 'rateOfPenetrationFact', - }, - ], - }, - { - title: 'Рейсовая скорость за скв', - children: [ - { - title: 'план', - key: 'routeSpeedPlan', - dataIndex: 'routeSpeedPlan', - }, - { - title: 'факт', - key: 'routeSpeedFact', - dataIndex: 'routeSpeedFact', - }, - ], - }, - { - title: 'Секции', - key: 'sections', - dataIndex: 'sections', - render: (item) => (таблица по секциям) - }, - { - title: 'График глубина-день', - render: _ => () - }, - { - title: 'Таблица по операциям', - render: _ => () - }, - { - title: 'Подрядчики', - key: 'companies', - dataIndex: 'companies', - render: (item) => item.map(company => {company.caption}) - }, -]; - -export default function ClusterStat() { - let { id } = useParams() - const [clusterTitle, setClusterTitle] = useState("") - const [wellsStat, setWellsStat] = useState(null) - const [showLoader, setShowLoader] = useState(false) - - useEffect(()=>{ - const updateWellsStat = async() => { - setShowLoader(true) - try{ - const msInDay = 1000*60*60*24 - const data = await ClusterService.getStat(id) - const wellsStat = data.wellsStat.map(w=>({...w, - periodPlan: (new Date(w.planEnd) - new Date(w.planStart))/msInDay, - periodFact: (new Date(w.factEnd) - new Date(w.factStart))/msInDay, - })) - setWellsStat(wellsStat) - setClusterTitle(data.caption) - } - catch(ex) { - notify(`Не удалось загрузить статистику по скважинам куста "${id}"`, 'error') - console.log(ex) - } - setShowLoader(false) - } - updateWellsStat() - },[id]) - - return( - -

{clusterTitle}

-
record.id} - /> - ) -} \ No newline at end of file diff --git a/src/pages/ClusterWells.jsx b/src/pages/ClusterWells.jsx deleted file mode 100644 index 13be233..0000000 --- a/src/pages/ClusterWells.jsx +++ /dev/null @@ -1,113 +0,0 @@ -import { useParams } from "react-router-dom"; -import { Link } from "react-router-dom"; -import { useState, useEffect } from "react"; -import { Table, Tag, Button } from 'antd'; -import { makeTextColumn, makeGroupColumn, makeNumericColumn, - makeNumericColumnPlanFact, calcAndUpdateStatsBySections } from '../components/Table/index' - - -const filtersMinMax = [ - { - text: "min", - value: "min", - }, - { - text: "max", - value: "max", - }, -] - -const filtersWellsType = [ - { - text: "Наклонно-направленная", - value: "Наклонно-направленная", - }, - { - text: "Горизонтальная", - value: "Горизонтальная", - } -] - - -export default function ClusterWells({clusterData}) { - let { id } = useParams() - const [wellsStat, setWellsStat] = useState([]) - - calcAndUpdateStatsBySections(wellsStat ?? [], [ - "factStart", - "factEnd", - "periodPlan", - "periodFact", - "rateOfPenetrationPlan", - "rateOfPenetrationFact", - "routeSpeedPlan", - "routeSpeedFact", - "notProductiveTime" - ]) - - useEffect(() => { - let tableData = clusterData.statsWells?.map(el => { - return { - key: el.id, - id: el.id, - caption: el.caption, - wellType: el.wellType, - factStart: new Date(el.total.fact.start).toLocaleString(), - factEnd: new Date(el.total.fact.end).toLocaleString(), - periodPlan: (Math.abs(new Date(el.total.plan.start) - - new Date(el.total.plan.end)) / (1000 * 60 * 60 * 24)).toFixed(2), - periodFact: (Math.abs(new Date(el.total.fact.start) - - new Date(el.total.fact.end)) / (1000 * 60 * 60 * 24)).toFixed(2), - rateOfPenetrationPlan: el.total.plan.rop.toFixed(2), - rateOfPenetrationFact: el.total.fact.rop.toFixed(2), - routeSpeedPlan: el.total.plan.routeSpeed.toFixed(2), - routeSpeedFact: el.total.fact.routeSpeed.toFixed(2), - notProductiveTimePlan: el.total.plan.nonProductiveHours.toFixed(2), - notProductiveTimeFact: el.total.fact.nonProductiveHours.toFixed(2), - companies: el.companies - } - }) - - setWellsStat(tableData) - - }, [id, clusterData]) - - const columns = [ - makeTextColumn('скв №', 'caption', null, null, - (_, item) => {item.caption}), - makeTextColumn('Тип скв.', 'wellType', filtersWellsType), - makeGroupColumn( 'Фактические сроки', [ - makeNumericColumn('начало', 'factStart'), - makeNumericColumn('окончание', 'factEnd'), - ]), - makeNumericColumnPlanFact('Продолжительность', 'period', filtersMinMax), - makeNumericColumnPlanFact('МСП', 'rateOfPenetration', filtersMinMax), - makeNumericColumnPlanFact('Рейсовая скорость', 'routeSpeed', filtersMinMax), - makeNumericColumnPlanFact('НПВ, сут', 'notProductiveTime', filtersMinMax), - { - title: 'График глубина-день', - render: (_, item) => () - }, - { - title: 'Таблица по операциям', - render: _ => () - }, - { - title: 'Подрядчики', - key: 'companies', - dataIndex: 'companies', - render: (item) => item.map(company => {company.caption}) - }, - ]; - - return ( -
record.id} - /> - ) -} \ No newline at end of file diff --git a/src/pages/Main.jsx b/src/pages/Main.jsx index 56d8ca8..bb6b6cd 100644 --- a/src/pages/Main.jsx +++ b/src/pages/Main.jsx @@ -1,31 +1,30 @@ -import Deposit from './Deposit' -import ClusterInfo from './ClusterInfo' +import { Redirect, Route, Switch } from "react-router-dom"; +import Deposit from "./Deposit"; +import Cluster from "./Cluster"; import Well from "./Well"; -import LayoutPortal from '../components/LayoutPortal' -import {Redirect, Route, Switch} from "react-router-dom"; +import LayoutPortal from "../components/LayoutPortal"; export default function Main() { - - return ( - - - - - - - - - - - - - - - - - - - - - ) + return ( + + + + + + + + + + + + + + + + + + + + + ); } diff --git a/src/pages/Well.jsx b/src/pages/Well.jsx index 834baa6..6c04c17 100644 --- a/src/pages/Well.jsx +++ b/src/pages/Well.jsx @@ -1,19 +1,25 @@ import { Layout, Menu } from "antd"; -import { FolderOutlined, FundViewOutlined, AlertOutlined, FilePdfOutlined, DatabaseOutlined } from "@ant-design/icons"; +import { + FolderOutlined, + FundViewOutlined, + AlertOutlined, + FilePdfOutlined, + DatabaseOutlined, +} from "@ant-design/icons"; import { Link, Redirect, Route, Switch, useParams } from "react-router-dom"; import TelemetryView from "./TelemetryView"; import Messages from "./Messages"; import Report from "./Report"; import Archive from "./Archive"; import Documents from "./Documents"; -import LastData from './LastData' +import LastData from "./LastData"; import { makeMenuItems } from "./Documents/menuItems"; import WellOperations from "./WellOperations"; const { Content } = Layout; export default function Well() { - let { idWell } = useParams(); + let { idWell, tab } = useParams(); const rootPath = `/well/${idWell}`; const { SubMenu } = Menu; @@ -21,30 +27,34 @@ export default function Well() { return ( <> - - }> + + }> Мониторинг - }> + }> Сообщения - }> + }> Рапорт - }> - - Операции по скважине - + }> + Операции по скважине - }> + }> Архив + to={`${rootPath}/document/fluidService`} + className="linkDocuments" + > Документы } @@ -53,7 +63,7 @@ export default function Well() { > {makeMenuItems(rootPath)} - }> + }> Последние данные @@ -80,7 +90,7 @@ export default function Well() { - +