forked from ddrilling/asb_cloud_front
Показ TVD унифицирован, Сохранение режимов из окна композитной скважины теперь заменят другие существующие
This commit is contained in:
parent
2f6a776eb9
commit
3a9c4331d7
@ -1,69 +1,56 @@
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from 'react-router-dom'
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from 'react'
|
||||||
import { Table, Tag, Button, Modal } from "antd";
|
import { Table, Tag, Button, Modal } from 'antd'
|
||||||
import { LineChartOutlined, ProfileOutlined } from "@ant-design/icons";
|
import { LineChartOutlined, ProfileOutlined } from '@ant-design/icons'
|
||||||
import {
|
import {
|
||||||
makeTextColumn,
|
makeTextColumn,
|
||||||
makeGroupColumn,
|
makeGroupColumn,
|
||||||
makeColumn,
|
makeColumn,
|
||||||
makeDateSorter,
|
makeDateSorter,
|
||||||
makeNumericColumnPlanFact} from "../../components/Table";
|
makeNumericColumnPlanFact} from '../../components/Table'
|
||||||
import { calcAndUpdateStatsBySections, makeFilterMinMaxFunction, getPrecision } from "./functions";
|
import { calcAndUpdateStatsBySections, makeFilterMinMaxFunction, getPrecision } from './functions'
|
||||||
import { invokeWebApiWrapperAsync } from '../../components/factory';
|
import { invokeWebApiWrapperAsync } from '../../components/factory'
|
||||||
import ChartTvD from '../WellOperations/ChartTvD';
|
import { Tvd } from '../WellOperations/Tvd'
|
||||||
import WellOperationsTable from './WellOperationsTable'
|
import WellOperationsTable from './WellOperationsTable'
|
||||||
import { getOperations } from "./functions";
|
import { getOperations } from './functions'
|
||||||
import LoaderPortal from "../../components/LoaderPortal";
|
import LoaderPortal from '../../components/LoaderPortal'
|
||||||
|
|
||||||
const filtersMinMax = [
|
const filtersMinMax = [
|
||||||
{
|
{ text: 'min', value: 'min' },
|
||||||
text: "min",
|
{ text: 'max', value: 'max' },
|
||||||
value: "min",
|
]
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "max",
|
|
||||||
value: "max",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const filtersWellsType = [];
|
const filtersWellsType = []
|
||||||
const DAY_IN_MS = 1000 * 60 * 60 * 24;
|
const DAY_IN_MS = 1000 * 60 * 60 * 24
|
||||||
|
|
||||||
export default function ClusterWells({statsWells}) {
|
export default function ClusterWells({statsWells}) {
|
||||||
|
|
||||||
const [selectedWellId, setSelectedWellId] = useState(0)
|
const [selectedWellId, setSelectedWellId] = useState(0)
|
||||||
const [isTVDModalVisible, setIsTVDModalVisible] = useState(false)
|
const [isTVDModalVisible, setIsTVDModalVisible] = useState(false)
|
||||||
const [isOpsModalVisible, setIsOpsModalVisible] = useState(false)
|
const [isOpsModalVisible, setIsOpsModalVisible] = useState(false)
|
||||||
const [tvdDataPlan, setTvdDataPlan] = useState([]);
|
const [wellOperations, setWellOperations] = useState([])
|
||||||
const [tvdDataFact, setTvdDataFact] = useState([]);
|
|
||||||
const [tvdDataForecast, setTvdDataForecast] = useState([]);
|
|
||||||
const [wellOperations, setWellOperations] = useState([]);
|
|
||||||
const [tableData, setTableData] = useState([])
|
const [tableData, setTableData] = useState([])
|
||||||
const [showLoader, setShowLoader] = useState(false)
|
const [showLoader, setShowLoader] = useState(false)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedWellId > 0) {
|
if (!isOpsModalVisible || selectedWellId <= 0) {
|
||||||
invokeWebApiWrapperAsync(
|
|
||||||
async () => {
|
|
||||||
const operations = await getOperations(selectedWellId);
|
|
||||||
|
|
||||||
setWellOperations(operations.operations)
|
|
||||||
setTvdDataPlan(operations.plan)
|
|
||||||
setTvdDataFact(operations.fact)
|
|
||||||
setTvdDataForecast(operations.predict)
|
|
||||||
},
|
|
||||||
setShowLoader,
|
|
||||||
`Не удалось загрузить операции по скважине "${selectedWellId}"`,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
setWellOperations([])
|
setWellOperations([])
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}, [selectedWellId]);
|
invokeWebApiWrapperAsync(
|
||||||
|
async () => {
|
||||||
|
const operations = await getOperations(selectedWellId)
|
||||||
|
setWellOperations(operations.operations)
|
||||||
|
},
|
||||||
|
setShowLoader,
|
||||||
|
`Не удалось загрузить операции по скважине "${selectedWellId}"`,
|
||||||
|
)
|
||||||
|
}, [selectedWellId, isOpsModalVisible])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let data = statsWells?.map((well) => {
|
let data = statsWells?.map((well) => {
|
||||||
if (!filtersWellsType.some((el) => el.text === well.wellType))
|
if (!filtersWellsType.some((el) => el.text === well.wellType))
|
||||||
filtersWellsType.push({ text: well.wellType, value: well.wellType,});
|
filtersWellsType.push({ text: well.wellType, value: well.wellType,})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
key: well.caption,
|
key: well.caption,
|
||||||
@ -81,20 +68,20 @@ export default function ClusterWells({statsWells}) {
|
|||||||
notProductiveTimePlan: well.total?.plan?.nonProductiveHours,
|
notProductiveTimePlan: well.total?.plan?.nonProductiveHours,
|
||||||
notProductiveTimeFact: well.total?.fact?.nonProductiveHours,
|
notProductiveTimeFact: well.total?.fact?.nonProductiveHours,
|
||||||
companies: well.companies
|
companies: well.companies
|
||||||
};
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
calcAndUpdateStatsBySections(data ?? [], [
|
calcAndUpdateStatsBySections(data ?? [], [
|
||||||
"factStart",
|
'factStart',
|
||||||
"factEnd",
|
'factEnd',
|
||||||
"periodPlan",
|
'periodPlan',
|
||||||
"periodFact",
|
'periodFact',
|
||||||
"rateOfPenetrationPlan",
|
'rateOfPenetrationPlan',
|
||||||
"rateOfPenetrationFact",
|
'rateOfPenetrationFact',
|
||||||
"routeSpeedPlan",
|
'routeSpeedPlan',
|
||||||
"routeSpeedFact",
|
'routeSpeedFact',
|
||||||
"notProductiveTime",
|
'notProductiveTime',
|
||||||
]);
|
])
|
||||||
|
|
||||||
setTableData(data)
|
setTableData(data)
|
||||||
}, [statsWells])
|
}, [statsWells])
|
||||||
@ -102,21 +89,21 @@ export default function ClusterWells({statsWells}) {
|
|||||||
const getDate = (str) => Number.isNaN(new Date(str).getTime()) ? '-' : new Date(str).toLocaleString()
|
const getDate = (str) => Number.isNaN(new Date(str).getTime()) ? '-' : new Date(str).toLocaleString()
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
makeTextColumn("скв №", "caption", null, null,
|
makeTextColumn('скв №', 'caption', null, null,
|
||||||
(_, item) => (<Link to={`/well/${item.id}`}>{item.caption ?? '-'}</Link>
|
(_, item) => (<Link to={`/well/${item.id}`}>{item.caption ?? '-'}</Link>
|
||||||
)),
|
)),
|
||||||
makeTextColumn("Тип скв.", "wellType", filtersWellsType, null, (text) => text ?? '-'),
|
makeTextColumn('Тип скв.', 'wellType', filtersWellsType, null, (text) => text ?? '-'),
|
||||||
makeGroupColumn("Фактические сроки", [
|
makeGroupColumn('Фактические сроки', [
|
||||||
makeColumn("начало", "factStart", { sorter: makeDateSorter('factStart'), render: getDate }),
|
makeColumn('начало', 'factStart', { sorter: makeDateSorter('factStart'), render: getDate }),
|
||||||
makeColumn("окончание", "factEnd", { sorter: makeDateSorter('factEnd'), render: getDate })
|
makeColumn('окончание', 'factEnd', { sorter: makeDateSorter('factEnd'), render: getDate })
|
||||||
]),
|
]),
|
||||||
makeNumericColumnPlanFact("Продолжительность", "period", filtersMinMax, makeFilterMinMaxFunction, getPrecision),
|
makeNumericColumnPlanFact('Продолжительность', 'period', filtersMinMax, makeFilterMinMaxFunction, getPrecision),
|
||||||
makeNumericColumnPlanFact("МСП", "rateOfPenetration", filtersMinMax, makeFilterMinMaxFunction, getPrecision),
|
makeNumericColumnPlanFact('МСП', 'rateOfPenetration', filtersMinMax, makeFilterMinMaxFunction, getPrecision),
|
||||||
makeNumericColumnPlanFact("Рейсовая скорость", "routeSpeed", filtersMinMax, makeFilterMinMaxFunction, getPrecision),
|
makeNumericColumnPlanFact('Рейсовая скорость', 'routeSpeed', filtersMinMax, makeFilterMinMaxFunction, getPrecision),
|
||||||
makeNumericColumnPlanFact("НПВ, сут", "notProductiveTime", filtersMinMax, makeFilterMinMaxFunction, getPrecision),
|
makeNumericColumnPlanFact('НПВ, сут', 'notProductiveTime', filtersMinMax, makeFilterMinMaxFunction, getPrecision),
|
||||||
{
|
{
|
||||||
title: "TVD",
|
title: 'TVD',
|
||||||
key: "tvd",
|
key: 'tvd',
|
||||||
render: (value) => <Button onClick={()=> {
|
render: (value) => <Button onClick={()=> {
|
||||||
setSelectedWellId(value.id)
|
setSelectedWellId(value.id)
|
||||||
setIsTVDModalVisible(true)
|
setIsTVDModalVisible(true)
|
||||||
@ -124,8 +111,8 @@ export default function ClusterWells({statsWells}) {
|
|||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Операции",
|
title: 'Операции',
|
||||||
key: "operations",
|
key: 'operations',
|
||||||
render: (value) => <Button onClick={()=> {
|
render: (value) => <Button onClick={()=> {
|
||||||
setSelectedWellId(value.id)
|
setSelectedWellId(value.id)
|
||||||
setIsOpsModalVisible(true)
|
setIsOpsModalVisible(true)
|
||||||
@ -133,43 +120,37 @@ export default function ClusterWells({statsWells}) {
|
|||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Подрядчики",
|
title: 'Подрядчики',
|
||||||
key: "companies",
|
key: 'companies',
|
||||||
dataIndex: "companies",
|
dataIndex: 'companies',
|
||||||
render: (item) => item?.map((company) => <Tag key={company.caption} color="blue">{company.caption}</Tag>) ?? '-',
|
render: (item) => item?.map((company) => <Tag key={company.caption} color='blue'>{company.caption}</Tag>) ?? '-',
|
||||||
},
|
},
|
||||||
];
|
]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Table
|
<Table
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={tableData}
|
dataSource={tableData}
|
||||||
size={"small"}
|
size={'small'}
|
||||||
bordered
|
bordered
|
||||||
pagination={false}
|
pagination={false}
|
||||||
rowKey={(record) => record.caption}
|
rowKey={(record) => record.caption}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
title='TVD'
|
title={'TVD'}
|
||||||
centered
|
centered
|
||||||
visible={isTVDModalVisible}
|
visible={isTVDModalVisible}
|
||||||
onCancel={() => setIsTVDModalVisible(false)}
|
onCancel={() => setIsTVDModalVisible(false)}
|
||||||
width={1500}
|
width={1500}
|
||||||
footer={null}
|
footer={null}
|
||||||
>
|
>
|
||||||
<LoaderPortal show={showLoader}>
|
<Tvd idWell={selectedWellId} />
|
||||||
<ChartTvD
|
|
||||||
dataPlan={tvdDataPlan}
|
|
||||||
dataFact={tvdDataFact}
|
|
||||||
dataPredict={tvdDataForecast}
|
|
||||||
/>
|
|
||||||
</LoaderPortal>
|
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
title='Операции'
|
title={'Операции'}
|
||||||
centered
|
centered
|
||||||
visible={isOpsModalVisible}
|
visible={isOpsModalVisible}
|
||||||
onCancel={() => setIsOpsModalVisible(false)}
|
onCancel={() => setIsOpsModalVisible(false)}
|
||||||
@ -181,5 +162,5 @@ export default function ClusterWells({statsWells}) {
|
|||||||
</LoaderPortal>
|
</LoaderPortal>
|
||||||
</Modal>
|
</Modal>
|
||||||
</>
|
</>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,36 +1,43 @@
|
|||||||
import ChartTvD from './ChartTvD';
|
import ChartTvD from './ChartTvD'
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react'
|
||||||
import { invokeWebApiWrapperAsync } from '../../components/factory';
|
import { invokeWebApiWrapperAsync } from '../../components/factory'
|
||||||
import { getOperations } from '../Cluster/functions';
|
import { getOperations } from '../Cluster/functions'
|
||||||
|
import LoaderPortal from '../../components/LoaderPortal'
|
||||||
|
|
||||||
|
|
||||||
export const Tvd = ({ idWell }) => {
|
export const Tvd = ({ idWell, title }) => {
|
||||||
const [dataPlan, setDataPlan] = useState([]);
|
const [dataPlan, setDataPlan] = useState([])
|
||||||
const [dataFact, setDataFact] = useState([]);
|
const [dataFact, setDataFact] = useState([])
|
||||||
const [dataPredict, setDataPredict] = useState([]);
|
const [dataPredict, setDataPredict] = useState([])
|
||||||
|
const [showLoader, setShowLoader] = useState(false)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
invokeWebApiWrapperAsync(
|
invokeWebApiWrapperAsync(
|
||||||
async () => {
|
async () => {
|
||||||
const operations = await getOperations(idWell);
|
const operations = await getOperations(idWell)
|
||||||
setDataPlan(operations.plan)
|
setDataPlan(operations.plan)
|
||||||
setDataFact(operations.fact)
|
setDataFact(operations.fact)
|
||||||
setDataPredict(operations.predict)
|
setDataPredict(operations.predict)
|
||||||
},
|
},
|
||||||
null,
|
setShowLoader,
|
||||||
`Не удалось загрузить операции по скважине "${idWell}"`,
|
`Не удалось загрузить операции по скважине "${idWell}"`,
|
||||||
);
|
)
|
||||||
}, [idWell]);
|
}, [idWell])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container">
|
<div className='container'>
|
||||||
<div>
|
<div>
|
||||||
<h2 className={'mt-20px'}>График Глубина-день</h2>
|
{title ? title : (
|
||||||
<ChartTvD
|
<h2 className={'mt-20px'}>График Глубина-день</h2>
|
||||||
dataPlan={dataPlan}
|
)}
|
||||||
dataFact={dataFact}
|
<LoaderPortal show={showLoader}>
|
||||||
dataPredict={dataPredict} />
|
<ChartTvD
|
||||||
|
dataPlan={dataPlan}
|
||||||
|
dataFact={dataFact}
|
||||||
|
dataPredict={dataPredict}
|
||||||
|
/>
|
||||||
|
</LoaderPortal>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
)
|
||||||
};
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { LineChartOutlined, ProfileOutlined } from '@ant-design/icons'
|
import { LineChartOutlined, ProfileOutlined } from '@ant-design/icons'
|
||||||
import { Table, Tag, Button, Badge, Divider, Modal, Row, Col } from 'antd'
|
import { Table, Tag, Button, Badge, Divider, Modal, Row, Col, Popconfirm } from 'antd'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import {
|
import {
|
||||||
@ -14,7 +14,7 @@ import {
|
|||||||
makeFilterMinMaxFunction,
|
makeFilterMinMaxFunction,
|
||||||
getOperations
|
getOperations
|
||||||
} from '../../Cluster/functions'
|
} from '../../Cluster/functions'
|
||||||
import ChartTvD from '../ChartTvD'
|
import { Tvd } from '../Tvd'
|
||||||
import { DrillParamsService, WellCompositeService } from '../../../services/api'
|
import { DrillParamsService, WellCompositeService } from '../../../services/api'
|
||||||
import LoaderPortal from '../../../components/LoaderPortal'
|
import LoaderPortal from '../../../components/LoaderPortal'
|
||||||
import WellOperationsTable from '../../Cluster/WellOperationsTable'
|
import WellOperationsTable from '../../Cluster/WellOperationsTable'
|
||||||
@ -23,8 +23,8 @@ import { dictionarySectionType, getByKeyOrReturnKey } from '../dictionary'
|
|||||||
|
|
||||||
|
|
||||||
const filtersMinMax = [
|
const filtersMinMax = [
|
||||||
{ text: "min", value: "min" },
|
{ text: 'min', value: 'min' },
|
||||||
{ text: "max", value: "max" },
|
{ text: 'max', value: 'max' },
|
||||||
]
|
]
|
||||||
|
|
||||||
const filtersSectionsType = []
|
const filtersSectionsType = []
|
||||||
@ -33,15 +33,13 @@ const DAY_IN_MS = 1000 * 60 * 60 * 24
|
|||||||
export const WellCompositeSections = ({idWell, statsWells, selectedSections}) => {
|
export const WellCompositeSections = ({idWell, statsWells, selectedSections}) => {
|
||||||
|
|
||||||
const [showLoader, setShowLoader] = useState(false)
|
const [showLoader, setShowLoader] = useState(false)
|
||||||
|
const [showParamsLoader, setShowParamsLoader] = useState(false)
|
||||||
const [selectedWellId, setSelectedWellId] = useState(0)
|
const [selectedWellId, setSelectedWellId] = useState(0)
|
||||||
const [selectedWells, setSelectedWells] = useState([])
|
const [selectedWells, setSelectedWells] = useState([])
|
||||||
const [selectedWellsKeys, setSelectedWellsKeys] = useState([])
|
const [selectedWellsKeys, setSelectedWellsKeys] = useState([])
|
||||||
const [isTVDModalVisible, setIsTVDModalVisible] = useState(false)
|
const [isTVDModalVisible, setIsTVDModalVisible] = useState(false)
|
||||||
const [isOpsModalVisible, setIsOpsModalVisible] = useState(false)
|
const [isOpsModalVisible, setIsOpsModalVisible] = useState(false)
|
||||||
const [isParamsModalVisible, setIsParamsModalVisible] = useState(false)
|
const [isParamsModalVisible, setIsParamsModalVisible] = useState(false)
|
||||||
const [tvdDataPlan, setTvdDataPlan] = useState([])
|
|
||||||
const [tvdDataFact, setTvdDataFact] = useState([])
|
|
||||||
const [tvdDataForecast, setTvdDataForecast] = useState([])
|
|
||||||
const [wellOperations, setWellOperations] = useState([])
|
const [wellOperations, setWellOperations] = useState([])
|
||||||
const [rows, setRows] = useState([])
|
const [rows, setRows] = useState([])
|
||||||
const [params, setParams] = useState([])
|
const [params, setParams] = useState([])
|
||||||
@ -50,15 +48,12 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
|
|||||||
if (selectedWellId > 0) {
|
if (selectedWellId > 0) {
|
||||||
invokeWebApiWrapperAsync(
|
invokeWebApiWrapperAsync(
|
||||||
async () => {
|
async () => {
|
||||||
const operations = await getOperations(selectedWellId);
|
const operations = await getOperations(selectedWellId)
|
||||||
|
|
||||||
setWellOperations(operations.operations)
|
setWellOperations(operations.operations)
|
||||||
setTvdDataPlan(operations.plan)
|
|
||||||
setTvdDataFact(operations.fact)
|
|
||||||
setTvdDataForecast(operations.predict)
|
|
||||||
},
|
},
|
||||||
setShowLoader,
|
setShowLoader,
|
||||||
`Не удалось загрузить операции по скважине "${selectedWellId}"`,
|
`Не удалось загрузить операции по скважине '${selectedWellId}'`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}, [selectedWellId])
|
}, [selectedWellId])
|
||||||
@ -100,22 +95,22 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
|
|||||||
})
|
})
|
||||||
|
|
||||||
calcAndUpdateStatsBySections(rows ?? [], [
|
calcAndUpdateStatsBySections(rows ?? [], [
|
||||||
"sectionWellDepthPlan",
|
'sectionWellDepthPlan',
|
||||||
"sectionWellDepthFact",
|
'sectionWellDepthFact',
|
||||||
"sectionBuildDaysPlan",
|
'sectionBuildDaysPlan',
|
||||||
"sectionBuildDaysFact",
|
'sectionBuildDaysFact',
|
||||||
"sectionRateOfPenetrationPlan",
|
'sectionRateOfPenetrationPlan',
|
||||||
"sectionRateOfPenetrationFact",
|
'sectionRateOfPenetrationFact',
|
||||||
"sectionRouteSpeedPlan",
|
'sectionRouteSpeedPlan',
|
||||||
"sectionRouteSpeedFact",
|
'sectionRouteSpeedFact',
|
||||||
"sectionBhaDownSpeedPlan",
|
'sectionBhaDownSpeedPlan',
|
||||||
"sectionBhaDownSpeedFact",
|
'sectionBhaDownSpeedFact',
|
||||||
"sectionBhaUpSpeedPlan",
|
'sectionBhaUpSpeedPlan',
|
||||||
"sectionBhaUpSpeedFact",
|
'sectionBhaUpSpeedFact',
|
||||||
"sectionCasingDownSpeedPlan",
|
'sectionCasingDownSpeedPlan',
|
||||||
"sectionCasingDownSpeedFact",
|
'sectionCasingDownSpeedFact',
|
||||||
"nonProductiveTimePlan",
|
'nonProductiveTimePlan',
|
||||||
"nonProductiveTimeFact",
|
'nonProductiveTimeFact',
|
||||||
])
|
])
|
||||||
|
|
||||||
setRows(rows)
|
setRows(rows)
|
||||||
@ -131,39 +126,39 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
|
|||||||
}, [rows, selectedSections])
|
}, [rows, selectedSections])
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
makeTextColumn("скв №", "caption", null, null,
|
makeTextColumn('скв №', 'caption', null, null,
|
||||||
(text, item) => <Link to={`/well/${item?.id}`}>{text ?? '-'}</Link>
|
(text, item) => <Link to={`/well/${item?.id}`}>{text ?? '-'}</Link>
|
||||||
),
|
),
|
||||||
makeTextColumn("Секция", "sectionType", filtersSectionsType, null, (text) => text ?? '-'),
|
makeTextColumn('Секция', 'sectionType', filtersSectionsType, null, (text) => text ?? '-'),
|
||||||
makeNumericColumnPlanFact("Глубина", "sectionWellDepth", filtersMinMax, makeFilterMinMaxFunction),
|
makeNumericColumnPlanFact('Глубина', 'sectionWellDepth', filtersMinMax, makeFilterMinMaxFunction),
|
||||||
makeNumericColumnPlanFact("Продолжительность", "sectionBuildDays", filtersMinMax, makeFilterMinMaxFunction),
|
makeNumericColumnPlanFact('Продолжительность', 'sectionBuildDays', filtersMinMax, makeFilterMinMaxFunction),
|
||||||
makeNumericColumnPlanFact("МСП", "sectionRateOfPenetration", filtersMinMax, makeFilterMinMaxFunction),
|
makeNumericColumnPlanFact('МСП', 'sectionRateOfPenetration', filtersMinMax, makeFilterMinMaxFunction),
|
||||||
makeNumericColumnPlanFact("Рейсовая скорость", "sectionRouteSpeed", filtersMinMax, makeFilterMinMaxFunction),
|
makeNumericColumnPlanFact('Рейсовая скорость', 'sectionRouteSpeed', filtersMinMax, makeFilterMinMaxFunction),
|
||||||
makeNumericColumnPlanFact("Спуск КНБК", "sectionBhaDownSpeed", filtersMinMax, makeFilterMinMaxFunction),
|
makeNumericColumnPlanFact('Спуск КНБК', 'sectionBhaDownSpeed', filtersMinMax, makeFilterMinMaxFunction),
|
||||||
makeNumericColumnPlanFact("Подъем КНБК", "sectionBhaUpSpeed", filtersMinMax, makeFilterMinMaxFunction),
|
makeNumericColumnPlanFact('Подъем КНБК', 'sectionBhaUpSpeed', filtersMinMax, makeFilterMinMaxFunction),
|
||||||
makeNumericColumnPlanFact("Скорость спуска ОК", "sectionCasingDownSpeed", filtersMinMax, makeFilterMinMaxFunction),
|
makeNumericColumnPlanFact('Скорость спуска ОК', 'sectionCasingDownSpeed', filtersMinMax, makeFilterMinMaxFunction),
|
||||||
makeNumericColumnPlanFact("НПВ, сут", "nonProductiveTime", filtersMinMax, makeFilterMinMaxFunction, null, "70px"),
|
makeNumericColumnPlanFact('НПВ, сут', 'nonProductiveTime', filtersMinMax, makeFilterMinMaxFunction, null, '70px'),
|
||||||
{
|
{
|
||||||
title: "TVD",
|
title: 'TVD',
|
||||||
render: (value) => <Button onClick={()=> {
|
render: (value) => <Button onClick={()=> {
|
||||||
setSelectedWellId(value.id)
|
setSelectedWellId(value.id)
|
||||||
setIsTVDModalVisible(true)
|
setIsTVDModalVisible(true)
|
||||||
}}><LineChartOutlined /></Button>,
|
}}><LineChartOutlined /></Button>,
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Операции",
|
title: 'Операции',
|
||||||
render: (value) => <Button onClick={()=> {
|
render: (value) => <Button onClick={()=> {
|
||||||
setSelectedWellId(value.id)
|
setSelectedWellId(value.id)
|
||||||
setIsOpsModalVisible(true)
|
setIsOpsModalVisible(true)
|
||||||
}}><ProfileOutlined /></Button>,
|
}}><ProfileOutlined /></Button>,
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Подрядчики",
|
title: 'Подрядчики',
|
||||||
dataIndex: "companies",
|
dataIndex: 'companies',
|
||||||
render: (item) =>
|
render: (item) =>
|
||||||
item?.map((company) => <Tag key={company.caption} color="blue">{company.caption}</Tag>),
|
item?.map((company) => <Tag key={company.caption} color={'blue'}>{company.caption}</Tag>),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -192,28 +187,28 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
|
|||||||
setSelectedWells(items)
|
setSelectedWells(items)
|
||||||
setSelectedWellsKeys(keys)
|
setSelectedWellsKeys(keys)
|
||||||
},
|
},
|
||||||
setShowLoader,
|
setShowParamsLoader,
|
||||||
'Не удалось сохранить изменения выбранных секций для композитной скважины'
|
`Не удалось сохранить изменения выбранных секций для композитной скважины "${idWell}"`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const onParamButtonClick = () => invokeWebApiWrapperAsync(
|
const onParamButtonClick = () => invokeWebApiWrapperAsync(
|
||||||
async () => {
|
async () => {
|
||||||
|
setIsParamsModalVisible(true)
|
||||||
const params = await DrillParamsService.getCompositeAll(idWell)
|
const params = await DrillParamsService.getCompositeAll(idWell)
|
||||||
setParams(params)
|
setParams(params)
|
||||||
setIsParamsModalVisible(true)
|
|
||||||
},
|
},
|
||||||
setShowLoader,
|
setShowParamsLoader,
|
||||||
`Не удалось загрузить список режимов для скважины ${idWell}`
|
`Не удалось загрузить список режимов для скважины "${idWell}"`
|
||||||
)
|
)
|
||||||
|
|
||||||
const onParamsAddClick = () => invokeWebApiWrapperAsync(
|
const onParamsAddClick = () => invokeWebApiWrapperAsync(
|
||||||
async () => {
|
async () => {
|
||||||
await DrillParamsService.insertRange(idWell, params)
|
await DrillParamsService.save(idWell, params)
|
||||||
setIsParamsModalVisible(false)
|
setIsParamsModalVisible(false)
|
||||||
},
|
},
|
||||||
setShowLoader,
|
setShowLoader,
|
||||||
`Не удалось добавить режимы в список скважины ${idWell}`
|
`Не удалось добавить режимы в список скважины "${idWell}"`
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -221,21 +216,21 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
|
|||||||
<Table
|
<Table
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={rows}
|
dataSource={rows}
|
||||||
size={"small"}
|
size={'small'}
|
||||||
bordered
|
bordered
|
||||||
scroll={{ x: true, y: 620 }}
|
scroll={{ x: true, y: 620 }}
|
||||||
rowSelection={rowSelection}
|
rowSelection={rowSelection}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
/>
|
/>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Badge.Ribbon text="комбинированная скважина" color="gray">
|
<Badge.Ribbon text={'комбинированная скважина'} color={'gray'}>
|
||||||
<h3>Выбранные секции</h3>
|
<h3>Выбранные секции</h3>
|
||||||
</Badge.Ribbon>
|
</Badge.Ribbon>
|
||||||
<Table
|
<Table
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={selectedWells}
|
dataSource={selectedWells}
|
||||||
rowSelection={rowSelection}
|
rowSelection={rowSelection}
|
||||||
size={"small"}
|
size={'small'}
|
||||||
bordered
|
bordered
|
||||||
scroll={{ x: true }}
|
scroll={{ x: true }}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
@ -249,23 +244,18 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
|
|||||||
</Col></Row>
|
</Col></Row>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
title='TVD'
|
title={'TVD'}
|
||||||
centered
|
centered
|
||||||
visible={isTVDModalVisible}
|
visible={isTVDModalVisible}
|
||||||
onCancel={() => setIsTVDModalVisible(false)}
|
onCancel={() => setIsTVDModalVisible(false)}
|
||||||
width={1500}
|
width={1500}
|
||||||
footer={null}
|
footer={null}
|
||||||
>
|
>
|
||||||
<LoaderPortal show={showLoader}>
|
<Tvd idWell={selectedWellId}/>
|
||||||
<ChartTvD
|
|
||||||
dataPlan={tvdDataPlan}
|
|
||||||
dataFact={tvdDataFact}
|
|
||||||
dataPredict={tvdDataForecast} />
|
|
||||||
</LoaderPortal>
|
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
title='Операции'
|
title={'Операции'}
|
||||||
centered
|
centered
|
||||||
visible={isOpsModalVisible}
|
visible={isOpsModalVisible}
|
||||||
onCancel={() => setIsOpsModalVisible(false)}
|
onCancel={() => setIsOpsModalVisible(false)}
|
||||||
@ -284,14 +274,15 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
|
|||||||
onCancel={() => setIsParamsModalVisible(false)}
|
onCancel={() => setIsParamsModalVisible(false)}
|
||||||
width={1700}
|
width={1700}
|
||||||
footer={
|
footer={
|
||||||
<Button
|
<Popconfirm title='Заменить существующие режимы выбранными?' onConfirm={onParamsAddClick}>
|
||||||
size={'large'}
|
<Button
|
||||||
disabled={params.length <= 0}
|
size={'large'}
|
||||||
onClick={onParamsAddClick}
|
disabled={params.length <= 0}
|
||||||
>Добавить</Button>
|
>Сохранить</Button>
|
||||||
|
</Popconfirm>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<LoaderPortal show={showLoader}>
|
<LoaderPortal show={showParamsLoader}>
|
||||||
<Table
|
<Table
|
||||||
size={'small'}
|
size={'small'}
|
||||||
bordered
|
bordered
|
||||||
@ -302,5 +293,5 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
|
|||||||
</LoaderPortal>
|
</LoaderPortal>
|
||||||
</Modal>
|
</Modal>
|
||||||
</>
|
</>
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
|
@ -129,6 +129,25 @@ export class DrillParamsService {
|
|||||||
return result.body;
|
return result.body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Удаляет старые режимы бурения по скважине и добавляет новые
|
||||||
|
* @param idWell Id скважины для добавления
|
||||||
|
* @param requestBody Новые режимы бурения
|
||||||
|
* @returns number Success
|
||||||
|
* @throws ApiError
|
||||||
|
*/
|
||||||
|
public static async save(
|
||||||
|
idWell: number,
|
||||||
|
requestBody?: Array<DrillParamsDto>,
|
||||||
|
): Promise<number> {
|
||||||
|
const result = await __request({
|
||||||
|
method: 'POST',
|
||||||
|
path: `/api/well/${idWell}/drillParams/save`,
|
||||||
|
body: requestBody,
|
||||||
|
});
|
||||||
|
return result.body;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Возвращает значения для режимов бурения на композитной скважине
|
* Возвращает значения для режимов бурения на композитной скважине
|
||||||
* @param idWell id скважины
|
* @param idWell id скважины
|
||||||
|
Loading…
Reference in New Issue
Block a user