@@ -80,20 +92,7 @@ export const MonitoringColumn = memo(({ lineGroup, data, flowChartData, interval
- {pv?.map((v, idx) => {
- const text = `${v.value?.toFixed(2) ?? '--'} ${v.unit}`
- return (
-
- )
- })}
+
{additionalLabels?.map((label, idx) => (
{
+
+export const SetpointSender = memo(({ onClose, visible, setpointNames }) => {
const [expirePeriod, setExpirePeriod] = useState(defaultPeriod)
const [comment, setComment] = useState('')
const [setpoints, setSetpoints] = useState([])
const [isLoading, setIsLoading] = useState(false)
- const addingColumns = [
+ const idWell = useContext(IdWellContext)
+
+ const addingColumns = useMemo(() => [
{
title: 'Наименование уставки',
dataIndex: 'name',
@@ -33,27 +37,26 @@ export const SetpointSender = ({ idWell, onClose, visible, setpointNames }) => {
render: makeNumericRender(1),
align: 'right'
}
- ]
+ ], [setpointNames])
- const onAdd = async (sp) => setSetpoints((prevSp) => {
+ const onAdd = useCallback(async (sp) => setSetpoints((prevSp) => {
sp.key = Date.now()
- prevSp.push(sp)
- return prevSp
- })
+ return [...prevSp, sp]
+ }), [])
- const onEdit = async (sp) => setSetpoints((prevSp) => {
+ const onEdit = useCallback(async (sp) => setSetpoints((prevSp) => {
const idx = prevSp.findIndex((val) => val.key === sp.key)
prevSp[idx] = sp
- return prevSp
- })
+ return [...prevSp]
+ }), [])
- const onDelete = async (sp) => setSetpoints((prevSp) => {
+ const onDelete = useCallback(async (sp) => setSetpoints((prevSp) => {
const idx = prevSp.findIndex((val) => val.key === sp.key)
prevSp.splice(idx, 1)
- return prevSp
- })
+ return [...prevSp]
+ }), [])
- const onModalOk = () => invokeWebApiWrapperAsync(
+ const onModalOk = useCallback(() => invokeWebApiWrapperAsync(
async () => {
const setpointsObject = setpoints.reduce((obj, sp) => {
obj[sp.name] = sp.value
@@ -66,12 +69,12 @@ export const SetpointSender = ({ idWell, onClose, visible, setpointNames }) => {
comment: comment
}
await SetpointsService.insert(idWell, request)
- onClose(true)
+ await onClose(true)
},
setIsLoading,
`Не удалось отправить уставки по скважине "${idWell}"`,
`Рекомендация новыой уставки`
- )
+ ), [idWell, setpoints, comment, expirePeriod, onClose])
return (
{
onCancel={onClose}
onOk={onModalOk}
okText={'Отправить'}
+ okButtonProps={{ disabled: setpoints.length <= 0 }}
>
@@ -115,4 +119,6 @@ export const SetpointSender = ({ idWell, onClose, visible, setpointNames }) => {
)
-}
+})
+
+export default SetpointSender
diff --git a/src/pages/TelemetryView/SetpointViewer.jsx b/src/pages/Telemetry/TelemetryView/Setpoints/SetpointViewer.jsx
old mode 100644
new mode 100755
similarity index 98%
rename from src/pages/TelemetryView/SetpointViewer.jsx
rename to src/pages/Telemetry/TelemetryView/Setpoints/SetpointViewer.jsx
index 7a0fa75..d22ccf2
--- a/src/pages/TelemetryView/SetpointViewer.jsx
+++ b/src/pages/Telemetry/TelemetryView/Setpoints/SetpointViewer.jsx
@@ -72,3 +72,5 @@ export const SetpointViewer = memo(({ setpoint, visible, onClose, setpointNames
)
})
+
+export default SetpointViewer
diff --git a/src/pages/TelemetryView/Setpoints.jsx b/src/pages/Telemetry/TelemetryView/Setpoints/index.jsx
old mode 100644
new mode 100755
similarity index 82%
rename from src/pages/TelemetryView/Setpoints.jsx
rename to src/pages/Telemetry/TelemetryView/Setpoints/index.jsx
index a74f9e5..7cf4901
--- a/src/pages/TelemetryView/Setpoints.jsx
+++ b/src/pages/Telemetry/TelemetryView/Setpoints/index.jsx
@@ -1,19 +1,20 @@
-import moment from 'moment'
import { Button, Modal } from 'antd'
-import { useState, useEffect } from 'react'
+import { useState, useEffect, memo, useCallback, useMemo, useContext } from 'react'
+import { IdWellContext } from '@asb/context'
import { Table } from '@components/Table'
import { UserView } from '@components/views'
import LoaderPortal from '@components/LoaderPortal'
import { invokeWebApiWrapperAsync } from '@components/factory'
+import { hasPermission } from '@utils/permissions'
import { makeStringCutter } from '@utils/string'
+import { formatDate } from '@utils'
import { SetpointsService } from '@api'
-import { SetpointSender } from './SetpointSender'
+import SetpointSender from './SetpointSender'
import { SetpointViewer, getSetpointStatus } from './SetpointViewer'
-import { hasPermission } from '@asb/utils/permissions'
-export const Setpoints = ({ idWell, ...other }) => {
+export const Setpoints = memo(({ ...other }) => {
const [isModalVisible, setIsModalVisible] = useState(false)
const [isSenderVisible, setIsSenderVisible] = useState(false)
const [isViewerVisible, setIsViewerVisible] = useState(false)
@@ -22,6 +23,8 @@ export const Setpoints = ({ idWell, ...other }) => {
const [selected, setSelected] = useState(null)
const [setpointNames, setSetpointNames] = useState([])
+ const idWell = useContext(IdWellContext)
+
useEffect(() => invokeWebApiWrapperAsync(
async () => {
const names = await SetpointsService.getSetpointsNamesByIdWell(idWell)
@@ -37,21 +40,21 @@ export const Setpoints = ({ idWell, ...other }) => {
'Получение списка имён уставок'
), [idWell])
- const showMore = (id) => {
+ const showMore = useCallback((id) => {
const selected = setpoints.find((sp) => sp.id === id)
setSelected(selected ?? {})
setIsViewerVisible(true)
- }
+ }, [setpoints])
- const historyColumns = [
- { title: 'Дата', dataIndex: 'uploadDate', render: item => moment(item).format('DD MMM YYYY, HH:mm:ss') },
+ const historyColumns = useMemo(() => [
+ { title: 'Дата', dataIndex: 'uploadDate', render: item => formatDate(item) },
{ title: 'Автор', dataIndex: 'author', render: (user) => },
{ title: 'Комментарий', dataIndex: 'comment', render: makeStringCutter() },
{ title: 'Статус', dataIndex: 'idState', render: (id) => getSetpointStatus(parseInt(id)) },
{ dataIndex: 'id', render: (id) => showMore(id)}>Подробнее },
- ]
+ ], [showMore])
- const updateTable = async () => await invokeWebApiWrapperAsync(
+ const updateTable = useCallback(async () => await invokeWebApiWrapperAsync(
async () => {
const setpoints = await SetpointsService.getByIdWell(idWell)
setSetpoints(setpoints)
@@ -59,19 +62,19 @@ export const Setpoints = ({ idWell, ...other }) => {
setIsLoading,
`Не удалось загрузить список для скважины "${idWell}"`,
'Получение списка скважин'
- )
+ ), [idWell])
- const onOpenClick = async () => {
+ const onOpenClick = useCallback(async () => {
await updateTable()
setIsModalVisible(true)
- }
+ }, [updateTable])
- const onSenderClose = (pushed) => {
- if (pushed) updateTable()
+ const onSenderClose = useCallback(async (pushed) => {
+ if (pushed) await updateTable()
setIsSenderVisible(false)
- }
+ }, [updateTable])
- return hasPermission('Setpoints.get') && (
+ return !hasPermission('Setpoints.get') ? null : (
Рекомендованные уставки
@@ -102,7 +105,6 @@ export const Setpoints = ({ idWell, ...other }) => {
{
/>
)
-}
+})
+
+export default Setpoints
diff --git a/src/pages/TelemetryView/UserOfWells.jsx b/src/pages/Telemetry/TelemetryView/UserOfWells.jsx
old mode 100644
new mode 100755
similarity index 100%
rename from src/pages/TelemetryView/UserOfWells.jsx
rename to src/pages/Telemetry/TelemetryView/UserOfWells.jsx
diff --git a/src/pages/Telemetry/TelemetryView/WirelineRunOut.jsx b/src/pages/Telemetry/TelemetryView/WirelineRunOut.jsx
new file mode 100644
index 0000000..a6fc188
--- /dev/null
+++ b/src/pages/Telemetry/TelemetryView/WirelineRunOut.jsx
@@ -0,0 +1,39 @@
+import { memo, useCallback, useContext, useEffect, useState } from 'react'
+
+import { IdWellContext } from '@asb/context'
+import { WirelineView } from '@components/views'
+import { invokeWebApiWrapperAsync } from '@components/factory'
+import { TelemetryWirelineRunOutService } from '@api'
+
+
+export const WirelineRunOut = memo(() => {
+ const [twro, setTwro] = useState({})
+ const [isLoading, setIsLoading] = useState(false)
+
+ const idWell = useContext(IdWellContext)
+
+ const update = useCallback(() => invokeWebApiWrapperAsync(
+ async () => {
+ const twro = await TelemetryWirelineRunOutService.getData(idWell)
+ setTwro(twro)
+ },
+ setIsLoading,
+ 'Не удалось получить данные по талевому канату'
+ ), [idWell])
+
+ const onTooltipVisibleChanged = useCallback((visible) => {
+ if (visible) update()
+ }, [update])
+
+ useEffect(update, [update])
+
+ return (
+
+ )
+})
+
+export default WirelineRunOut
diff --git a/src/pages/TelemetryView/index.jsx b/src/pages/Telemetry/TelemetryView/index.jsx
old mode 100644
new mode 100755
similarity index 95%
rename from src/pages/TelemetryView/index.jsx
rename to src/pages/Telemetry/TelemetryView/index.jsx
index 3a9f28e..2189da5
--- a/src/pages/TelemetryView/index.jsx
+++ b/src/pages/Telemetry/TelemetryView/index.jsx
@@ -1,5 +1,5 @@
import { Select } from 'antd'
-import { useState, useEffect, useCallback } from 'react'
+import { useState, useEffect, useCallback, useContext } from 'react'
import {
DrillFlowChartService,
@@ -8,6 +8,7 @@ import {
TelemetryDataSpinService,
WellService
} from '@api'
+import { IdWellContext } from '@asb/context'
import { makeDateSorter } from '@components/Table'
import LoaderPortal from '@components/LoaderPortal'
import { Grid, GridItem, Flex } from '@components/Grid'
@@ -22,6 +23,7 @@ import ActiveMessagesOnline from './ActiveMessagesOnline'
import { ModeDisplay } from './ModeDisplay'
import { UserOfWell } from './UserOfWells'
import { Setpoints } from './Setpoints'
+import WirelineRunOut from './WirelineRunOut'
import MomentStabPicEnabled from '@images/DempherOn.png'
import MomentStabPicDisabled from '@images/DempherOff.png'
@@ -302,7 +304,7 @@ export const normalizeData = (data) => data?.map(item => ({
blockSpeed: Math.abs(item.blockSpeed)
})) ?? []
-export default function TelemetryView({ idWell }) {
+export default function TelemetryView() {
const [dataSaub, setDataSaub] = useState([])
const [dataSpin, setDataSpin] = useState([])
const [chartInterval, setChartInterval] = useState(defaultPeriod)
@@ -311,6 +313,8 @@ export default function TelemetryView({ idWell }) {
const [flowChartData, setFlowChartData] = useState([])
const [rop, setRop] = useState(null)
+ const idWell = useContext(IdWellContext)
+
const handleDataSaub = useCallback((data) => {
if (data) {
const dataSaub = normalizeData(data)
@@ -322,8 +326,11 @@ export default function TelemetryView({ idWell }) {
const handleDataSpin = useCallback((data) => data && setDataSpin(data), [])
useEffect(() => {
- const unsubscribeSaub = Subscribe('hubs/telemetry', 'ReceiveDataSaub', `well_${idWell}`, handleDataSaub)
- const unsubscribeSpin = Subscribe('hubs/telemetry', 'ReceiveDataSpin', `well_${idWell}`, handleDataSpin)
+ const unsubscribe = Subscribe(
+ 'hubs/telemetry', `well_${idWell}`,
+ { methodName: 'ReceiveDataSaub', handler: handleDataSaub },
+ { methodName: 'ReceiveDataSpin', handler: handleDataSpin }
+ )
invokeWebApiWrapperAsync(
async () => {
const flowChart = await DrillFlowChartService.get(idWell)
@@ -337,10 +344,7 @@ export default function TelemetryView({ idWell }) {
`Не удалось получить данные по скважине "${idWell}"`,
'Получение данных по скважине'
)
- return () => {
- unsubscribeSaub()
- unsubscribeSpin()
- }
+ return unsubscribe
}, [idWell, chartInterval, handleDataSpin, handleDataSaub])
useEffect(() => invokeWebApiWrapperAsync(
@@ -391,8 +395,9 @@ export default function TelemetryView({ idWell }) {
Завершено
-
+
+
MSE
diff --git a/src/pages/Telemetry/index.jsx b/src/pages/Telemetry/index.jsx
new file mode 100755
index 0000000..8207810
--- /dev/null
+++ b/src/pages/Telemetry/index.jsx
@@ -0,0 +1,51 @@
+import { useParams } from 'react-router-dom'
+import { memo, useContext, useMemo } from 'react'
+import { Layout } from 'antd'
+import { AlertOutlined, FundViewOutlined, DatabaseOutlined } from '@ant-design/icons'
+
+import { RootPathContext } from '@asb/context'
+import { PrivateSwitch, PrivateMenu } from '@components/Private'
+
+import Archive from './Archive'
+import Messages from './Messages'
+import DashboardNNB from './DashboardNNB'
+import TelemetryView from './TelemetryView'
+
+import '@styles/index.css'
+import Operations from './Operations'
+
+const { Content } = Layout
+
+export const Telemetry = memo(() => {
+ const { tab } = useParams()
+ const root = useContext(RootPathContext)
+ const rootPath = useMemo(() => `${root}/telemetry`, [root])
+
+ return (
+
+
+
+ } title={'Мониторинг'}/>
+ } title={'Сообщения'} />
+ } title={'Архив'} />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+})
+
+export default Telemetry
diff --git a/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToDay.jsx b/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToDay.jsx
deleted file mode 100644
index 904b966..0000000
--- a/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToDay.jsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { useState, useEffect, memo } from 'react'
-
-import { TelemetryAnalyticsService } from '@api'
-import LoaderPortal from '@components/LoaderPortal'
-import { invokeWebApiWrapperAsync } from '@components/factory'
-import { ChartTelemetryDepthToDay } from '@components/charts/ChartTelemetryDepthToDay'
-
-export const TelemetryAnalysisDepthToDay = memo(({ idWell }) => {
- const [depthData, setDepthData] = useState([])
- const [bitPositionData, setBitPositionData] = useState([])
- const [loader, setLoader] = useState(false)
-
- useEffect(() => invokeWebApiWrapperAsync(
- async () => {
- const depthToDayData = await TelemetryAnalyticsService.getWellDepthToDay(idWell)
-
- const depths = depthToDayData.map(el => ({depth: el.wellDepth, date: el.date}))
- .sort((a, b) => new Date(a.date) - new Date(b.date))
- setDepthData(depths)
-
- const bitPositions = depthToDayData.map(el => ({depth: el.bitDepth, date: el.date}))
- .sort((a, b) => new Date(a.date) - new Date(b.date))
- setBitPositionData(bitPositions)
- },
- setLoader,
- `Не удалось получить данные для анализа Глубина-День по скважине "${idWell}"`,
- 'Получение данных для анализа Глубина-День'
- ), [idWell])
-
- return (
-
-
-
-
-
- )
-})
-
-export default TelemetryAnalysisDepthToDay
diff --git a/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToInterval.jsx b/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToInterval.jsx
deleted file mode 100644
index 989165f..0000000
--- a/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToInterval.jsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import { Select } from 'antd'
-import { useState, useEffect, memo } from 'react'
-
-import { arrayOrDefault } from '@utils'
-import { TelemetryAnalyticsService } from '@api'
-import LoaderPortal from '@components/LoaderPortal'
-import { invokeWebApiWrapperAsync } from '@components/factory'
-import { ChartTelemetryDepthToInterval } from '@components/charts/ChartTelemetryDepthToInterval'
-
-const timePeriodCollection = [
- { value: '3600', label: '1 час' },
- { value: '21600', label: '6 часов' },
- { value: '43200', label: '12 часов' },
- { value: '86400', label: '24 часа' }
-]
-
-export const TelemetryAnalysisDepthToInterval = memo(({ idWell }) => {
- const [depthToIntervalData, setDepthToIntervalData] = useState([])
- const [chartInterval, setChartInterval] = useState(86400)
- const [loader, setLoader] = useState(false)
-
- useEffect(() => invokeWebApiWrapperAsync(
- async () => {
- const depthToIntervalData = await TelemetryAnalyticsService.getWellDepthToInterval(idWell, chartInterval)
- setDepthToIntervalData(arrayOrDefault(depthToIntervalData))
- },
- setLoader,
- `Не удалось получить данные для анализа скорость проходки-интервал "${idWell}"`,
- 'Получение данных для анализа скорость проходки-интервал'
- ), [idWell, chartInterval])
-
- return (
-
-
-
-
-
-
- )
-})
-
-export default TelemetryAnalysisDepthToInterval
diff --git a/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsSummary.jsx b/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsSummary.jsx
deleted file mode 100644
index 9337c78..0000000
--- a/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsSummary.jsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import moment from 'moment'
-import { Form, DatePicker } from 'antd'
-import { useState, useEffect, memo } from 'react'
-
-import { TelemetryAnalyticsService } from '@api'
-import LoaderPortal from '@components/LoaderPortal'
-import { invokeWebApiWrapperAsync } from '@components/factory'
-import { ChartTelemetryOperationsSummary } from '@components/charts/ChartTelemetryOperationsSummary'
-
-const { RangePicker } = DatePicker
-
-export const TelemetryAnalysisOperationsSummary = memo(({ idWell }) => {
- const [avilableDatesRange, setAviableDatesRange] = useState([moment(),moment()])
- const [filterDateRange, setFilterDateRange] = useState([moment().subtract(1, 'days'),moment()])
- const [operationsData, setOperationsData] = useState([])
- const [loader, setLoader] = useState(false)
-
- const disabledDate = (current) => current < avilableDatesRange[0] || current > avilableDatesRange[1]
-
- useEffect(() => invokeWebApiWrapperAsync(
- async() => {
- const datesRange = await TelemetryAnalyticsService.getOperationsDateRange(idWell)
- setAviableDatesRange(datesRange)
- },
- setLoader,
- `Не удалось загрузить диапозон дат для скважины "${idWell}"`,
- 'Получение диапозона дат телеметрии скважины'
- ), [idWell])
-
- useEffect(() => invokeWebApiWrapperAsync(
- async () => {
- const operationsSummaryData = await TelemetryAnalyticsService.getOperationsSummary(idWell,
- filterDateRange[0].toISOString(), filterDateRange[1].toISOString())
-
- setOperationsData(operationsSummaryData)
- },
- setLoader,
- `Не удалось получить данные для анализа операций по скважине "${idWell}"`,
- 'Получение данных для анализа операций по скважине'
- ), [idWell, filterDateRange])
-
- return (
-
-
-
-
- )
-})
-
-export default TelemetryAnalysisOperationsSummary
diff --git a/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsToInterval.jsx b/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsToInterval.jsx
deleted file mode 100644
index e37da57..0000000
--- a/src/pages/TelemetryAnalysis/TelemetryAnalysisOperationsToInterval.jsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import { memo } from 'react'
-
-export const TelemetryAnalysisOperationsToInterval = memo(({ idWell }) => (<>{idWell} 123>))
-
-export default TelemetryAnalysisOperationsToInterval
diff --git a/src/pages/TelemetryAnalysis/index.jsx b/src/pages/TelemetryAnalysis/index.jsx
deleted file mode 100644
index 3c7e8ca..0000000
--- a/src/pages/TelemetryAnalysis/index.jsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import { memo } from 'react'
-import { Layout, Menu } from 'antd'
-import { FolderOutlined } from '@ant-design/icons'
-import { Switch, useParams } from 'react-router-dom'
-
-import { PrivateDefaultRoute, PrivateRoute } from '@components/Private'
-import { PrivateMenuItemLink } from '@components/Private/PrivateMenuItem'
-
-import TelemetryAnalysisDepthToDay from './TelemetryAnalysisDepthToDay'
-import TelemetryAnalysisDepthToInterval from './TelemetryAnalysisDepthToInterval'
-import TelemetryAnalysisOperationsSummary from './TelemetryAnalysisOperationsSummary'
-import TelemetryAnalysisOperationsToInterval from './TelemetryAnalysisOperationsToInterval'
-
-const { Content } = Layout
-
-export const TelemetryAnalysis = memo(({ idWell }) => {
- const { tab } = useParams()
- const rootPath = `/well/${idWell}/telemetryAnalysis`
-
- return (
- <>
-
- } key={'depthToDay'} path={'depthToDay'} title={'Глубина-день'} />
- } key={'depthToInterval'} path={'depthToInterval'} title={'Глубина-интервал'} />
- } key={'operationsSummary'} path={'operationsSummary'} title={'Все операции'} />
- } key={'operationsToInterval'} path={'operationsToInterval'} title={'Операции-интервал'} />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- >
- )
-})
-
-export default TelemetryAnalysis
diff --git a/src/pages/Well.jsx b/src/pages/Well.jsx
old mode 100644
new mode 100755
index 5df9768..b833299
--- a/src/pages/Well.jsx
+++ b/src/pages/Well.jsx
@@ -1,28 +1,24 @@
-import { memo, useMemo } from 'react'
+import { memo, useContext, useMemo } from 'react'
import {
FolderOutlined,
FundViewOutlined,
- AlertOutlined,
FilePdfOutlined,
- DatabaseOutlined,
ExperimentOutlined,
DeploymentUnitOutlined,
} from '@ant-design/icons'
-import { Layout, Menu } from 'antd'
-import { Switch, useParams } from 'react-router-dom'
+import { Layout } from 'antd'
+import { useParams } from 'react-router-dom'
-import { PrivateRoute, PrivateDefaultRoute, PrivateMenuItem } from '@components/Private'
+import { IdWellContext, RootPathContext } from '@asb/context'
+import { PrivateMenu, PrivateSwitch } from '@components/Private'
-import Report from './Report'
-import Archive from './Archive'
import Measure from './Measure'
-import Messages from './Messages'
+import Reports from './Reports'
import Analytics from './Analytics'
import Documents from './Documents'
-import TelemetryView from './TelemetryView'
+import Telemetry from './Telemetry'
import WellOperations from './WellOperations'
import DrillingProgram from './DrillingProgram'
-import TelemetryAnalysis from './TelemetryAnalysis'
import '@styles/index.css'
@@ -30,72 +26,39 @@ const { Content } = Layout
export const Well = memo(() => {
const { idWell, tab } = useParams()
- const rootPath = useMemo(() => `/well/${idWell}`, [idWell])
+ const root = useContext(RootPathContext)
+ const rootPath = useMemo(() => `${root}/well/${idWell}`, [root, idWell])
return (
-
-
- } title={'Мониторинг'}/>
- } title={'Сообщения'} />
- } title={'Рапорт'} />
- } title={'Аналитика'} />
- } title={'Операции по скважине'} />
- } title={'Архив'} />
- {/* } title={'Операции по телеметрии'} /> */}
- } title={'Документы'} />
- } title={'Измерения'} />
- } title={'Программа бурения'} />
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ } title={'Телеметрия'}/>
+ } title={'Рапорта'} />
+ } title={'Аналитика'} />
+ } title={'Операции по скважине'} />
+ } title={'Документы'} />
+ } title={'Измерения'} />
+ } title={'Программа бурения'} />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
)
})
diff --git a/src/pages/WellOperations/DrillProcessFlow.jsx b/src/pages/WellOperations/DrillProcessFlow.jsx
old mode 100644
new mode 100755
index 878d410..0d9865d
--- a/src/pages/WellOperations/DrillProcessFlow.jsx
+++ b/src/pages/WellOperations/DrillProcessFlow.jsx
@@ -1,15 +1,17 @@
-import { useState, useEffect, memo } from 'react'
+import { useState, useEffect, memo, useContext } from 'react'
+import { IdWellContext } from '@asb/context'
import {
EditableTable,
makeNumericMinMax,
makeNumericStartEnd,
} from '@components/Table'
-import { DrillFlowChartService } from '@api'
import LoaderPortal from '@components/LoaderPortal'
import { invokeWebApiWrapperAsync } from '@components/factory'
import { hasPermission } from '@utils/permissions'
import { arrayOrDefault } from '@utils'
+import { DrillFlowChartService } from '@api'
+
const columns = [
makeNumericStartEnd('Глубина, м', 'depth'),
@@ -20,10 +22,12 @@ const columns = [
makeNumericMinMax('Расход, л/с', 'flow')
]
-export const DrillProcessFlow = memo(({ idWell }) => {
+export const DrillProcessFlow = memo(() => {
const [flows, setFlows] = useState([])
const [showLoader, setShowLoader] = useState(false)
+ const idWell = useContext(IdWellContext)
+
const updateFlows = () => invokeWebApiWrapperAsync(
async () => {
const flows = await DrillFlowChartService.get(idWell)
diff --git a/src/pages/WellOperations/ImportExportBar.jsx b/src/pages/WellOperations/ImportExportBar.jsx
old mode 100644
new mode 100755
diff --git a/src/pages/WellOperations/ImportOperations.jsx b/src/pages/WellOperations/ImportOperations.jsx
old mode 100644
new mode 100755
diff --git a/src/pages/WellOperations/Tvd/AdditionalTables.jsx b/src/pages/WellOperations/Tvd/AdditionalTables.jsx
old mode 100644
new mode 100755
index 1889b63..312770d
--- a/src/pages/WellOperations/Tvd/AdditionalTables.jsx
+++ b/src/pages/WellOperations/Tvd/AdditionalTables.jsx
@@ -1,5 +1,5 @@
import { Descriptions } from 'antd'
-import { memo, useEffect, useState } from 'react'
+import { memo, useEffect, useMemo, useState } from 'react'
import { makeNumericRender } from '@components/Table'
import { invokeWebApiWrapperAsync } from '@components/factory'
@@ -21,6 +21,11 @@ const printDate = (date) => formatDate(date) ?? '-'
export const AdditionalTables = memo(({ operations, xLabel, setIsLoading }) => {
const [additionalData, setAdditionalData] = useState({})
+ const nptSum = useMemo(() => operations.fact
+ ?.filter((row) => row.isNPT)
+ .reduce((out, row) => out + (row?.durationHours ?? 0), 0)
+ , [operations.fact])
+
useEffect(() => invokeWebApiWrapperAsync(
async () => {
const [factStartDate, factEndDate] = calcEndDate(operations.fact)
@@ -49,6 +54,7 @@ export const AdditionalTables = memo(({ operations, xLabel, setIsLoading }) => {
- {printDate(additionalData.endDate)}
- {numericRender(additionalData.lag)}
+ - {numericRender(nptSum)}