+
-
График Глубина-день
-
+ {title ? title : (
+ График Глубина-день
+ )}
+
+
+
- );
-};
+ )
+}
diff --git a/src/pages/WellOperations/WellCompositeEditor/WellCompositeSections.jsx b/src/pages/WellOperations/WellCompositeEditor/WellCompositeSections.jsx
index 021f842..e0b9f87 100644
--- a/src/pages/WellOperations/WellCompositeEditor/WellCompositeSections.jsx
+++ b/src/pages/WellOperations/WellCompositeEditor/WellCompositeSections.jsx
@@ -1,5 +1,5 @@
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 { useState, useEffect } from 'react'
import {
@@ -14,7 +14,7 @@ import {
makeFilterMinMaxFunction,
getOperations
} from '../../Cluster/functions'
-import ChartTvD from '../ChartTvD'
+import { Tvd } from '../Tvd'
import { DrillParamsService, WellCompositeService } from '../../../services/api'
import LoaderPortal from '../../../components/LoaderPortal'
import WellOperationsTable from '../../Cluster/WellOperationsTable'
@@ -23,8 +23,8 @@ import { dictionarySectionType, getByKeyOrReturnKey } from '../dictionary'
const filtersMinMax = [
- { text: "min", value: "min" },
- { text: "max", value: "max" },
+ { text: 'min', value: 'min' },
+ { text: 'max', value: 'max' },
]
const filtersSectionsType = []
@@ -33,15 +33,13 @@ const DAY_IN_MS = 1000 * 60 * 60 * 24
export const WellCompositeSections = ({idWell, statsWells, selectedSections}) => {
const [showLoader, setShowLoader] = useState(false)
+ const [showParamsLoader, setShowParamsLoader] = useState(false)
const [selectedWellId, setSelectedWellId] = useState(0)
const [selectedWells, setSelectedWells] = useState([])
const [selectedWellsKeys, setSelectedWellsKeys] = useState([])
const [isTVDModalVisible, setIsTVDModalVisible] = useState(false)
const [isOpsModalVisible, setIsOpsModalVisible] = useState(false)
const [isParamsModalVisible, setIsParamsModalVisible] = useState(false)
- const [tvdDataPlan, setTvdDataPlan] = useState([])
- const [tvdDataFact, setTvdDataFact] = useState([])
- const [tvdDataForecast, setTvdDataForecast] = useState([])
const [wellOperations, setWellOperations] = useState([])
const [rows, setRows] = useState([])
const [params, setParams] = useState([])
@@ -50,15 +48,12 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
if (selectedWellId > 0) {
invokeWebApiWrapperAsync(
async () => {
- const operations = await getOperations(selectedWellId);
+ const operations = await getOperations(selectedWellId)
setWellOperations(operations.operations)
- setTvdDataPlan(operations.plan)
- setTvdDataFact(operations.fact)
- setTvdDataForecast(operations.predict)
},
setShowLoader,
- `Не удалось загрузить операции по скважине "${selectedWellId}"`,
+ `Не удалось загрузить операции по скважине '${selectedWellId}'`,
)
}
}, [selectedWellId])
@@ -100,22 +95,22 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
})
calcAndUpdateStatsBySections(rows ?? [], [
- "sectionWellDepthPlan",
- "sectionWellDepthFact",
- "sectionBuildDaysPlan",
- "sectionBuildDaysFact",
- "sectionRateOfPenetrationPlan",
- "sectionRateOfPenetrationFact",
- "sectionRouteSpeedPlan",
- "sectionRouteSpeedFact",
- "sectionBhaDownSpeedPlan",
- "sectionBhaDownSpeedFact",
- "sectionBhaUpSpeedPlan",
- "sectionBhaUpSpeedFact",
- "sectionCasingDownSpeedPlan",
- "sectionCasingDownSpeedFact",
- "nonProductiveTimePlan",
- "nonProductiveTimeFact",
+ 'sectionWellDepthPlan',
+ 'sectionWellDepthFact',
+ 'sectionBuildDaysPlan',
+ 'sectionBuildDaysFact',
+ 'sectionRateOfPenetrationPlan',
+ 'sectionRateOfPenetrationFact',
+ 'sectionRouteSpeedPlan',
+ 'sectionRouteSpeedFact',
+ 'sectionBhaDownSpeedPlan',
+ 'sectionBhaDownSpeedFact',
+ 'sectionBhaUpSpeedPlan',
+ 'sectionBhaUpSpeedFact',
+ 'sectionCasingDownSpeedPlan',
+ 'sectionCasingDownSpeedFact',
+ 'nonProductiveTimePlan',
+ 'nonProductiveTimeFact',
])
setRows(rows)
@@ -131,39 +126,39 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
}, [rows, selectedSections])
const columns = [
- makeTextColumn("скв №", "caption", null, null,
+ makeTextColumn('скв №', 'caption', null, null,
(text, item) =>
{text ?? '-'}
),
- makeTextColumn("Секция", "sectionType", filtersSectionsType, null, (text) => text ?? '-'),
- makeNumericColumnPlanFact("Глубина", "sectionWellDepth", filtersMinMax, makeFilterMinMaxFunction),
- makeNumericColumnPlanFact("Продолжительность", "sectionBuildDays", filtersMinMax, makeFilterMinMaxFunction),
- makeNumericColumnPlanFact("МСП", "sectionRateOfPenetration", filtersMinMax, makeFilterMinMaxFunction),
- makeNumericColumnPlanFact("Рейсовая скорость", "sectionRouteSpeed", filtersMinMax, makeFilterMinMaxFunction),
- makeNumericColumnPlanFact("Спуск КНБК", "sectionBhaDownSpeed", filtersMinMax, makeFilterMinMaxFunction),
- makeNumericColumnPlanFact("Подъем КНБК", "sectionBhaUpSpeed", filtersMinMax, makeFilterMinMaxFunction),
- makeNumericColumnPlanFact("Скорость спуска ОК", "sectionCasingDownSpeed", filtersMinMax, makeFilterMinMaxFunction),
- makeNumericColumnPlanFact("НПВ, сут", "nonProductiveTime", filtersMinMax, makeFilterMinMaxFunction, null, "70px"),
+ makeTextColumn('Секция', 'sectionType', filtersSectionsType, null, (text) => text ?? '-'),
+ makeNumericColumnPlanFact('Глубина', 'sectionWellDepth', filtersMinMax, makeFilterMinMaxFunction),
+ makeNumericColumnPlanFact('Продолжительность', 'sectionBuildDays', filtersMinMax, makeFilterMinMaxFunction),
+ makeNumericColumnPlanFact('МСП', 'sectionRateOfPenetration', filtersMinMax, makeFilterMinMaxFunction),
+ makeNumericColumnPlanFact('Рейсовая скорость', 'sectionRouteSpeed', filtersMinMax, makeFilterMinMaxFunction),
+ makeNumericColumnPlanFact('Спуск КНБК', 'sectionBhaDownSpeed', filtersMinMax, makeFilterMinMaxFunction),
+ makeNumericColumnPlanFact('Подъем КНБК', 'sectionBhaUpSpeed', filtersMinMax, makeFilterMinMaxFunction),
+ makeNumericColumnPlanFact('Скорость спуска ОК', 'sectionCasingDownSpeed', filtersMinMax, makeFilterMinMaxFunction),
+ makeNumericColumnPlanFact('НПВ, сут', 'nonProductiveTime', filtersMinMax, makeFilterMinMaxFunction, null, '70px'),
{
- title: "TVD",
+ title: 'TVD',
render: (value) =>
,
align: 'center'
},
{
- title: "Операции",
+ title: 'Операции',
render: (value) =>
,
align: 'center'
},
{
- title: "Подрядчики",
- dataIndex: "companies",
+ title: 'Подрядчики',
+ dataIndex: 'companies',
render: (item) =>
- item?.map((company) =>
{company.caption}),
+ item?.map((company) =>
{company.caption}),
},
]
@@ -192,28 +187,28 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
setSelectedWells(items)
setSelectedWellsKeys(keys)
},
- setShowLoader,
- 'Не удалось сохранить изменения выбранных секций для композитной скважины'
+ setShowParamsLoader,
+ `Не удалось сохранить изменения выбранных секций для композитной скважины "${idWell}"`
)
}
const onParamButtonClick = () => invokeWebApiWrapperAsync(
async () => {
+ setIsParamsModalVisible(true)
const params = await DrillParamsService.getCompositeAll(idWell)
setParams(params)
- setIsParamsModalVisible(true)
},
- setShowLoader,
- `Не удалось загрузить список режимов для скважины ${idWell}`
+ setShowParamsLoader,
+ `Не удалось загрузить список режимов для скважины "${idWell}"`
)
const onParamsAddClick = () => invokeWebApiWrapperAsync(
async () => {
- await DrillParamsService.insertRange(idWell, params)
+ await DrillParamsService.save(idWell, params)
setIsParamsModalVisible(false)
},
setShowLoader,
- `Не удалось добавить режимы в список скважины ${idWell}`
+ `Не удалось добавить режимы в список скважины "${idWell}"`
)
return (
@@ -221,21 +216,21 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
-
+
Выбранные секции
setIsTVDModalVisible(false)}
width={1500}
footer={null}
>
-
-
-
+
setIsOpsModalVisible(false)}
@@ -284,14 +274,15 @@ export const WellCompositeSections = ({idWell, statsWells, selectedSections}) =>
onCancel={() => setIsParamsModalVisible(false)}
width={1700}
footer={
-
+
+
+
}
>
-
+
>
- );
+ )
}
diff --git a/src/services/api/services/DrillParamsService.ts b/src/services/api/services/DrillParamsService.ts
index 001b630..483dfd3 100644
--- a/src/services/api/services/DrillParamsService.ts
+++ b/src/services/api/services/DrillParamsService.ts
@@ -129,6 +129,25 @@ export class DrillParamsService {
return result.body;
}
+ /**
+ * Удаляет старые режимы бурения по скважине и добавляет новые
+ * @param idWell Id скважины для добавления
+ * @param requestBody Новые режимы бурения
+ * @returns number Success
+ * @throws ApiError
+ */
+ public static async save(
+ idWell: number,
+ requestBody?: Array,
+ ): Promise {
+ const result = await __request({
+ method: 'POST',
+ path: `/api/well/${idWell}/drillParams/save`,
+ body: requestBody,
+ });
+ return result.body;
+ }
+
/**
* Возвращает значения для режимов бурения на композитной скважине
* @param idWell id скважины