forked from ddrilling/asb_cloud_front
Контексты выделены в отдельный файл
This commit is contained in:
parent
ec5b5e427b
commit
d91815ebf2
@ -3,8 +3,8 @@ import { Menu, MenuItemProps, MenuProps } from 'antd'
|
|||||||
import { Children, cloneElement, memo, ReactElement, useContext, useMemo } from 'react'
|
import { Children, cloneElement, memo, ReactElement, useContext, useMemo } from 'react'
|
||||||
import { Link, useLocation } from 'react-router-dom'
|
import { Link, useLocation } from 'react-router-dom'
|
||||||
|
|
||||||
|
import { RootPathContext } from '@asb/context'
|
||||||
import { isURLAvailable } from '@utils/permissions'
|
import { isURLAvailable } from '@utils/permissions'
|
||||||
import { RootPathContext } from '@pages/Main'
|
|
||||||
|
|
||||||
export type PrivateMenuProps = MenuProps & { root?: string }
|
export type PrivateMenuProps = MenuProps & { root?: string }
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { Location } from 'history'
|
import { Location } from 'history'
|
||||||
import { Children, cloneElement, memo, ReactElement, ReactNode, useCallback, useContext, useMemo } from 'react'
|
import { Children, cloneElement, memo, ReactElement, ReactNode, useCallback, useContext, useMemo } from 'react'
|
||||||
|
|
||||||
import { Redirect, Route, Switch, SwitchProps, useLocation } from 'react-router-dom'
|
import { Redirect, Route, Switch, SwitchProps, useLocation } from 'react-router-dom'
|
||||||
|
|
||||||
|
import { RootPathContext } from '@asb/context'
|
||||||
import { isURLAvailable } from '@utils/permissions'
|
import { isURLAvailable } from '@utils/permissions'
|
||||||
import { getUserId } from '@utils/storage'
|
import { getUserId } from '@utils/storage'
|
||||||
|
|
||||||
import { RootPathContext } from '@pages/Main'
|
|
||||||
|
|
||||||
export type PrivateSwitchProps = SwitchProps & {
|
export type PrivateSwitchProps = SwitchProps & {
|
||||||
root?: string
|
root?: string
|
||||||
|
4
src/context.ts
Normal file
4
src/context.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import { createContext } from 'react'
|
||||||
|
|
||||||
|
export const IdWellContext = createContext<number | null>(null)
|
||||||
|
export const RootPathContext = createContext<string>('')
|
@ -2,10 +2,10 @@ import { Layout } from 'antd'
|
|||||||
import { lazy, memo, Suspense, useContext, useMemo } from 'react'
|
import { lazy, memo, Suspense, useContext, useMemo } from 'react'
|
||||||
import { useParams } from 'react-router-dom'
|
import { useParams } from 'react-router-dom'
|
||||||
|
|
||||||
|
import { RootPathContext } from '@asb/context'
|
||||||
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
||||||
|
|
||||||
import { SuspenseFallback } from '@pages/SuspenseFallback'
|
import { SuspenseFallback } from '@pages/SuspenseFallback'
|
||||||
import { RootPathContext } from '@pages/Main'
|
|
||||||
|
|
||||||
const TelemetryViewer = lazy(() => import('./TelemetryViewer'))
|
const TelemetryViewer = lazy(() => import('./TelemetryViewer'))
|
||||||
const TelemetryMerger = lazy(() => import('./TelemetryMerger'))
|
const TelemetryMerger = lazy(() => import('./TelemetryMerger'))
|
||||||
|
@ -2,9 +2,9 @@ import { Layout } from 'antd'
|
|||||||
import { lazy, memo, Suspense, useContext, useMemo } from 'react'
|
import { lazy, memo, Suspense, useContext, useMemo } from 'react'
|
||||||
import { useParams } from 'react-router-dom'
|
import { useParams } from 'react-router-dom'
|
||||||
|
|
||||||
|
import { RootPathContext } from '@asb/context'
|
||||||
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
||||||
|
|
||||||
import { RootPathContext } from '@pages/Main'
|
|
||||||
import { SuspenseFallback } from '@pages/SuspenseFallback'
|
import { SuspenseFallback } from '@pages/SuspenseFallback'
|
||||||
|
|
||||||
const ClusterController = lazy(() => import( './ClusterController'))
|
const ClusterController = lazy(() => import( './ClusterController'))
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { memo, useCallback, useContext, useEffect, useState } from 'react'
|
import { memo, useCallback, useContext, useEffect, useState } from 'react'
|
||||||
import { Button, Modal, Popconfirm } from 'antd'
|
import { Button, Modal, Popconfirm } from 'antd'
|
||||||
|
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
import { Table } from '@components/Table'
|
import { Table } from '@components/Table'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
import { DrillParamsService } from '@api'
|
import { DrillParamsService } from '@api'
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
import { getColumns } from '@pages/WellOperations/WellDrillParams'
|
import { getColumns } from '@pages/WellOperations/WellDrillParams'
|
||||||
|
|
||||||
export const NewParamsTable = memo(({ selectedWellsKeys }) => {
|
export const NewParamsTable = memo(({ selectedWellsKeys }) => {
|
||||||
|
@ -3,6 +3,7 @@ import { useState, useEffect, memo, useMemo, useContext } from 'react'
|
|||||||
import { LineChartOutlined, ProfileOutlined } from '@ant-design/icons'
|
import { LineChartOutlined, ProfileOutlined } from '@ant-design/icons'
|
||||||
import { Table, Tag, Button, Badge, Divider, Modal, Row, Col } from 'antd'
|
import { Table, Tag, Button, Badge, Divider, Modal, Row, Col } from 'antd'
|
||||||
|
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
import { CompanyView } from '@components/views'
|
import { CompanyView } from '@components/views'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
@ -15,7 +16,6 @@ import {
|
|||||||
getOperations
|
getOperations
|
||||||
} from '@utils/functions'
|
} from '@utils/functions'
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
import { Tvd } from '@pages/WellOperations/Tvd'
|
import { Tvd } from '@pages/WellOperations/Tvd'
|
||||||
import WellOperationsTable from '@pages/Cluster/WellOperationsTable'
|
import WellOperationsTable from '@pages/Cluster/WellOperationsTable'
|
||||||
import NewParamsTable from './NewParamsTable'
|
import NewParamsTable from './NewParamsTable'
|
||||||
|
@ -2,14 +2,14 @@ import { useState, useEffect, memo, useContext } from 'react'
|
|||||||
import { useParams } from 'react-router-dom'
|
import { useParams } from 'react-router-dom'
|
||||||
import { Col, Layout, Row } from 'antd'
|
import { Col, Layout, Row } from 'antd'
|
||||||
|
|
||||||
import { arrayOrDefault } from '@utils'
|
import { IdWellContext } from '@asb/context'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import WellSelector from '@components/selectors/WellSelector'
|
import WellSelector from '@components/selectors/WellSelector'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
||||||
|
import { arrayOrDefault } from '@utils'
|
||||||
import { OperationStatService, WellCompositeService } from '@api'
|
import { OperationStatService, WellCompositeService } from '@api'
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
import ClusterWells from '@pages/Cluster/ClusterWells'
|
import ClusterWells from '@pages/Cluster/ClusterWells'
|
||||||
import { WellCompositeSections } from './WellCompositeSections'
|
import { WellCompositeSections } from './WellCompositeSections'
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@ import { memo, useContext, useMemo } from 'react'
|
|||||||
import { useParams } from 'react-router-dom'
|
import { useParams } from 'react-router-dom'
|
||||||
import { Layout } from 'antd'
|
import { Layout } from 'antd'
|
||||||
|
|
||||||
|
import { RootPathContext } from '@asb/context'
|
||||||
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
||||||
|
|
||||||
import Statistics from './Statistics'
|
import Statistics from './Statistics'
|
||||||
import WellCompositeEditor from './WellCompositeEditor'
|
import WellCompositeEditor from './WellCompositeEditor'
|
||||||
import { RootPathContext } from '@pages/Main'
|
|
||||||
|
|
||||||
export const Analytics = memo(() => {
|
export const Analytics = memo(() => {
|
||||||
const { tab } = useParams()
|
const { tab } = useParams()
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import { useState, useEffect, useMemo, useCallback, useContext } from 'react'
|
import { useState, useEffect, useMemo, useCallback, useContext } from 'react'
|
||||||
import { DatePicker, Button, Input } from 'antd'
|
import { DatePicker, Button, Input } from 'antd'
|
||||||
|
|
||||||
import { FileService } from '@api'
|
import { IdWellContext } from '@asb/context'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { UploadForm } from '@components/UploadForm'
|
import { UploadForm } from '@components/UploadForm'
|
||||||
import { CompanyView, UserView } from '@components/views'
|
import { CompanyView, UserView } from '@components/views'
|
||||||
import { EditableTable, makeColumn, makeDateColumn, makeNumericColumn, makePaginationObject } from '@components/Table'
|
|
||||||
import { invokeWebApiWrapperAsync, downloadFile, formatBytes } from '@components/factory'
|
import { invokeWebApiWrapperAsync, downloadFile, formatBytes } from '@components/factory'
|
||||||
|
import { EditableTable, makeColumn, makeDateColumn, makeNumericColumn, makePaginationObject } from '@components/Table'
|
||||||
import { hasPermission } from '@utils/permissions'
|
import { hasPermission } from '@utils/permissions'
|
||||||
|
import { FileService } from '@api's
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
const pageSize = 12
|
const pageSize = 12
|
||||||
const { RangePicker } = DatePicker
|
const { RangePicker } = DatePicker
|
||||||
|
@ -3,10 +3,10 @@ import { memo, useContext, useMemo } from 'react'
|
|||||||
import { FolderOutlined } from '@ant-design/icons'
|
import { FolderOutlined } from '@ant-design/icons'
|
||||||
import { Layout } from 'antd'
|
import { Layout } from 'antd'
|
||||||
|
|
||||||
|
import { RootPathContext } from '@asb/context'
|
||||||
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
||||||
|
|
||||||
import DocumentsTemplate from './DocumentsTemplate'
|
import DocumentsTemplate from './DocumentsTemplate'
|
||||||
import { RootPathContext } from '@pages/Main'
|
|
||||||
|
|
||||||
const { Content } = Layout
|
const { Content } = Layout
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@ import { Form, Select } from 'antd'
|
|||||||
import { FileAddOutlined } from '@ant-design/icons'
|
import { FileAddOutlined } from '@ant-design/icons'
|
||||||
import { memo, useCallback, useContext, useEffect, useState } from 'react'
|
import { memo, useCallback, useContext, useEffect, useState } from 'react'
|
||||||
|
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
import Poprompt from '@components/selectors/Poprompt'
|
import Poprompt from '@components/selectors/Poprompt'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
import { DrillingProgramService } from '@api'
|
import { DrillingProgramService } from '@api'
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
import '@styles/drilling_program.less'
|
import '@styles/drilling_program.less'
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ import { Input, Modal, Radio } from 'antd'
|
|||||||
import { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react'
|
import { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react'
|
||||||
import { BehaviorSubject, debounceTime, distinctUntilChanged, filter, map } from 'rxjs'
|
import { BehaviorSubject, debounceTime, distinctUntilChanged, filter, map } from 'rxjs'
|
||||||
|
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
import { UserView } from '@components/views'
|
import { UserView } from '@components/views'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
@ -9,7 +10,6 @@ import { makeColumn, makeNumericSorter, Table } from '@components/Table'
|
|||||||
import { DrillingProgramService } from '@api'
|
import { DrillingProgramService } from '@api'
|
||||||
import { arrayOrDefault } from '@utils'
|
import { arrayOrDefault } from '@utils'
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
const userRules = [
|
const userRules = [
|
||||||
{ label: 'Нет', value: 0 },
|
{ label: 'Нет', value: 0 },
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { useCallback, useContext, useEffect, useState } from 'react'
|
import { useCallback, useContext, useEffect, useState } from 'react'
|
||||||
import { Button, DatePicker, Input, Modal } from 'antd'
|
import { Button, DatePicker, Input, Modal } from 'antd'
|
||||||
|
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
import { CompanyView } from '@components/views'
|
import { CompanyView } from '@components/views'
|
||||||
import DownloadLink from '@components/DownloadLink'
|
import DownloadLink from '@components/DownloadLink'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
@ -10,7 +11,6 @@ import { arrayOrDefault, formatDate } from '@utils'
|
|||||||
import { FileService } from '@api'
|
import { FileService } from '@api'
|
||||||
|
|
||||||
import MarksCard from './MarksCard'
|
import MarksCard from './MarksCard'
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
import '@styles/drilling_program.less'
|
import '@styles/drilling_program.less'
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import {
|
|||||||
TableOutlined,
|
TableOutlined,
|
||||||
} from '@ant-design/icons'
|
} from '@ant-design/icons'
|
||||||
|
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
import { UserView } from '@components/views'
|
import { UserView } from '@components/views'
|
||||||
import UploadForm from '@components/UploadForm'
|
import UploadForm from '@components/UploadForm'
|
||||||
import DownloadLink from '@components/DownloadLink'
|
import DownloadLink from '@components/DownloadLink'
|
||||||
@ -16,7 +17,6 @@ import { DrillingProgramService } from '@api'
|
|||||||
import { formatDate } from '@utils'
|
import { formatDate } from '@utils'
|
||||||
|
|
||||||
import MarksCard from './MarksCard'
|
import MarksCard from './MarksCard'
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
import '@styles/drilling_program.less'
|
import '@styles/drilling_program.less'
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import {
|
|||||||
} from '@ant-design/icons'
|
} from '@ant-design/icons'
|
||||||
import { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react'
|
import { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react'
|
||||||
|
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { downloadFile, formatBytes, invokeWebApiWrapperAsync } from '@components/factory'
|
import { downloadFile, formatBytes, invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
import { arrayOrDefault, formatDate } from '@utils'
|
import { arrayOrDefault, formatDate } from '@utils'
|
||||||
@ -19,7 +20,6 @@ import CategoryAdder from './CategoryAdder'
|
|||||||
import CategoryRender from './CategoryRender'
|
import CategoryRender from './CategoryRender'
|
||||||
import CategoryEditor from './CategoryEditor'
|
import CategoryEditor from './CategoryEditor'
|
||||||
import CategoryHistory from './CategoryHistory'
|
import CategoryHistory from './CategoryHistory'
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
import '@styles/drilling_program.less'
|
import '@styles/drilling_program.less'
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { createContext, memo } from 'react'
|
import { memo } from 'react'
|
||||||
import { Route, Switch } from 'react-router-dom'
|
import { Route, Switch } from 'react-router-dom'
|
||||||
|
|
||||||
|
import { RootPathContext } from '@asb/context'
|
||||||
import { AdminLayoutPortal, LayoutPortal } from '@components/Layout'
|
import { AdminLayoutPortal, LayoutPortal } from '@components/Layout'
|
||||||
import { PrivateDefaultRoute, PrivateRoute } from '@components/Private'
|
import { PrivateDefaultRoute, PrivateRoute } from '@components/Private'
|
||||||
|
|
||||||
@ -10,8 +11,6 @@ import Deposit from './Deposit'
|
|||||||
import AdminPanel from './AdminPanel'
|
import AdminPanel from './AdminPanel'
|
||||||
import AccessDenied from './AccessDenied'
|
import AccessDenied from './AccessDenied'
|
||||||
|
|
||||||
export const RootPathContext = createContext('')
|
|
||||||
|
|
||||||
export const Main = memo(() => (
|
export const Main = memo(() => (
|
||||||
<RootPathContext.Provider value={''}>
|
<RootPathContext.Provider value={''}>
|
||||||
<Switch>
|
<Switch>
|
||||||
|
@ -9,6 +9,7 @@ import {
|
|||||||
DeleteOutlined
|
DeleteOutlined
|
||||||
} from '@ant-design/icons'
|
} from '@ant-design/icons'
|
||||||
|
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
import { hasPermission } from '@utils/permissions'
|
import { hasPermission } from '@utils/permissions'
|
||||||
@ -16,7 +17,6 @@ import { formatDate } from '@utils'
|
|||||||
import { MeasureService } from '@api'
|
import { MeasureService } from '@api'
|
||||||
|
|
||||||
import { View } from './View'
|
import { View } from './View'
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
import '@styles/index.css'
|
import '@styles/index.css'
|
||||||
import '@styles/measure.css'
|
import '@styles/measure.css'
|
||||||
|
@ -2,16 +2,16 @@ import { Button } from 'antd'
|
|||||||
import { useState, useEffect, memo, useContext } from 'react'
|
import { useState, useEffect, memo, useContext } from 'react'
|
||||||
import { TableOutlined } from '@ant-design/icons'
|
import { TableOutlined } from '@ant-design/icons'
|
||||||
|
|
||||||
import { MeasureService } from '@api'
|
import { IdWellContext } from '@asb/context'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
|
import { MeasureService } from '@api'
|
||||||
|
|
||||||
import { MeasureTable } from './MeasureTable'
|
import { MeasureTable } from './MeasureTable'
|
||||||
import { InclinometryTable } from './InclinometryTable'
|
import { InclinometryTable } from './InclinometryTable'
|
||||||
import { columnsNnb, nnbDefaultData } from './nnbData'
|
import { columnsNnb, nnbDefaultData } from './nnbData'
|
||||||
import { columnsMudDiagram, mudDiagramDefaultData } from './mudDiagramData'
|
import { columnsMudDiagram, mudDiagramDefaultData } from './mudDiagramData'
|
||||||
import { columnsDrillingFluid, drillingFluidDefaultData } from './drillingFluidData'
|
import { columnsDrillingFluid, drillingFluidDefaultData } from './drillingFluidData'
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
const defaultData = [
|
const defaultData = [
|
||||||
{
|
{
|
||||||
|
@ -2,12 +2,12 @@ import { Button, Tooltip } from 'antd'
|
|||||||
import { useState, useEffect, memo, useContext } from 'react'
|
import { useState, useEffect, memo, useContext } from 'react'
|
||||||
import { FilePdfOutlined, FileTextOutlined } from '@ant-design/icons'
|
import { FilePdfOutlined, FileTextOutlined } from '@ant-design/icons'
|
||||||
|
|
||||||
import { ReportService } from '@api'
|
import { IdWellContext } from '@asb/context'
|
||||||
import { formatDate, periodToString } from '@utils'
|
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { Table, makeDateSorter, makeNumericSorter } from '@components/Table'
|
import { Table, makeDateSorter, makeNumericSorter } from '@components/Table'
|
||||||
import { invokeWebApiWrapperAsync, downloadFile } from '@components/factory'
|
import { invokeWebApiWrapperAsync, downloadFile } from '@components/factory'
|
||||||
import { IdWellContext } from '@pages/Well'
|
import { formatDate, periodToString } from '@utils'
|
||||||
|
import { ReportService } from '@api'
|
||||||
|
|
||||||
const imgPaths = {
|
const imgPaths = {
|
||||||
'.pdf': <FilePdfOutlined/>,
|
'.pdf': <FilePdfOutlined/>,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { useState, useEffect, memo, useCallback, useContext } from 'react'
|
import { useState, useEffect, memo, useCallback, useContext } from 'react'
|
||||||
|
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
import { Flex } from '@components/Grid'
|
import { Flex } from '@components/Grid'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
@ -8,7 +9,6 @@ import { DatePickerWrapper, makeDateSorter } from '@components/Table'
|
|||||||
import { PeriodPicker, defaultPeriod } from '@components/selectors/PeriodPicker'
|
import { PeriodPicker, defaultPeriod } from '@components/selectors/PeriodPicker'
|
||||||
import { TelemetryDataSaubService } from '@api'
|
import { TelemetryDataSaubService } from '@api'
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
import { normalizeData } from '../TelemetryView'
|
import { normalizeData } from '../TelemetryView'
|
||||||
import { ArchiveDisplay, cutData } from './ArchiveDisplay'
|
import { ArchiveDisplay, cutData } from './ArchiveDisplay'
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ import { useHistory, useParams } from 'react-router-dom'
|
|||||||
import { CloseOutlined } from '@ant-design/icons'
|
import { CloseOutlined } from '@ant-design/icons'
|
||||||
import { Button, Menu, Popconfirm } from 'antd'
|
import { Button, Menu, Popconfirm } from 'antd'
|
||||||
|
|
||||||
|
import { IdWellContext, RootPathContext } from '@asb/context'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
import { BaseWidget, WidgetSettingsWindow } from '@components/widgets'
|
import { BaseWidget, WidgetSettingsWindow } from '@components/widgets'
|
||||||
@ -19,8 +20,6 @@ import {
|
|||||||
WitsRecord61Service,
|
WitsRecord61Service,
|
||||||
} from '@api'
|
} from '@api'
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
import { RootPathContext } from '@pages/Main'
|
|
||||||
import AddGroupWindow from './AddGroupWindow'
|
import AddGroupWindow from './AddGroupWindow'
|
||||||
import AddWidgetWindow, { makeWidgetFromWits } from './AddWidgetWindow'
|
import AddWidgetWindow, { makeWidgetFromWits } from './AddWidgetWindow'
|
||||||
|
|
||||||
|
28
src/pages/Telemetry/Operations/index.jsx
Normal file
28
src/pages/Telemetry/Operations/index.jsx
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import { memo, useContext, useEffect, useState } from 'react'
|
||||||
|
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
|
|
||||||
|
|
||||||
|
export const Operations = memo(() => {
|
||||||
|
const idWell = useContext(IdWellContext)
|
||||||
|
const [isLoading, setIsLoading] = useState(false)
|
||||||
|
|
||||||
|
useEffect(() => invokeWebApiWrapperAsync(
|
||||||
|
async () => {
|
||||||
|
//
|
||||||
|
},
|
||||||
|
setIsLoading,
|
||||||
|
'Не удалось загрузить список определённых операций',
|
||||||
|
'Получение списка определённых операций',
|
||||||
|
))
|
||||||
|
|
||||||
|
return (
|
||||||
|
<LoaderPortal show={isLoading}>
|
||||||
|
|
||||||
|
</LoaderPortal>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
export default Operations
|
@ -1,13 +1,13 @@
|
|||||||
import { Table } from 'antd'
|
import { Table } from 'antd'
|
||||||
import { useState, useEffect, useCallback, memo, useContext } from 'react'
|
import { useState, useEffect, useCallback, memo, useContext } from 'react'
|
||||||
|
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
import { Subscribe } from '@services/signalr'
|
import { Subscribe } from '@services/signalr'
|
||||||
import { MessageService } from '@api'
|
import { MessageService } from '@api'
|
||||||
|
|
||||||
import { columns } from '../Messages'
|
import { columns } from '../Messages'
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
import '@styles/message.css'
|
import '@styles/message.css'
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
import { memo, useCallback, useContext, useMemo, useState } from 'react'
|
import { memo, useCallback, useContext, useMemo, useState } from 'react'
|
||||||
import { Select, Modal, Input, InputNumber } from 'antd'
|
import { Select, Modal, Input, InputNumber } from 'antd'
|
||||||
|
|
||||||
import { SetpointsService } from '@api'
|
import { IdWellContext } from '@asb/context'
|
||||||
import { Grid, GridItem } from '@components/Grid'
|
import { Grid, GridItem } from '@components/Grid'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
import { makeNumericRender, EditableTable } from '@components/Table'
|
import { makeNumericRender, EditableTable } from '@components/Table'
|
||||||
import { PeriodPicker, defaultPeriod } from '@components/selectors/PeriodPicker'
|
import { PeriodPicker, defaultPeriod } from '@components/selectors/PeriodPicker'
|
||||||
|
import { SetpointsService } from '@api'
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
export const SetpointSender = memo(({ onClose, visible, setpointNames }) => {
|
export const SetpointSender = memo(({ onClose, visible, setpointNames }) => {
|
||||||
const [expirePeriod, setExpirePeriod] = useState(defaultPeriod)
|
const [expirePeriod, setExpirePeriod] = useState(defaultPeriod)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Button, Modal } from 'antd'
|
import { Button, Modal } from 'antd'
|
||||||
import { useState, useEffect, memo, useCallback, useMemo, useContext } from 'react'
|
import { useState, useEffect, memo, useCallback, useMemo, useContext } from 'react'
|
||||||
|
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
import { Table } from '@components/Table'
|
import { Table } from '@components/Table'
|
||||||
import { UserView } from '@components/views'
|
import { UserView } from '@components/views'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
@ -10,7 +11,6 @@ import { makeStringCutter } from '@utils/string'
|
|||||||
import { formatDate } from '@utils'
|
import { formatDate } from '@utils'
|
||||||
import { SetpointsService } from '@api'
|
import { SetpointsService } from '@api'
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
import SetpointSender from './SetpointSender'
|
import SetpointSender from './SetpointSender'
|
||||||
import { SetpointViewer, getSetpointStatus } from './SetpointViewer'
|
import { SetpointViewer, getSetpointStatus } from './SetpointViewer'
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { memo, useCallback, useContext, useEffect, useState } from 'react'
|
import { memo, useCallback, useContext, useEffect, useState } from 'react'
|
||||||
|
|
||||||
import { TelemetryWirelineRunOutService } from '@api'
|
import { IdWellContext } from '@asb/context'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
|
||||||
import { WirelineView } from '@components/views'
|
import { WirelineView } from '@components/views'
|
||||||
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
|
import { TelemetryWirelineRunOutService } from '@api'
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
export const WirelineRunOut = memo(() => {
|
export const WirelineRunOut = memo(() => {
|
||||||
const [twro, setTwro] = useState({})
|
const [twro, setTwro] = useState({})
|
||||||
|
@ -8,6 +8,7 @@ import {
|
|||||||
TelemetryDataSpinService,
|
TelemetryDataSpinService,
|
||||||
WellService
|
WellService
|
||||||
} from '@api'
|
} from '@api'
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
import { makeDateSorter } from '@components/Table'
|
import { makeDateSorter } from '@components/Table'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { Grid, GridItem, Flex } from '@components/Grid'
|
import { Grid, GridItem, Flex } from '@components/Grid'
|
||||||
@ -23,7 +24,6 @@ import { ModeDisplay } from './ModeDisplay'
|
|||||||
import { UserOfWell } from './UserOfWells'
|
import { UserOfWell } from './UserOfWells'
|
||||||
import { Setpoints } from './Setpoints'
|
import { Setpoints } from './Setpoints'
|
||||||
import WirelineRunOut from './WirelineRunOut'
|
import WirelineRunOut from './WirelineRunOut'
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
import MomentStabPicEnabled from '@images/DempherOn.png'
|
import MomentStabPicEnabled from '@images/DempherOn.png'
|
||||||
import MomentStabPicDisabled from '@images/DempherOff.png'
|
import MomentStabPicDisabled from '@images/DempherOff.png'
|
||||||
|
@ -3,13 +3,13 @@ import { memo, useContext, useMemo } from 'react'
|
|||||||
import { Layout } from 'antd'
|
import { Layout } from 'antd'
|
||||||
import { AlertOutlined, FundViewOutlined, DatabaseOutlined } from '@ant-design/icons'
|
import { AlertOutlined, FundViewOutlined, DatabaseOutlined } from '@ant-design/icons'
|
||||||
|
|
||||||
|
import { RootPathContext } from '@asb/context'
|
||||||
import { PrivateSwitch, PrivateMenu } from '@components/Private'
|
import { PrivateSwitch, PrivateMenu } from '@components/Private'
|
||||||
|
|
||||||
import Archive from './Archive'
|
import Archive from './Archive'
|
||||||
import Messages from './Messages'
|
import Messages from './Messages'
|
||||||
import DashboardNNB from './DashboardNNB'
|
import DashboardNNB from './DashboardNNB'
|
||||||
import TelemetryView from './TelemetryView'
|
import TelemetryView from './TelemetryView'
|
||||||
import { RootPathContext } from '@pages/Main'
|
|
||||||
|
|
||||||
import '@styles/index.css'
|
import '@styles/index.css'
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { useState, useEffect, memo, useContext } from 'react'
|
import { useState, useEffect, memo, useContext } from 'react'
|
||||||
|
|
||||||
import { TelemetryAnalyticsService } from '@api'
|
import { IdWellContext } from '@asb/context'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
import { ChartTelemetryDepthToDay } from '@components/charts/ChartTelemetryDepthToDay'
|
import { ChartTelemetryDepthToDay } from '@components/charts/ChartTelemetryDepthToDay'
|
||||||
|
import { TelemetryAnalyticsService } from '@api'
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
export const TelemetryAnalysisDepthToDay = memo(() => {
|
export const TelemetryAnalysisDepthToDay = memo(() => {
|
||||||
const [depthData, setDepthData] = useState([])
|
const [depthData, setDepthData] = useState([])
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { Select } from 'antd'
|
import { Select } from 'antd'
|
||||||
import { useState, useEffect, memo, useContext } from 'react'
|
import { useState, useEffect, memo, useContext } from 'react'
|
||||||
|
|
||||||
|
import { IdWellContext } from '@asb/context'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
import { ChartTelemetryDepthToInterval } from '@components/charts/ChartTelemetryDepthToInterval'
|
import { ChartTelemetryDepthToInterval } from '@components/charts/ChartTelemetryDepthToInterval'
|
||||||
import { TelemetryAnalyticsService } from '@api'
|
import { TelemetryAnalyticsService } from '@api'
|
||||||
import { arrayOrDefault } from '@utils'
|
import { arrayOrDefault } from '@utils'
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
const timePeriodCollection = [
|
const timePeriodCollection = [
|
||||||
{ value: '3600', label: '1 час' },
|
{ value: '3600', label: '1 час' },
|
||||||
|
@ -2,12 +2,12 @@ import moment from 'moment'
|
|||||||
import { Form, DatePicker } from 'antd'
|
import { Form, DatePicker } from 'antd'
|
||||||
import { useState, useEffect, memo, useContext } from 'react'
|
import { useState, useEffect, memo, useContext } from 'react'
|
||||||
|
|
||||||
import { TelemetryAnalyticsService } from '@api'
|
import { IdWellContext } from '@asb/context'
|
||||||
import LoaderPortal from '@components/LoaderPortal'
|
import LoaderPortal from '@components/LoaderPortal'
|
||||||
import { invokeWebApiWrapperAsync } from '@components/factory'
|
import { invokeWebApiWrapperAsync } from '@components/factory'
|
||||||
import { ChartTelemetryOperationsSummary } from '@components/charts/ChartTelemetryOperationsSummary'
|
import { ChartTelemetryOperationsSummary } from '@components/charts/ChartTelemetryOperationsSummary'
|
||||||
|
import { TelemetryAnalyticsService } from '@api'
|
||||||
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
const { RangePicker } = DatePicker
|
const { RangePicker } = DatePicker
|
||||||
|
|
||||||
|
@ -3,13 +3,13 @@ import { memo, useContext, useMemo } from 'react'
|
|||||||
import { FolderOutlined } from '@ant-design/icons'
|
import { FolderOutlined } from '@ant-design/icons'
|
||||||
import { Layout } from 'antd'
|
import { Layout } from 'antd'
|
||||||
|
|
||||||
|
import { RootPathContext } from '@asb/context'
|
||||||
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
||||||
|
|
||||||
import TelemetryAnalysisDepthToDay from './TelemetryAnalysisDepthToDay'
|
import TelemetryAnalysisDepthToDay from './TelemetryAnalysisDepthToDay'
|
||||||
import TelemetryAnalysisDepthToInterval from './TelemetryAnalysisDepthToInterval'
|
import TelemetryAnalysisDepthToInterval from './TelemetryAnalysisDepthToInterval'
|
||||||
import TelemetryAnalysisOperationsSummary from './TelemetryAnalysisOperationsSummary'
|
import TelemetryAnalysisOperationsSummary from './TelemetryAnalysisOperationsSummary'
|
||||||
import TelemetryAnalysisOperationsToInterval from './TelemetryAnalysisOperationsToInterval'
|
import TelemetryAnalysisOperationsToInterval from './TelemetryAnalysisOperationsToInterval'
|
||||||
import { RootPathContext } from '@pages/Main'
|
|
||||||
|
|
||||||
const { Content } = Layout
|
const { Content } = Layout
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { createContext, memo, useContext, useMemo } from 'react'
|
import { memo, useContext, useMemo } from 'react'
|
||||||
import {
|
import {
|
||||||
FolderOutlined,
|
FolderOutlined,
|
||||||
FundViewOutlined,
|
FundViewOutlined,
|
||||||
@ -9,6 +9,7 @@ import {
|
|||||||
import { Layout } from 'antd'
|
import { Layout } from 'antd'
|
||||||
import { useParams } from 'react-router-dom'
|
import { useParams } from 'react-router-dom'
|
||||||
|
|
||||||
|
import { IdWellContext, RootPathContext } from '@asb/context'
|
||||||
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
||||||
|
|
||||||
import Report from './Report'
|
import Report from './Report'
|
||||||
@ -19,14 +20,11 @@ import Telemetry from './Telemetry'
|
|||||||
import WellOperations from './WellOperations'
|
import WellOperations from './WellOperations'
|
||||||
import DrillingProgram from './DrillingProgram'
|
import DrillingProgram from './DrillingProgram'
|
||||||
import TelemetryAnalysis from './TelemetryAnalysis'
|
import TelemetryAnalysis from './TelemetryAnalysis'
|
||||||
import { RootPathContext } from './Main'
|
|
||||||
|
|
||||||
import '@styles/index.css'
|
import '@styles/index.css'
|
||||||
|
|
||||||
const { Content } = Layout
|
const { Content } = Layout
|
||||||
|
|
||||||
export const IdWellContext = createContext(null)
|
|
||||||
|
|
||||||
export const Well = memo(() => {
|
export const Well = memo(() => {
|
||||||
const { idWell, tab } = useParams()
|
const { idWell, tab } = useParams()
|
||||||
const root = useContext(RootPathContext)
|
const root = useContext(RootPathContext)
|
||||||
|
@ -9,6 +9,7 @@ import {
|
|||||||
TableOutlined,
|
TableOutlined,
|
||||||
} from '@ant-design/icons'
|
} from '@ant-design/icons'
|
||||||
|
|
||||||
|
import { IdWellContext, RootPathContext } from '@asb/context'
|
||||||
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
import { PrivateMenu, PrivateSwitch } from '@components/Private'
|
||||||
|
|
||||||
import { Tvd } from './Tvd'
|
import { Tvd } from './Tvd'
|
||||||
@ -19,8 +20,6 @@ import { WellSectionsStat } from './WellSectionsStat'
|
|||||||
import { WellOperationsEditor } from './WellOperationsEditor'
|
import { WellOperationsEditor } from './WellOperationsEditor'
|
||||||
import { Flex } from '@components/Grid'
|
import { Flex } from '@components/Grid'
|
||||||
|
|
||||||
import { RootPathContext } from '@pages/Main'
|
|
||||||
import { IdWellContext } from '@pages/Well'
|
|
||||||
|
|
||||||
const { Content } = Layout
|
const { Content } = Layout
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user