diff --git a/src/App.tsx b/src/App.tsx index 6b410b0..a458a47 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,6 +9,8 @@ import SuspenseFallback from '@components/SuspenseFallback' import { getUserToken, NoAccessComponent } from '@utils' import { OpenAPI } from '@api' +import '@styles/include/antd_theme.less' +import '@styles/App.less' const Login = lazy(() => import('@pages/public/Login')) const Register = lazy(() => import('@pages/public/Register')) @@ -19,8 +21,34 @@ const Deposit = lazy(() => import('@pages/Deposit')) const Cluster = lazy(() => import('@pages/Cluster')) const Well = lazy(() => import('@pages/Well')) -import '@styles/include/antd_theme.less' -import '@styles/App.less' +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.TOKEN = async () => getUserToken() ?? '' @@ -48,7 +76,51 @@ export const App = memo(() => ( } /> } /> } /> - } /> + }> + } /> + } /> + + }> + } /> + } /> + + } /> + } /> + } /> + } /> + } /> + } /> + + }> + } /> + } /> + + } /> + } /> + + }> + } /> + } /> + + } /> + } /> + + }> + } /> + } /> + + } /> + } /> + } /> + } /> + } /> + } /> + + } /> + } /> + } /> + } /> + diff --git a/src/pages/AdminPanel/Telemetry/index.jsx b/src/pages/AdminPanel/Telemetry/index.jsx index aae4cb9..706e74b 100755 --- a/src/pages/AdminPanel/Telemetry/index.jsx +++ b/src/pages/AdminPanel/Telemetry/index.jsx @@ -1,11 +1,8 @@ import { memo, useMemo } from 'react' -import { Navigate, Route, Routes } from 'react-router-dom' +import { Outlet } from 'react-router-dom' import { RootPathContext, useRootPath } from '@asb/context' -import { NoAccessComponent, wrapPrivateComponent } from '@utils' - -import TelemetryViewer from './TelemetryViewer' -import TelemetryMerger from './TelemetryMerger' +import { wrapPrivateComponent } from '@utils' const Telemetry = memo(() => { const root = useRootPath() @@ -13,12 +10,7 @@ const Telemetry = memo(() => { return ( - - } /> - } /> - } /> - } /> - + ) }) diff --git a/src/pages/AdminPanel/index.jsx b/src/pages/AdminPanel/index.jsx index 34dd64f..33296e6 100755 --- a/src/pages/AdminPanel/index.jsx +++ b/src/pages/AdminPanel/index.jsx @@ -1,21 +1,25 @@ import { Navigate, Route, Routes } from 'react-router-dom' -import { memo, useMemo } from 'react' +import { lazy, memo, Suspense, useMemo } from 'react' import { RootPathContext, useRootPath } from '@asb/context' import { LayoutPortal } from '@components/LayoutPortal' +import SuspenseFallback from '@components/SuspenseFallback' import { NoAccessComponent, wrapPrivateComponent } from '@utils' import AdminNavigationMenu from './AdminNavigationMenu' -import ClusterController from './ClusterController' -import CompanyController from './CompanyController' -import DepositController from './DepositController' -import UserController from './UserController' -import WellController from './WellController' -import RoleController from './RoleController' -import CompanyTypeController from './CompanyTypeController' -import PermissionController from './PermissionController' -import Telemetry from './Telemetry' -import VisitLog from './VisitLog' + +const ClusterController = lazy(() => import('./ClusterController')) +const CompanyController = lazy(() => import('./CompanyController')) +const DepositController = lazy(() => import('./DepositController')) +const UserController = lazy(() => import('./UserController')) +const WellController = lazy(() => import('./WellController')) +const RoleController = lazy(() => import('./RoleController')) +const CompanyTypeController = lazy(() => import('./CompanyTypeController')) +const PermissionController = lazy(() => import('./PermissionController')) +const Telemetry = lazy(() => import('./Telemetry')) +const TelemetryViewer = lazy(() => import('./Telemetry/TelemetryViewer')) +const TelemetryMerger = lazy(() => import('./Telemetry/TelemetryMerger')) +const VisitLog = lazy(() => import('./VisitLog')) const AdminPanel = memo(() => { const root = useRootPath() @@ -24,20 +28,27 @@ const AdminPanel = memo(() => { return ( }> - - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - + }> + + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + }> + } /> + } /> + } /> + } /> + + } /> + + ) diff --git a/src/pages/Analytics/WellCompositeEditor/index.jsx b/src/pages/Analytics/WellCompositeEditor/index.jsx index 2b35e4d..f3a6c4b 100755 --- a/src/pages/Analytics/WellCompositeEditor/index.jsx +++ b/src/pages/Analytics/WellCompositeEditor/index.jsx @@ -1,5 +1,5 @@ import { Navigate, Route, Routes } from 'react-router-dom' -import { useState, useEffect, memo } from 'react' +import { useState, useEffect, memo, Suspense } from 'react' import { Row } from 'antd' import { useWell } from '@asb/context' @@ -11,6 +11,7 @@ import { OperationStatService, WellCompositeService } from '@api' import ClusterWells from '@pages/Cluster/ClusterWells' import WellCompositeSections from './WellCompositeSections' +import SuspenseFallback from '@asb/components/SuspenseFallback' const properties = { requirements: ['OperationStat.get', 'WellComposite.get'], @@ -66,13 +67,15 @@ const WellCompositeEditor = memo(() => { - - } /> - } /> + }> + + } /> + } /> - } /> - } /> - + } /> + } /> + + ) }) diff --git a/src/pages/Analytics/index.jsx b/src/pages/Analytics/index.jsx index df5be22..f610484 100755 --- a/src/pages/Analytics/index.jsx +++ b/src/pages/Analytics/index.jsx @@ -1,11 +1,8 @@ import { memo, useMemo } from 'react' -import { Navigate, Route, Routes } from 'react-router-dom' +import { Outlet } from 'react-router-dom' import { RootPathContext, useRootPath } from '@asb/context' -import { NoAccessComponent, wrapPrivateComponent } from '@utils' - -import Statistics from './Statistics' -import WellCompositeEditor from './WellCompositeEditor' +import { wrapPrivateComponent } from '@utils' const Analytics = memo(() => { const root = useRootPath() @@ -13,13 +10,7 @@ const Analytics = memo(() => { return ( - - } /> - } /> - - } /> - } /> - + ) }) diff --git a/src/pages/Reports/index.jsx b/src/pages/Reports/index.jsx index d6d7d04..a8f581d 100644 --- a/src/pages/Reports/index.jsx +++ b/src/pages/Reports/index.jsx @@ -1,11 +1,8 @@ -import { Navigate, Route, Routes } from 'react-router-dom' +import { Outlet } from 'react-router-dom' import { memo, useMemo } from 'react' import { RootPathContext, useRootPath } from '@asb/context' -import { NoAccessComponent, wrapPrivateComponent } from '@utils' - -import DailyReport from './DailyReport' -import DiagramReport from './DiagramReport' +import { wrapPrivateComponent } from '@utils' const Reports = memo(() => { const root = useRootPath() @@ -13,13 +10,7 @@ const Reports = memo(() => { return ( - - } /> - } /> - - } /> - } /> - + ) }) diff --git a/src/pages/Telemetry/index.jsx b/src/pages/Telemetry/index.jsx index 0420819..e893433 100755 --- a/src/pages/Telemetry/index.jsx +++ b/src/pages/Telemetry/index.jsx @@ -1,16 +1,9 @@ -import { Navigate, Route, Routes } from 'react-router-dom' -import { memo, useMemo } from 'react' import { FundViewOutlined } from '@ant-design/icons' +import { Outlet } from 'react-router-dom' +import { memo, useMemo } from 'react' import { RootPathContext, useRootPath } from '@asb/context' -import { NoAccessComponent, wrapPrivateComponent } from '@utils' - -import Archive from './Archive' -import Messages from './Messages' -import Operations from './Operations' -import DashboardNNB from './DashboardNNB' -import TelemetryView from './TelemetryView' -import OperationTime from './OperationTime' +import { wrapPrivateComponent } from '@utils' import '@styles/index.css' @@ -20,17 +13,7 @@ const Telemetry = memo(() => { return ( - - } /> - } /> - - } /> - } /> - } /> - } /> - } /> - } /> - + ) }) diff --git a/src/pages/Well.jsx b/src/pages/Well.jsx index 6d39efa..a62b87c 100755 --- a/src/pages/Well.jsx +++ b/src/pages/Well.jsx @@ -1,25 +1,17 @@ -import { memo, useCallback, useEffect, useMemo, useState } from 'react' -import { Navigate, Outlet, Route, Routes, useParams } from 'react-router-dom' +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 { NoAccessComponent, wrapPrivateComponent } from '@utils' +import { wrapPrivateComponent } from '@utils' import { WellService } from '@api' -import Measure from './Measure' -import Reports from './Reports' -import WellCase from './WellCase' -import Analytics from './Analytics' -import Documents from './Documents' -import Telemetry from './Telemetry' -import WellOperations from './WellOperations' -import DrillingProgram from './DrillingProgram' import NavigationMenu from './NavigationMenu' import '@styles/index.css' - const Well = memo(() => { const { idWell } = useParams() @@ -54,20 +46,9 @@ const Well = memo(() => { }> - - } /> - } /> - - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - - + }> + + diff --git a/src/pages/WellOperations/OperationEditor/Fact.jsx b/src/pages/WellOperations/OperationEditor/Fact.jsx new file mode 100644 index 0000000..3671de2 --- /dev/null +++ b/src/pages/WellOperations/OperationEditor/Fact.jsx @@ -0,0 +1,14 @@ +import { wrapPrivateComponent } from '@utils' + +import WellOperationsEditor from './WellOperationsEditor' + +export const WellOperationsEditorFact = wrapPrivateComponent( + () => , + { + requirements: [ 'WellOperation.get' ], + title: 'Факт', + route: 'fact', + } +) + +export default WellOperationsEditorFact diff --git a/src/pages/WellOperations/OperationEditor/Plan.jsx b/src/pages/WellOperations/OperationEditor/Plan.jsx new file mode 100644 index 0000000..240a189 --- /dev/null +++ b/src/pages/WellOperations/OperationEditor/Plan.jsx @@ -0,0 +1,14 @@ +import { wrapPrivateComponent } from '@utils' + +import WellOperationsEditor from './WellOperationsEditor' + +export const WellOperationsEditorPlan = wrapPrivateComponent( + () => , + { + requirements: [ 'WellOperation.get' ], + title: 'План', + route: 'plan', + } +) + +export default WellOperationsEditorPlan diff --git a/src/pages/WellOperations/WellOperationsEditor.jsx b/src/pages/WellOperations/OperationEditor/WellOperationsEditor.jsx old mode 100755 new mode 100644 similarity index 91% rename from src/pages/WellOperations/WellOperationsEditor.jsx rename to src/pages/WellOperations/OperationEditor/WellOperationsEditor.jsx index 5ac3cfc..87cb0b5 --- a/src/pages/WellOperations/WellOperationsEditor.jsx +++ b/src/pages/WellOperations/OperationEditor/WellOperationsEditor.jsx @@ -17,7 +17,7 @@ import { } from '@components/Table' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' -import { arrayOrDefault, wrapPrivateComponent } from '@utils' +import { arrayOrDefault } from '@utils' import { WellOperationService } from '@api' const { TextArea } = Input @@ -51,7 +51,7 @@ const generateColumns = (showNpt = false, categories = [], sectionTypes = []) => makeTextColumn('Комментарий', 'comment', null, null, null, { editable: true, input: