diff --git a/src/App.tsx b/src/App.tsx index a458a47..05295c2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -19,36 +19,7 @@ const FileDownload = lazy(() => import('@pages/FileDownload')) const AdminPanel = lazy(() => import('@pages/AdminPanel')) const Deposit = lazy(() => import('@pages/Deposit')) const Cluster = lazy(() => import('@pages/Cluster')) -const Well = lazy(() => import('@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')) +const Well = lazy(() => import('@asb/pages/Well')) //OpenAPI.BASE = 'http://localhost:3000' OpenAPI.TOKEN = async () => getUserToken() ?? '' @@ -76,51 +47,7 @@ export const App = memo(() => ( } /> } /> } /> - }> - } /> - } /> - - }> - } /> - } /> - - } /> - } /> - } /> - } /> - } /> - } /> - - }> - } /> - } /> - - } /> - } /> - - }> - } /> - } /> - - } /> - } /> - - }> - } /> - } /> - - } /> - } /> - } /> - } /> - } /> - } /> - - } /> - } /> - } /> - } /> - + } /> diff --git a/src/pages/Cluster/ClusterWells.jsx b/src/pages/Cluster/ClusterWells.jsx index 2a5a4da..8397928 100755 --- a/src/pages/Cluster/ClusterWells.jsx +++ b/src/pages/Cluster/ClusterWells.jsx @@ -1,6 +1,6 @@ import { Link, useLocation } from 'react-router-dom' 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 { @@ -13,7 +13,6 @@ import { makeNumericRender, makeNumericColumn, } from '@components/Table' -import { CompanyView } from '@components/views' import LoaderPortal from '@components/LoaderPortal' import PointerIcon from '@components/icons/PointerIcon' import { invokeWebApiWrapperAsync } from '@components/factory' @@ -25,9 +24,9 @@ import { wrapPrivateComponent } from '@utils' -import Tvd from '@pages/WellOperations/Tvd' -import WellOperationsTable from './WellOperationsTable' +import Tvd from '@pages/Well/WellOperations/Tvd' import CompaniesTable from '@pages/Cluster/CompaniesTable' +import WellOperationsTable from './WellOperationsTable' const filtersMinMax = [ { text: 'min', value: 'min' }, diff --git a/src/pages/Well.jsx b/src/pages/Well.jsx deleted file mode 100755 index a62b87c..0000000 --- a/src/pages/Well.jsx +++ /dev/null @@ -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 ( - - - }> - }> - - - - - - ) -}) - -export default wrapPrivateComponent(Well, { - requirements: [], - title: 'Скважина', - route: 'well/:idWell/*', - key: 'well', -}) diff --git a/src/pages/Analytics/Statistics.jsx b/src/pages/Well/Analytics/Statistics.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Analytics/Statistics.jsx rename to src/pages/Well/Analytics/Statistics.jsx diff --git a/src/pages/Analytics/WellCompositeEditor/NewParamsTable.jsx b/src/pages/Well/Analytics/WellCompositeEditor/NewParamsTable.jsx old mode 100755 new mode 100644 similarity index 97% rename from src/pages/Analytics/WellCompositeEditor/NewParamsTable.jsx rename to src/pages/Well/Analytics/WellCompositeEditor/NewParamsTable.jsx index bf504df..0f0da5b --- a/src/pages/Analytics/WellCompositeEditor/NewParamsTable.jsx +++ b/src/pages/Well/Analytics/WellCompositeEditor/NewParamsTable.jsx @@ -7,7 +7,7 @@ import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { DrillParamsService } from '@api' -import { getColumns } from '@pages/WellOperations/WellDrillParams' +import { getColumns } from '@asb/pages/Well/WellOperations/WellDrillParams' export const NewParamsTable = memo(({ selectedWellsKeys }) => { const [params, setParams] = useState([]) diff --git a/src/pages/Analytics/WellCompositeEditor/WellCompositeSections.jsx b/src/pages/Well/Analytics/WellCompositeEditor/WellCompositeSections.jsx similarity index 99% rename from src/pages/Analytics/WellCompositeEditor/WellCompositeSections.jsx rename to src/pages/Well/Analytics/WellCompositeEditor/WellCompositeSections.jsx index 2a608a5..f9eaaaa 100644 --- a/src/pages/Analytics/WellCompositeEditor/WellCompositeSections.jsx +++ b/src/pages/Well/Analytics/WellCompositeEditor/WellCompositeSections.jsx @@ -16,7 +16,7 @@ import { getOperations } from '@utils' -import Tvd from '@pages/WellOperations/Tvd' +import Tvd from '@asb/pages/Well/WellOperations/Tvd' import WellOperationsTable from '@pages/Cluster/WellOperationsTable' import NewParamsTable from './NewParamsTable' import CompaniesTable from '@pages/Cluster/CompaniesTable' diff --git a/src/pages/Analytics/WellCompositeEditor/index.jsx b/src/pages/Well/Analytics/WellCompositeEditor/index.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Analytics/WellCompositeEditor/index.jsx rename to src/pages/Well/Analytics/WellCompositeEditor/index.jsx diff --git a/src/pages/Analytics/index.jsx b/src/pages/Well/Analytics/index.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Analytics/index.jsx rename to src/pages/Well/Analytics/index.jsx diff --git a/src/pages/Documents/DocumentsTemplate.jsx b/src/pages/Well/Documents/DocumentsTemplate.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Documents/DocumentsTemplate.jsx rename to src/pages/Well/Documents/DocumentsTemplate.jsx diff --git a/src/pages/Documents/index.jsx b/src/pages/Well/Documents/index.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Documents/index.jsx rename to src/pages/Well/Documents/index.jsx diff --git a/src/pages/DrillingProgram/CategoryAdder.jsx b/src/pages/Well/DrillingProgram/CategoryAdder.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/DrillingProgram/CategoryAdder.jsx rename to src/pages/Well/DrillingProgram/CategoryAdder.jsx diff --git a/src/pages/DrillingProgram/CategoryEditor.jsx b/src/pages/Well/DrillingProgram/CategoryEditor.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/DrillingProgram/CategoryEditor.jsx rename to src/pages/Well/DrillingProgram/CategoryEditor.jsx diff --git a/src/pages/DrillingProgram/CategoryHistory.jsx b/src/pages/Well/DrillingProgram/CategoryHistory.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/DrillingProgram/CategoryHistory.jsx rename to src/pages/Well/DrillingProgram/CategoryHistory.jsx diff --git a/src/pages/DrillingProgram/CategoryRender.jsx b/src/pages/Well/DrillingProgram/CategoryRender.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/DrillingProgram/CategoryRender.jsx rename to src/pages/Well/DrillingProgram/CategoryRender.jsx diff --git a/src/pages/DrillingProgram/MarksCard.jsx b/src/pages/Well/DrillingProgram/MarksCard.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/DrillingProgram/MarksCard.jsx rename to src/pages/Well/DrillingProgram/MarksCard.jsx diff --git a/src/pages/DrillingProgram/index.jsx b/src/pages/Well/DrillingProgram/index.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/DrillingProgram/index.jsx rename to src/pages/Well/DrillingProgram/index.jsx diff --git a/src/pages/Measure/InclinometryTable.jsx b/src/pages/Well/Measure/InclinometryTable.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Measure/InclinometryTable.jsx rename to src/pages/Well/Measure/InclinometryTable.jsx diff --git a/src/pages/Measure/MeasureTable.jsx b/src/pages/Well/Measure/MeasureTable.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Measure/MeasureTable.jsx rename to src/pages/Well/Measure/MeasureTable.jsx diff --git a/src/pages/Measure/View.jsx b/src/pages/Well/Measure/View.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Measure/View.jsx rename to src/pages/Well/Measure/View.jsx diff --git a/src/pages/Measure/columnsCommon.jsx b/src/pages/Well/Measure/columnsCommon.jsx similarity index 100% rename from src/pages/Measure/columnsCommon.jsx rename to src/pages/Well/Measure/columnsCommon.jsx diff --git a/src/pages/Measure/drillingFluidData.js b/src/pages/Well/Measure/drillingFluidData.js old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Measure/drillingFluidData.js rename to src/pages/Well/Measure/drillingFluidData.js diff --git a/src/pages/Measure/index.jsx b/src/pages/Well/Measure/index.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Measure/index.jsx rename to src/pages/Well/Measure/index.jsx diff --git a/src/pages/Measure/mudDiagramData.js b/src/pages/Well/Measure/mudDiagramData.js old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Measure/mudDiagramData.js rename to src/pages/Well/Measure/mudDiagramData.js diff --git a/src/pages/Measure/nnbData.js b/src/pages/Well/Measure/nnbData.js old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Measure/nnbData.js rename to src/pages/Well/Measure/nnbData.js diff --git a/src/pages/Reports/DailyReport/ReportEditor.jsx b/src/pages/Well/Reports/DailyReport/ReportEditor.jsx similarity index 100% rename from src/pages/Reports/DailyReport/ReportEditor.jsx rename to src/pages/Well/Reports/DailyReport/ReportEditor.jsx diff --git a/src/pages/Reports/DailyReport/index.jsx b/src/pages/Well/Reports/DailyReport/index.jsx similarity index 100% rename from src/pages/Reports/DailyReport/index.jsx rename to src/pages/Well/Reports/DailyReport/index.jsx diff --git a/src/pages/Reports/DiagramReport/ReportCreationNotify.jsx b/src/pages/Well/Reports/DiagramReport/ReportCreationNotify.jsx similarity index 100% rename from src/pages/Reports/DiagramReport/ReportCreationNotify.jsx rename to src/pages/Well/Reports/DiagramReport/ReportCreationNotify.jsx diff --git a/src/pages/Reports/DiagramReport/Reports.jsx b/src/pages/Well/Reports/DiagramReport/Reports.jsx similarity index 100% rename from src/pages/Reports/DiagramReport/Reports.jsx rename to src/pages/Well/Reports/DiagramReport/Reports.jsx diff --git a/src/pages/Reports/DiagramReport/index.jsx b/src/pages/Well/Reports/DiagramReport/index.jsx similarity index 100% rename from src/pages/Reports/DiagramReport/index.jsx rename to src/pages/Well/Reports/DiagramReport/index.jsx diff --git a/src/pages/Reports/index.jsx b/src/pages/Well/Reports/index.jsx similarity index 100% rename from src/pages/Reports/index.jsx rename to src/pages/Well/Reports/index.jsx diff --git a/src/pages/Telemetry/Archive/index.jsx b/src/pages/Well/Telemetry/Archive/index.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Telemetry/Archive/index.jsx rename to src/pages/Well/Telemetry/Archive/index.jsx diff --git a/src/pages/Telemetry/DashboardNNB/AddGroupWindow.jsx b/src/pages/Well/Telemetry/DashboardNNB/AddGroupWindow.jsx similarity index 100% rename from src/pages/Telemetry/DashboardNNB/AddGroupWindow.jsx rename to src/pages/Well/Telemetry/DashboardNNB/AddGroupWindow.jsx diff --git a/src/pages/Telemetry/DashboardNNB/AddWidgetWindow.jsx b/src/pages/Well/Telemetry/DashboardNNB/AddWidgetWindow.jsx similarity index 100% rename from src/pages/Telemetry/DashboardNNB/AddWidgetWindow.jsx rename to src/pages/Well/Telemetry/DashboardNNB/AddWidgetWindow.jsx diff --git a/src/pages/Telemetry/DashboardNNB/index.jsx b/src/pages/Well/Telemetry/DashboardNNB/index.jsx similarity index 100% rename from src/pages/Telemetry/DashboardNNB/index.jsx rename to src/pages/Well/Telemetry/DashboardNNB/index.jsx diff --git a/src/pages/Telemetry/Messages.jsx b/src/pages/Well/Telemetry/Messages.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Telemetry/Messages.jsx rename to src/pages/Well/Telemetry/Messages.jsx diff --git a/src/pages/Telemetry/OperationTime/index.jsx b/src/pages/Well/Telemetry/OperationTime/index.jsx similarity index 100% rename from src/pages/Telemetry/OperationTime/index.jsx rename to src/pages/Well/Telemetry/OperationTime/index.jsx diff --git a/src/pages/Telemetry/Operations/DrillerList.jsx b/src/pages/Well/Telemetry/Operations/DrillerList.jsx similarity index 100% rename from src/pages/Telemetry/Operations/DrillerList.jsx rename to src/pages/Well/Telemetry/Operations/DrillerList.jsx diff --git a/src/pages/Telemetry/Operations/DrillerSchedule.jsx b/src/pages/Well/Telemetry/Operations/DrillerSchedule.jsx similarity index 100% rename from src/pages/Telemetry/Operations/DrillerSchedule.jsx rename to src/pages/Well/Telemetry/Operations/DrillerSchedule.jsx diff --git a/src/pages/Telemetry/Operations/OperationsChart.jsx b/src/pages/Well/Telemetry/Operations/OperationsChart.jsx similarity index 100% rename from src/pages/Telemetry/Operations/OperationsChart.jsx rename to src/pages/Well/Telemetry/Operations/OperationsChart.jsx diff --git a/src/pages/Telemetry/Operations/OperationsTable.jsx b/src/pages/Well/Telemetry/Operations/OperationsTable.jsx similarity index 100% rename from src/pages/Telemetry/Operations/OperationsTable.jsx rename to src/pages/Well/Telemetry/Operations/OperationsTable.jsx diff --git a/src/pages/Telemetry/Operations/TargetEditor.jsx b/src/pages/Well/Telemetry/Operations/TargetEditor.jsx similarity index 100% rename from src/pages/Telemetry/Operations/TargetEditor.jsx rename to src/pages/Well/Telemetry/Operations/TargetEditor.jsx diff --git a/src/pages/Telemetry/Operations/index.jsx b/src/pages/Well/Telemetry/Operations/index.jsx similarity index 100% rename from src/pages/Telemetry/Operations/index.jsx rename to src/pages/Well/Telemetry/Operations/index.jsx diff --git a/src/pages/Telemetry/TelemetryView/ActiveMessagesOnline.jsx b/src/pages/Well/Telemetry/TelemetryView/ActiveMessagesOnline.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Telemetry/TelemetryView/ActiveMessagesOnline.jsx rename to src/pages/Well/Telemetry/TelemetryView/ActiveMessagesOnline.jsx diff --git a/src/pages/Telemetry/TelemetryView/CustomColumn.jsx b/src/pages/Well/Telemetry/TelemetryView/CustomColumn.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Telemetry/TelemetryView/CustomColumn.jsx rename to src/pages/Well/Telemetry/TelemetryView/CustomColumn.jsx diff --git a/src/pages/Telemetry/TelemetryView/ModeDisplay.jsx b/src/pages/Well/Telemetry/TelemetryView/ModeDisplay.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Telemetry/TelemetryView/ModeDisplay.jsx rename to src/pages/Well/Telemetry/TelemetryView/ModeDisplay.jsx diff --git a/src/pages/Telemetry/TelemetryView/RigMnemo.jsx b/src/pages/Well/Telemetry/TelemetryView/RigMnemo.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Telemetry/TelemetryView/RigMnemo.jsx rename to src/pages/Well/Telemetry/TelemetryView/RigMnemo.jsx diff --git a/src/pages/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx b/src/pages/Well/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx rename to src/pages/Well/Telemetry/TelemetryView/Setpoints/SetpointSender.jsx diff --git a/src/pages/Telemetry/TelemetryView/Setpoints/SetpointViewer.jsx b/src/pages/Well/Telemetry/TelemetryView/Setpoints/SetpointViewer.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Telemetry/TelemetryView/Setpoints/SetpointViewer.jsx rename to src/pages/Well/Telemetry/TelemetryView/Setpoints/SetpointViewer.jsx diff --git a/src/pages/Telemetry/TelemetryView/Setpoints/index.jsx b/src/pages/Well/Telemetry/TelemetryView/Setpoints/index.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Telemetry/TelemetryView/Setpoints/index.jsx rename to src/pages/Well/Telemetry/TelemetryView/Setpoints/index.jsx diff --git a/src/pages/Telemetry/TelemetryView/UserOfWells.jsx b/src/pages/Well/Telemetry/TelemetryView/UserOfWells.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Telemetry/TelemetryView/UserOfWells.jsx rename to src/pages/Well/Telemetry/TelemetryView/UserOfWells.jsx diff --git a/src/pages/Telemetry/TelemetryView/WirelineRunOut.jsx b/src/pages/Well/Telemetry/TelemetryView/WirelineRunOut.jsx similarity index 100% rename from src/pages/Telemetry/TelemetryView/WirelineRunOut.jsx rename to src/pages/Well/Telemetry/TelemetryView/WirelineRunOut.jsx diff --git a/src/pages/Telemetry/TelemetryView/cursorRender.jsx b/src/pages/Well/Telemetry/TelemetryView/cursorRender.jsx similarity index 100% rename from src/pages/Telemetry/TelemetryView/cursorRender.jsx rename to src/pages/Well/Telemetry/TelemetryView/cursorRender.jsx diff --git a/src/pages/Telemetry/TelemetryView/index.jsx b/src/pages/Well/Telemetry/TelemetryView/index.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Telemetry/TelemetryView/index.jsx rename to src/pages/Well/Telemetry/TelemetryView/index.jsx diff --git a/src/pages/Telemetry/index.jsx b/src/pages/Well/Telemetry/index.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/Telemetry/index.jsx rename to src/pages/Well/Telemetry/index.jsx diff --git a/src/pages/WellCase/HistoryTable.jsx b/src/pages/Well/WellCase/HistoryTable.jsx similarity index 100% rename from src/pages/WellCase/HistoryTable.jsx rename to src/pages/Well/WellCase/HistoryTable.jsx diff --git a/src/pages/WellCase/WellCaseEditor.jsx b/src/pages/Well/WellCase/WellCaseEditor.jsx similarity index 100% rename from src/pages/WellCase/WellCaseEditor.jsx rename to src/pages/Well/WellCase/WellCaseEditor.jsx diff --git a/src/pages/WellCase/index.jsx b/src/pages/Well/WellCase/index.jsx similarity index 100% rename from src/pages/WellCase/index.jsx rename to src/pages/Well/WellCase/index.jsx diff --git a/src/pages/WellOperations/DrillProcessFlow.jsx b/src/pages/Well/WellOperations/DrillProcessFlow.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/WellOperations/DrillProcessFlow.jsx rename to src/pages/Well/WellOperations/DrillProcessFlow.jsx diff --git a/src/pages/WellOperations/ImportExportBar.jsx b/src/pages/Well/WellOperations/ImportExportBar.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/WellOperations/ImportExportBar.jsx rename to src/pages/Well/WellOperations/ImportExportBar.jsx diff --git a/src/pages/WellOperations/ImportOperations.jsx b/src/pages/Well/WellOperations/ImportOperations.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/WellOperations/ImportOperations.jsx rename to src/pages/Well/WellOperations/ImportOperations.jsx diff --git a/src/pages/WellOperations/OperationEditor/Fact.jsx b/src/pages/Well/WellOperations/OperationEditor/Fact.jsx similarity index 100% rename from src/pages/WellOperations/OperationEditor/Fact.jsx rename to src/pages/Well/WellOperations/OperationEditor/Fact.jsx diff --git a/src/pages/WellOperations/OperationEditor/Plan.jsx b/src/pages/Well/WellOperations/OperationEditor/Plan.jsx similarity index 100% rename from src/pages/WellOperations/OperationEditor/Plan.jsx rename to src/pages/Well/WellOperations/OperationEditor/Plan.jsx diff --git a/src/pages/WellOperations/OperationEditor/WellOperationsEditor.jsx b/src/pages/Well/WellOperations/OperationEditor/WellOperationsEditor.jsx similarity index 100% rename from src/pages/WellOperations/OperationEditor/WellOperationsEditor.jsx rename to src/pages/Well/WellOperations/OperationEditor/WellOperationsEditor.jsx diff --git a/src/pages/WellOperations/Tvd/AdditionalTables.jsx b/src/pages/Well/WellOperations/Tvd/AdditionalTables.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/WellOperations/Tvd/AdditionalTables.jsx rename to src/pages/Well/WellOperations/Tvd/AdditionalTables.jsx diff --git a/src/pages/WellOperations/Tvd/NetGraphExport.jsx b/src/pages/Well/WellOperations/Tvd/NetGraphExport.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/WellOperations/Tvd/NetGraphExport.jsx rename to src/pages/Well/WellOperations/Tvd/NetGraphExport.jsx diff --git a/src/pages/WellOperations/Tvd/NptTable.jsx b/src/pages/Well/WellOperations/Tvd/NptTable.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/WellOperations/Tvd/NptTable.jsx rename to src/pages/Well/WellOperations/Tvd/NptTable.jsx diff --git a/src/pages/WellOperations/Tvd/StatExport.jsx b/src/pages/Well/WellOperations/Tvd/StatExport.jsx similarity index 100% rename from src/pages/WellOperations/Tvd/StatExport.jsx rename to src/pages/Well/WellOperations/Tvd/StatExport.jsx diff --git a/src/pages/WellOperations/Tvd/TLChart.jsx b/src/pages/Well/WellOperations/Tvd/TLChart.jsx similarity index 98% rename from src/pages/WellOperations/Tvd/TLChart.jsx rename to src/pages/Well/WellOperations/Tvd/TLChart.jsx index b173992..e34ba61 100644 --- a/src/pages/WellOperations/Tvd/TLChart.jsx +++ b/src/pages/Well/WellOperations/Tvd/TLChart.jsx @@ -10,7 +10,7 @@ import { DetectedOperationService } from '@api' import { unique } from '@utils/filters' import { formatDate } from '@utils' -import { makeTooltipRender } from '@pages/Telemetry/Operations/OperationsChart' +import { makeTooltipRender } from '../../Telemetry/Operations/OperationsChart' import { makeGetColor } from '.' import '@styles/d3.less' diff --git a/src/pages/WellOperations/Tvd/TLPie.jsx b/src/pages/Well/WellOperations/Tvd/TLPie.jsx similarity index 100% rename from src/pages/WellOperations/Tvd/TLPie.jsx rename to src/pages/Well/WellOperations/Tvd/TLPie.jsx diff --git a/src/pages/WellOperations/Tvd/index.jsx b/src/pages/Well/WellOperations/Tvd/index.jsx similarity index 100% rename from src/pages/WellOperations/Tvd/index.jsx rename to src/pages/Well/WellOperations/Tvd/index.jsx diff --git a/src/pages/WellOperations/WellDrillParams.jsx b/src/pages/Well/WellOperations/WellDrillParams.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/WellOperations/WellDrillParams.jsx rename to src/pages/Well/WellOperations/WellDrillParams.jsx diff --git a/src/pages/WellOperations/WellSectionsStat.jsx b/src/pages/Well/WellOperations/WellSectionsStat.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/WellOperations/WellSectionsStat.jsx rename to src/pages/Well/WellOperations/WellSectionsStat.jsx diff --git a/src/pages/WellOperations/index.jsx b/src/pages/Well/WellOperations/index.jsx old mode 100755 new mode 100644 similarity index 100% rename from src/pages/WellOperations/index.jsx rename to src/pages/Well/WellOperations/index.jsx diff --git a/src/pages/Well/index.jsx b/src/pages/Well/index.jsx new file mode 100644 index 0000000..d9c3dec --- /dev/null +++ b/src/pages/Well/index.jsx @@ -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 ( + + + }> + }> + + } /> + } /> + + }> + } /> + } /> + + } /> + } /> + } /> + } /> + } /> + } /> + + }> + } /> + } /> + + } /> + } /> + + }> + } /> + } /> + + } /> + } /> + + }> + } /> + } /> + + } /> + } /> + } /> + } /> + } /> + } /> + + } /> + } /> + } /> + } /> + + + + + + ) +}) + +export default wrapPrivateComponent(Well, { + requirements: [], + title: 'Скважина', + route: 'well/:idWell/*', + key: 'well', +})