forked from ddrilling/asb_cloud_front
* Связанные со скважиной страницы перемещены в общую директорию
* Роутинг в разделе скважины перенесён в главный файл раздела
This commit is contained in:
parent
93e6d2171d
commit
fc8b351b7c
77
src/App.tsx
77
src/App.tsx
@ -19,36 +19,7 @@ const FileDownload = lazy(() => import('@pages/FileDownload'))
|
|||||||
const AdminPanel = lazy(() => import('@pages/AdminPanel'))
|
const AdminPanel = lazy(() => import('@pages/AdminPanel'))
|
||||||
const Deposit = lazy(() => import('@pages/Deposit'))
|
const Deposit = lazy(() => import('@pages/Deposit'))
|
||||||
const Cluster = lazy(() => import('@pages/Cluster'))
|
const Cluster = lazy(() => import('@pages/Cluster'))
|
||||||
const Well = lazy(() => import('@pages/Well'))
|
const Well = lazy(() => import('@asb/pages/Well'))
|
||||||
|
|
||||||
const Measure = lazy(() => import('@pages/Measure'))
|
|
||||||
const Reports = lazy(() => import('@pages/Reports'))
|
|
||||||
const WellCase = lazy(() => import('@pages/WellCase'))
|
|
||||||
const Analytics = lazy(() => import('@pages/Analytics'))
|
|
||||||
const Documents = lazy(() => import('@pages/Documents'))
|
|
||||||
const Telemetry = lazy(() => import('@pages/Telemetry'))
|
|
||||||
const WellOperations = lazy(() => import('@pages/WellOperations'))
|
|
||||||
const DrillingProgram = lazy(() => import('@pages/DrillingProgram'))
|
|
||||||
|
|
||||||
const Tvd = lazy(() => import('@pages/WellOperations/Tvd'))
|
|
||||||
const WellDrillParams = lazy(() => import('@pages/WellOperations/WellDrillParams'))
|
|
||||||
const DrillProcessFlow = lazy(() => import('@pages/WellOperations/DrillProcessFlow'))
|
|
||||||
const WellSectionsStat = lazy(() => import('@pages/WellOperations/WellSectionsStat'))
|
|
||||||
const WellOperationsEditorFact = lazy(() => import('@pages/WellOperations/OperationEditor/Fact'))
|
|
||||||
const WellOperationsEditorPlan = lazy(() => import('@pages/WellOperations/OperationEditor/Plan'))
|
|
||||||
|
|
||||||
const Archive = lazy(() => import('@pages/Telemetry/Archive'))
|
|
||||||
const Messages = lazy(() => import('@pages/Telemetry/Messages'))
|
|
||||||
const Operations = lazy(() => import('@pages/Telemetry/Operations'))
|
|
||||||
const DashboardNNB = lazy(() => import('@pages/Telemetry/DashboardNNB'))
|
|
||||||
const TelemetryView = lazy(() => import('@pages/Telemetry/TelemetryView'))
|
|
||||||
const OperationTime = lazy(() => import('@pages/Telemetry/OperationTime'))
|
|
||||||
|
|
||||||
const DailyReport = lazy(() => import('@pages/Reports/DailyReport'))
|
|
||||||
const DiagramReport = lazy(() => import('@pages/Reports/DiagramReport'))
|
|
||||||
|
|
||||||
const Statistics = lazy(() => import('@pages/Analytics/Statistics'))
|
|
||||||
const WellCompositeEditor = lazy(() => import('@pages/Analytics/WellCompositeEditor'))
|
|
||||||
|
|
||||||
//OpenAPI.BASE = 'http://localhost:3000'
|
//OpenAPI.BASE = 'http://localhost:3000'
|
||||||
OpenAPI.TOKEN = async () => getUserToken() ?? ''
|
OpenAPI.TOKEN = async () => getUserToken() ?? ''
|
||||||
@ -76,51 +47,7 @@ export const App = memo(() => (
|
|||||||
<Route path={'/file_download/:idWell/:idFile/*'} element={<FileDownload />} />
|
<Route path={'/file_download/:idWell/:idFile/*'} element={<FileDownload />} />
|
||||||
<Route path={'/deposit/*'} element={<Deposit />} />
|
<Route path={'/deposit/*'} element={<Deposit />} />
|
||||||
<Route path={'/cluster/:idCluster'} element={<Cluster />} />
|
<Route path={'/cluster/:idCluster'} element={<Cluster />} />
|
||||||
<Route path={'/well/:idWell/*'} element={<Well />}>
|
<Route path={'/well/:idWell/*'} element={<Well />} />
|
||||||
<Route index element={<Navigate to={'telemetry'} replace />} />
|
|
||||||
<Route path={'*'} element={<NoAccessComponent />} />
|
|
||||||
|
|
||||||
<Route path={'telemetry/*'} element={<Telemetry />}>
|
|
||||||
<Route index element={<Navigate to={'telemetry'} replace />} />
|
|
||||||
<Route path={'*'} element={<NoAccessComponent />} />
|
|
||||||
|
|
||||||
<Route path={'telemetry'} element={<TelemetryView />} />
|
|
||||||
<Route path={'messages'} element={<Messages />} />
|
|
||||||
<Route path={'archive'} element={<Archive />} />
|
|
||||||
<Route path={'dashboard_nnb'} element={<DashboardNNB />} />
|
|
||||||
<Route path={'operations'} element={<Operations />} />
|
|
||||||
<Route path={'operation_time'} element={<OperationTime />} />
|
|
||||||
</Route>
|
|
||||||
<Route path={'reports/*'} element={<Reports />}>
|
|
||||||
<Route index element={<Navigate to={'diagram_report'} replace />} />
|
|
||||||
<Route path={'*'} element={<NoAccessComponent />} />
|
|
||||||
|
|
||||||
<Route path={'diagram_report'} element={<DiagramReport />} />
|
|
||||||
<Route path={'daily_report'} element={<DailyReport />} />
|
|
||||||
</Route>
|
|
||||||
<Route path={'analytics/*'} element={<Analytics />}>
|
|
||||||
<Route index element={<Navigate to={'composite'} replace />} />
|
|
||||||
<Route path={'*'} element={<NoAccessComponent />} />
|
|
||||||
|
|
||||||
<Route path={'composite/*'} element={<WellCompositeEditor />} />
|
|
||||||
<Route path={'statistics'} element={<Statistics />} />
|
|
||||||
</Route>
|
|
||||||
<Route path={'operations/*'} element={<WellOperations />}>
|
|
||||||
<Route index element={<Navigate to={'tvd'} replace />} />
|
|
||||||
<Route path={'*'} element={<NoAccessComponent />} />
|
|
||||||
|
|
||||||
<Route path={'tvd'} element={<Tvd />} />
|
|
||||||
<Route path={'sections'} element={<WellSectionsStat />} />
|
|
||||||
<Route path={'plan'} element={<WellOperationsEditorPlan />} />
|
|
||||||
<Route path={'fact'} element={<WellOperationsEditorFact />} />
|
|
||||||
<Route path={'drillProcessFlow'} element={<DrillProcessFlow />} />
|
|
||||||
<Route path={'params'} element={<WellDrillParams />} />
|
|
||||||
</Route>
|
|
||||||
<Route path={'document/*'} element={<Documents />} />
|
|
||||||
<Route path={'measure/*'} element={<Measure />} />
|
|
||||||
<Route path={'drillingProgram'} element={<DrillingProgram />} />
|
|
||||||
<Route path={'well_case'} element={<WellCase />} />
|
|
||||||
</Route>
|
|
||||||
</Route>
|
</Route>
|
||||||
</Routes>
|
</Routes>
|
||||||
</Router>
|
</Router>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Link, useLocation } from 'react-router-dom'
|
import { Link, useLocation } from 'react-router-dom'
|
||||||
import { useState, useEffect, memo, useMemo } from 'react'
|
import { useState, useEffect, memo, useMemo } from 'react'
|
||||||
import { Tag, Button, Modal } from 'antd'
|
import { Button, Modal } from 'antd'
|
||||||
import { LineChartOutlined, ProfileOutlined, TeamOutlined } from '@ant-design/icons'
|
import { LineChartOutlined, ProfileOutlined, TeamOutlined } from '@ant-design/icons'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -13,7 +13,6 @@ import {
|
|||||||
makeNumericRender,
|
makeNumericRender,
|
||||||
makeNumericColumn,
|
makeNumericColumn,
|
||||||
} from '@components/Table'
|
} from '@components/Table'
|
||||||
import { CompanyView } from '@components/views'
|
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import PointerIcon from '@components/icons/PointerIcon'
|
import PointerIcon from '@components/icons/PointerIcon'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
@ -25,9 +24,9 @@ import {
|
|||||||
wrapPrivateComponent
|
wrapPrivateComponent
|
||||||
} from '@utils'
|
} from '@utils'
|
||||||
|
|
||||||
import Tvd from '@pages/WellOperations/Tvd'
|
import Tvd from '@pages/Well/WellOperations/Tvd'
|
||||||
import WellOperationsTable from './WellOperationsTable'
|
|
||||||
import CompaniesTable from '@pages/Cluster/CompaniesTable'
|
import CompaniesTable from '@pages/Cluster/CompaniesTable'
|
||||||
|
import WellOperationsTable from './WellOperationsTable'
|
||||||
|
|
||||||
const filtersMinMax = [
|
const filtersMinMax = [
|
||||||
{ text: 'min', value: 'min' },
|
{ text: 'min', value: 'min' },
|
||||||
|
@ -1,63 +0,0 @@
|
|||||||
import { memo, Suspense, useCallback, useEffect, useMemo, useState } from 'react'
|
|
||||||
import { Outlet, useParams } from 'react-router-dom'
|
|
||||||
|
|
||||||
import { WellContext, RootPathContext, useRootPath } from '@asb/context'
|
|
||||||
import { LayoutPortal } from '@components/LayoutPortal'
|
|
||||||
import SuspenseFallback from '@components/SuspenseFallback'
|
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
|
||||||
import { wrapPrivateComponent } from '@utils'
|
|
||||||
import { WellService } from '@api'
|
|
||||||
|
|
||||||
import NavigationMenu from './NavigationMenu'
|
|
||||||
|
|
||||||
import '@styles/index.css'
|
|
||||||
|
|
||||||
const Well = memo(() => {
|
|
||||||
const { idWell } = useParams()
|
|
||||||
|
|
||||||
const [well, setWell] = useState({ id: idWell })
|
|
||||||
|
|
||||||
const root = useRootPath()
|
|
||||||
const rootPath = useMemo(() => `${root}/well/${idWell}`, [root, idWell])
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
invokeWebApiWrapperAsync(
|
|
||||||
async () => {
|
|
||||||
const well = await WellService.get(idWell)
|
|
||||||
setWell(well ?? { id: idWell })
|
|
||||||
},
|
|
||||||
undefined,
|
|
||||||
'Не удалось получить данные по скважине'
|
|
||||||
)
|
|
||||||
}, [idWell])
|
|
||||||
|
|
||||||
const updateWell = useCallback((data) => invokeWebApiWrapperAsync(
|
|
||||||
async () => {
|
|
||||||
const newWell = { ...well, ...data }
|
|
||||||
await WellService.updateWell(newWell)
|
|
||||||
setWell(newWell)
|
|
||||||
},
|
|
||||||
undefined,
|
|
||||||
`Не удалось изменить данные скважины`,
|
|
||||||
{ actionName: 'Изменение данных скважины', well }
|
|
||||||
), [well])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<RootPathContext.Provider value={rootPath}>
|
|
||||||
<WellContext.Provider value={[well, updateWell]}>
|
|
||||||
<LayoutPortal sider={<NavigationMenu />}>
|
|
||||||
<Suspense fallback={<SuspenseFallback style={{ minHeight: '100%' }} />}>
|
|
||||||
<Outlet />
|
|
||||||
</Suspense>
|
|
||||||
</LayoutPortal>
|
|
||||||
</WellContext.Provider>
|
|
||||||
</RootPathContext.Provider>
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
export default wrapPrivateComponent(Well, {
|
|
||||||
requirements: [],
|
|
||||||
title: 'Скважина',
|
|
||||||
route: 'well/:idWell/*',
|
|
||||||
key: 'well',
|
|
||||||
})
|
|
0
src/pages/Analytics/Statistics.jsx → src/pages/Well/Analytics/Statistics.jsx
Executable file → Normal file
0
src/pages/Analytics/Statistics.jsx → src/pages/Well/Analytics/Statistics.jsx
Executable file → Normal file
2
src/pages/Analytics/WellCompositeEditor/NewParamsTable.jsx → src/pages/Well/Analytics/WellCompositeEditor/NewParamsTable.jsx
Executable file → Normal file
2
src/pages/Analytics/WellCompositeEditor/NewParamsTable.jsx → src/pages/Well/Analytics/WellCompositeEditor/NewParamsTable.jsx
Executable file → Normal file
@ -7,7 +7,7 @@ import LoaderPortal from '@components/LoaderPortal'
|
|||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
import { DrillParamsService } from '@api'
|
import { DrillParamsService } from '@api'
|
||||||
|
|
||||||
import { getColumns } from '@pages/WellOperations/WellDrillParams'
|
import { getColumns } from '@asb/pages/Well/WellOperations/WellDrillParams'
|
||||||
|
|
||||||
export const NewParamsTable = memo(({ selectedWellsKeys }) => {
|
export const NewParamsTable = memo(({ selectedWellsKeys }) => {
|
||||||
const [params, setParams] = useState([])
|
const [params, setParams] = useState([])
|
@ -16,7 +16,7 @@ import {
|
|||||||
getOperations
|
getOperations
|
||||||
} from '@utils'
|
} from '@utils'
|
||||||
|
|
||||||
import Tvd from '@pages/WellOperations/Tvd'
|
import Tvd from '@asb/pages/Well/WellOperations/Tvd'
|
||||||
import WellOperationsTable from '@pages/Cluster/WellOperationsTable'
|
import WellOperationsTable from '@pages/Cluster/WellOperationsTable'
|
||||||
import NewParamsTable from './NewParamsTable'
|
import NewParamsTable from './NewParamsTable'
|
||||||
import CompaniesTable from '@pages/Cluster/CompaniesTable'
|
import CompaniesTable from '@pages/Cluster/CompaniesTable'
|
0
src/pages/Analytics/WellCompositeEditor/index.jsx → src/pages/Well/Analytics/WellCompositeEditor/index.jsx
Executable file → Normal file
0
src/pages/Analytics/WellCompositeEditor/index.jsx → src/pages/Well/Analytics/WellCompositeEditor/index.jsx
Executable file → Normal file
0
src/pages/Analytics/index.jsx → src/pages/Well/Analytics/index.jsx
Executable file → Normal file
0
src/pages/Analytics/index.jsx → src/pages/Well/Analytics/index.jsx
Executable file → Normal file
0
src/pages/Documents/DocumentsTemplate.jsx → src/pages/Well/Documents/DocumentsTemplate.jsx
Executable file → Normal file
0
src/pages/Documents/DocumentsTemplate.jsx → src/pages/Well/Documents/DocumentsTemplate.jsx
Executable file → Normal file
0
src/pages/Documents/index.jsx → src/pages/Well/Documents/index.jsx
Executable file → Normal file
0
src/pages/Documents/index.jsx → src/pages/Well/Documents/index.jsx
Executable file → Normal file
0
src/pages/DrillingProgram/CategoryAdder.jsx → src/pages/Well/DrillingProgram/CategoryAdder.jsx
Executable file → Normal file
0
src/pages/DrillingProgram/CategoryAdder.jsx → src/pages/Well/DrillingProgram/CategoryAdder.jsx
Executable file → Normal file
0
src/pages/DrillingProgram/CategoryEditor.jsx → src/pages/Well/DrillingProgram/CategoryEditor.jsx
Executable file → Normal file
0
src/pages/DrillingProgram/CategoryEditor.jsx → src/pages/Well/DrillingProgram/CategoryEditor.jsx
Executable file → Normal file
0
src/pages/DrillingProgram/CategoryHistory.jsx → src/pages/Well/DrillingProgram/CategoryHistory.jsx
Executable file → Normal file
0
src/pages/DrillingProgram/CategoryHistory.jsx → src/pages/Well/DrillingProgram/CategoryHistory.jsx
Executable file → Normal file
0
src/pages/DrillingProgram/CategoryRender.jsx → src/pages/Well/DrillingProgram/CategoryRender.jsx
Executable file → Normal file
0
src/pages/DrillingProgram/CategoryRender.jsx → src/pages/Well/DrillingProgram/CategoryRender.jsx
Executable file → Normal file
0
src/pages/DrillingProgram/MarksCard.jsx → src/pages/Well/DrillingProgram/MarksCard.jsx
Executable file → Normal file
0
src/pages/DrillingProgram/MarksCard.jsx → src/pages/Well/DrillingProgram/MarksCard.jsx
Executable file → Normal file
0
src/pages/DrillingProgram/index.jsx → src/pages/Well/DrillingProgram/index.jsx
Executable file → Normal file
0
src/pages/DrillingProgram/index.jsx → src/pages/Well/DrillingProgram/index.jsx
Executable file → Normal file
0
src/pages/Measure/InclinometryTable.jsx → src/pages/Well/Measure/InclinometryTable.jsx
Executable file → Normal file
0
src/pages/Measure/InclinometryTable.jsx → src/pages/Well/Measure/InclinometryTable.jsx
Executable file → Normal file
0
src/pages/Measure/MeasureTable.jsx → src/pages/Well/Measure/MeasureTable.jsx
Executable file → Normal file
0
src/pages/Measure/MeasureTable.jsx → src/pages/Well/Measure/MeasureTable.jsx
Executable file → Normal file
0
src/pages/Measure/View.jsx → src/pages/Well/Measure/View.jsx
Executable file → Normal file
0
src/pages/Measure/View.jsx → src/pages/Well/Measure/View.jsx
Executable file → Normal file
0
src/pages/Measure/drillingFluidData.js → src/pages/Well/Measure/drillingFluidData.js
Executable file → Normal file
0
src/pages/Measure/drillingFluidData.js → src/pages/Well/Measure/drillingFluidData.js
Executable file → Normal file
0
src/pages/Measure/index.jsx → src/pages/Well/Measure/index.jsx
Executable file → Normal file
0
src/pages/Measure/index.jsx → src/pages/Well/Measure/index.jsx
Executable file → Normal file
0
src/pages/Measure/mudDiagramData.js → src/pages/Well/Measure/mudDiagramData.js
Executable file → Normal file
0
src/pages/Measure/mudDiagramData.js → src/pages/Well/Measure/mudDiagramData.js
Executable file → Normal file
0
src/pages/Measure/nnbData.js → src/pages/Well/Measure/nnbData.js
Executable file → Normal file
0
src/pages/Measure/nnbData.js → src/pages/Well/Measure/nnbData.js
Executable file → Normal file
0
src/pages/Telemetry/Archive/index.jsx → src/pages/Well/Telemetry/Archive/index.jsx
Executable file → Normal file
0
src/pages/Telemetry/Archive/index.jsx → src/pages/Well/Telemetry/Archive/index.jsx
Executable file → Normal file
0
src/pages/Telemetry/Messages.jsx → src/pages/Well/Telemetry/Messages.jsx
Executable file → Normal file
0
src/pages/Telemetry/Messages.jsx → src/pages/Well/Telemetry/Messages.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/ActiveMessagesOnline.jsx → src/pages/Well/Telemetry/TelemetryView/ActiveMessagesOnline.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/ActiveMessagesOnline.jsx → src/pages/Well/Telemetry/TelemetryView/ActiveMessagesOnline.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/CustomColumn.jsx → src/pages/Well/Telemetry/TelemetryView/CustomColumn.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/CustomColumn.jsx → src/pages/Well/Telemetry/TelemetryView/CustomColumn.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/ModeDisplay.jsx → src/pages/Well/Telemetry/TelemetryView/ModeDisplay.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/ModeDisplay.jsx → src/pages/Well/Telemetry/TelemetryView/ModeDisplay.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/RigMnemo.jsx → src/pages/Well/Telemetry/TelemetryView/RigMnemo.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/RigMnemo.jsx → src/pages/Well/Telemetry/TelemetryView/RigMnemo.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/Setpoints/index.jsx → src/pages/Well/Telemetry/TelemetryView/Setpoints/index.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/Setpoints/index.jsx → src/pages/Well/Telemetry/TelemetryView/Setpoints/index.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/UserOfWells.jsx → src/pages/Well/Telemetry/TelemetryView/UserOfWells.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/UserOfWells.jsx → src/pages/Well/Telemetry/TelemetryView/UserOfWells.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/index.jsx → src/pages/Well/Telemetry/TelemetryView/index.jsx
Executable file → Normal file
0
src/pages/Telemetry/TelemetryView/index.jsx → src/pages/Well/Telemetry/TelemetryView/index.jsx
Executable file → Normal file
0
src/pages/Telemetry/index.jsx → src/pages/Well/Telemetry/index.jsx
Executable file → Normal file
0
src/pages/Telemetry/index.jsx → src/pages/Well/Telemetry/index.jsx
Executable file → Normal file
0
src/pages/WellOperations/DrillProcessFlow.jsx → src/pages/Well/WellOperations/DrillProcessFlow.jsx
Executable file → Normal file
0
src/pages/WellOperations/DrillProcessFlow.jsx → src/pages/Well/WellOperations/DrillProcessFlow.jsx
Executable file → Normal file
0
src/pages/WellOperations/ImportExportBar.jsx → src/pages/Well/WellOperations/ImportExportBar.jsx
Executable file → Normal file
0
src/pages/WellOperations/ImportExportBar.jsx → src/pages/Well/WellOperations/ImportExportBar.jsx
Executable file → Normal file
0
src/pages/WellOperations/ImportOperations.jsx → src/pages/Well/WellOperations/ImportOperations.jsx
Executable file → Normal file
0
src/pages/WellOperations/ImportOperations.jsx → src/pages/Well/WellOperations/ImportOperations.jsx
Executable file → Normal file
0
src/pages/WellOperations/Tvd/AdditionalTables.jsx → src/pages/Well/WellOperations/Tvd/AdditionalTables.jsx
Executable file → Normal file
0
src/pages/WellOperations/Tvd/AdditionalTables.jsx → src/pages/Well/WellOperations/Tvd/AdditionalTables.jsx
Executable file → Normal file
0
src/pages/WellOperations/Tvd/NetGraphExport.jsx → src/pages/Well/WellOperations/Tvd/NetGraphExport.jsx
Executable file → Normal file
0
src/pages/WellOperations/Tvd/NetGraphExport.jsx → src/pages/Well/WellOperations/Tvd/NetGraphExport.jsx
Executable file → Normal file
0
src/pages/WellOperations/Tvd/NptTable.jsx → src/pages/Well/WellOperations/Tvd/NptTable.jsx
Executable file → Normal file
0
src/pages/WellOperations/Tvd/NptTable.jsx → src/pages/Well/WellOperations/Tvd/NptTable.jsx
Executable file → Normal file
@ -10,7 +10,7 @@ import { DetectedOperationService } from '@api'
|
|||||||
import { unique } from '@utils/filters'
|
import { unique } from '@utils/filters'
|
||||||
import { formatDate } from '@utils'
|
import { formatDate } from '@utils'
|
||||||
|
|
||||||
import { makeTooltipRender } from '@pages/Telemetry/Operations/OperationsChart'
|
import { makeTooltipRender } from '../../Telemetry/Operations/OperationsChart'
|
||||||
import { makeGetColor } from '.'
|
import { makeGetColor } from '.'
|
||||||
|
|
||||||
import '@styles/d3.less'
|
import '@styles/d3.less'
|
0
src/pages/WellOperations/WellDrillParams.jsx → src/pages/Well/WellOperations/WellDrillParams.jsx
Executable file → Normal file
0
src/pages/WellOperations/WellDrillParams.jsx → src/pages/Well/WellOperations/WellDrillParams.jsx
Executable file → Normal file
0
src/pages/WellOperations/WellSectionsStat.jsx → src/pages/Well/WellOperations/WellSectionsStat.jsx
Executable file → Normal file
0
src/pages/WellOperations/WellSectionsStat.jsx → src/pages/Well/WellOperations/WellSectionsStat.jsx
Executable file → Normal file
0
src/pages/WellOperations/index.jsx → src/pages/Well/WellOperations/index.jsx
Executable file → Normal file
0
src/pages/WellOperations/index.jsx → src/pages/Well/WellOperations/index.jsx
Executable file → Normal file
136
src/pages/Well/index.jsx
Normal file
136
src/pages/Well/index.jsx
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
import { lazy, memo, Suspense, useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
|
import { Navigate, Route, Routes, useParams } from 'react-router-dom'
|
||||||
|
|
||||||
|
import { WellContext, RootPathContext, useRootPath } from '@asb/context'
|
||||||
|
import { LayoutPortal } from '@components/LayoutPortal'
|
||||||
|
import SuspenseFallback from '@components/SuspenseFallback'
|
||||||
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
|
import { NoAccessComponent, wrapPrivateComponent } from '@utils'
|
||||||
|
import { WellService } from '@api'
|
||||||
|
|
||||||
|
import NavigationMenu from '../NavigationMenu'
|
||||||
|
|
||||||
|
import '@styles/index.css'
|
||||||
|
|
||||||
|
const Measure = lazy(() => import('./Measure'))
|
||||||
|
const Reports = lazy(() => import('./Reports'))
|
||||||
|
const WellCase = lazy(() => import('./WellCase'))
|
||||||
|
const Analytics = lazy(() => import('./Analytics'))
|
||||||
|
const Documents = lazy(() => import('./Documents'))
|
||||||
|
const Telemetry = lazy(() => import('./Telemetry'))
|
||||||
|
const WellOperations = lazy(() => import('./WellOperations'))
|
||||||
|
const DrillingProgram = lazy(() => import('./DrillingProgram'))
|
||||||
|
|
||||||
|
const Tvd = lazy(() => import('./WellOperations/Tvd'))
|
||||||
|
const WellDrillParams = lazy(() => import('./WellOperations/WellDrillParams'))
|
||||||
|
const DrillProcessFlow = lazy(() => import('./WellOperations/DrillProcessFlow'))
|
||||||
|
const WellSectionsStat = lazy(() => import('./WellOperations/WellSectionsStat'))
|
||||||
|
const WellOperationsEditorFact = lazy(() => import('./WellOperations/OperationEditor/Fact'))
|
||||||
|
const WellOperationsEditorPlan = lazy(() => import('./WellOperations/OperationEditor/Plan'))
|
||||||
|
|
||||||
|
const Archive = lazy(() => import('./Telemetry/Archive'))
|
||||||
|
const Messages = lazy(() => import('./Telemetry/Messages'))
|
||||||
|
const Operations = lazy(() => import('./Telemetry/Operations'))
|
||||||
|
const DashboardNNB = lazy(() => import('./Telemetry/DashboardNNB'))
|
||||||
|
const TelemetryView = lazy(() => import('./Telemetry/TelemetryView'))
|
||||||
|
const OperationTime = lazy(() => import('./Telemetry/OperationTime'))
|
||||||
|
|
||||||
|
const DailyReport = lazy(() => import('./Reports/DailyReport'))
|
||||||
|
const DiagramReport = lazy(() => import('./Reports/DiagramReport'))
|
||||||
|
|
||||||
|
const Statistics = lazy(() => import('./Analytics/Statistics'))
|
||||||
|
const WellCompositeEditor = lazy(() => import('./Analytics/WellCompositeEditor'))
|
||||||
|
|
||||||
|
const Well = memo(() => {
|
||||||
|
const { idWell } = useParams()
|
||||||
|
|
||||||
|
const [well, setWell] = useState({ id: idWell })
|
||||||
|
|
||||||
|
const root = useRootPath()
|
||||||
|
const rootPath = useMemo(() => `${root}/well/${idWell}`, [root, idWell])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
invokeWebApiWrapperAsync(
|
||||||
|
async () => {
|
||||||
|
const well = await WellService.get(idWell)
|
||||||
|
setWell(well ?? { id: idWell })
|
||||||
|
},
|
||||||
|
undefined,
|
||||||
|
'Не удалось получить данные по скважине'
|
||||||
|
)
|
||||||
|
}, [idWell])
|
||||||
|
|
||||||
|
const updateWell = useCallback((data) => invokeWebApiWrapperAsync(
|
||||||
|
async () => {
|
||||||
|
const newWell = { ...well, ...data }
|
||||||
|
await WellService.updateWell(newWell)
|
||||||
|
setWell(newWell)
|
||||||
|
},
|
||||||
|
undefined,
|
||||||
|
`Не удалось изменить данные скважины`,
|
||||||
|
{ actionName: 'Изменение данных скважины', well }
|
||||||
|
), [well])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<RootPathContext.Provider value={rootPath}>
|
||||||
|
<WellContext.Provider value={[well, updateWell]}>
|
||||||
|
<LayoutPortal sider={<NavigationMenu />}>
|
||||||
|
<Suspense fallback={<SuspenseFallback style={{ minHeight: '100%' }} />}>
|
||||||
|
<Routes>
|
||||||
|
<Route index element={<Navigate to={'telemetry'} replace />} />
|
||||||
|
<Route path={'*'} element={<NoAccessComponent />} />
|
||||||
|
|
||||||
|
<Route path={'telemetry/*'} element={<Telemetry />}>
|
||||||
|
<Route index element={<Navigate to={'telemetry'} replace />} />
|
||||||
|
<Route path={'*'} element={<NoAccessComponent />} />
|
||||||
|
|
||||||
|
<Route path={'telemetry'} element={<TelemetryView />} />
|
||||||
|
<Route path={'messages'} element={<Messages />} />
|
||||||
|
<Route path={'archive'} element={<Archive />} />
|
||||||
|
<Route path={'dashboard_nnb'} element={<DashboardNNB />} />
|
||||||
|
<Route path={'operations'} element={<Operations />} />
|
||||||
|
<Route path={'operation_time'} element={<OperationTime />} />
|
||||||
|
</Route>
|
||||||
|
<Route path={'reports/*'} element={<Reports />}>
|
||||||
|
<Route index element={<Navigate to={'diagram_report'} replace />} />
|
||||||
|
<Route path={'*'} element={<NoAccessComponent />} />
|
||||||
|
|
||||||
|
<Route path={'diagram_report'} element={<DiagramReport />} />
|
||||||
|
<Route path={'daily_report'} element={<DailyReport />} />
|
||||||
|
</Route>
|
||||||
|
<Route path={'analytics/*'} element={<Analytics />}>
|
||||||
|
<Route index element={<Navigate to={'composite'} replace />} />
|
||||||
|
<Route path={'*'} element={<NoAccessComponent />} />
|
||||||
|
|
||||||
|
<Route path={'composite/*'} element={<WellCompositeEditor />} />
|
||||||
|
<Route path={'statistics'} element={<Statistics />} />
|
||||||
|
</Route>
|
||||||
|
<Route path={'operations/*'} element={<WellOperations />}>
|
||||||
|
<Route index element={<Navigate to={'tvd'} replace />} />
|
||||||
|
<Route path={'*'} element={<NoAccessComponent />} />
|
||||||
|
|
||||||
|
<Route path={'tvd'} element={<Tvd />} />
|
||||||
|
<Route path={'sections'} element={<WellSectionsStat />} />
|
||||||
|
<Route path={'plan'} element={<WellOperationsEditorPlan />} />
|
||||||
|
<Route path={'fact'} element={<WellOperationsEditorFact />} />
|
||||||
|
<Route path={'drillProcessFlow'} element={<DrillProcessFlow />} />
|
||||||
|
<Route path={'params'} element={<WellDrillParams />} />
|
||||||
|
</Route>
|
||||||
|
<Route path={'document/*'} element={<Documents />} />
|
||||||
|
<Route path={'measure/*'} element={<Measure />} />
|
||||||
|
<Route path={'drillingProgram'} element={<DrillingProgram />} />
|
||||||
|
<Route path={'well_case'} element={<WellCase />} />
|
||||||
|
</Routes>
|
||||||
|
</Suspense>
|
||||||
|
</LayoutPortal>
|
||||||
|
</WellContext.Provider>
|
||||||
|
</RootPathContext.Provider>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
export default wrapPrivateComponent(Well, {
|
||||||
|
requirements: [],
|
||||||
|
title: 'Скважина',
|
||||||
|
route: 'well/:idWell/*',
|
||||||
|
key: 'well',
|
||||||
|
})
|
Loading…
Reference in New Issue
Block a user