diff --git a/src/pages/Analytics/Statistics.jsx b/src/pages/Analytics/Statistics.jsx index fabd3c1..e10c29f 100755 --- a/src/pages/Analytics/Statistics.jsx +++ b/src/pages/Analytics/Statistics.jsx @@ -1,6 +1,7 @@ import { Table as RawTable, Typography } from 'antd' import { Fragment, memo, useCallback, useContext, useEffect, useState } from 'react' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { WellSelector } from '@components/selectors/WellSelector' @@ -8,7 +9,6 @@ import { makeGroupColumn, makeNumericColumn, makeNumericRender, makeTextColumn, import { OperationStatService, WellOperationService } from '@api' import { arrayOrDefault } from '@utils' -import { IdWellContext } from '../Well' import '@styles/index.css' import '@styles/statistics.less' diff --git a/src/pages/Cluster/ClusterWells.jsx b/src/pages/Cluster/ClusterWells.jsx index 7e3bb10..1c48058 100755 --- a/src/pages/Cluster/ClusterWells.jsx +++ b/src/pages/Cluster/ClusterWells.jsx @@ -1,5 +1,5 @@ import { Link, useLocation } from 'react-router-dom' -import { useState, useEffect, memo, useMemo, useCallback } from 'react' +import { useState, useEffect, memo, useMemo } from 'react' import { Tag, Button, Modal } from 'antd' import { LineChartOutlined, ProfileOutlined } from '@ant-design/icons' diff --git a/src/pages/Documents/DocumentsTemplate.jsx b/src/pages/Documents/DocumentsTemplate.jsx index 479ac5b..a540975 100755 --- a/src/pages/Documents/DocumentsTemplate.jsx +++ b/src/pages/Documents/DocumentsTemplate.jsx @@ -8,8 +8,7 @@ import { CompanyView, UserView } from '@components/views' import { invokeWebApiWrapperAsync, downloadFile, formatBytes } from '@components/factory' import { EditableTable, makeColumn, makeDateColumn, makeNumericColumn, makePaginationObject } from '@components/Table' import { hasPermission } from '@utils/permissions' -import { FileService } from '@api's - +import { FileService } from '@api' const pageSize = 12 const { RangePicker } = DatePicker @@ -42,7 +41,7 @@ export const DocumentsTemplate = ({ idCategory, idWell: wellId, accept, headerCh const [showLoader, setShowLoader] = useState(false) const idwellContext = useContext(IdWellContext) - const idWell = useMemo(() => wellId ?? idwellContext, [wellId]) + const idWell = useMemo(() => wellId ?? idwellContext, [wellId, idwellContext]) const uploadUrl = useMemo(() => `/api/well/${idWell}/files/?idCategory=${idCategory}`, [idWell, idCategory]) diff --git a/src/pages/Report/index.jsx b/src/pages/Report/index.jsx index 0c1f2e0..16bd8c0 100755 --- a/src/pages/Report/index.jsx +++ b/src/pages/Report/index.jsx @@ -3,15 +3,15 @@ import moment from 'moment' import { useState, useEffect, memo, useCallback, useContext } from 'react' import { Radio, Button, Select, notification } from 'antd' -import { ReportService } from '@api' -import { Subscribe } from '@services/signalr' +import { IdWellContext } from '@asb/context' import { LoaderPortal } from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { DateRangeWrapper } from 'components/Table/DateRangeWrapper' +import { Subscribe } from '@services/signalr' +import { ReportService } from '@api' import { Reports } from './Reports' import { ReportCreationNotify } from './ReportCreationNotify' -import { IdWellContext } from '../Well' const timePeriodNames = [ { label: '1 секунда', value: 1 }, diff --git a/src/pages/Telemetry/Messages.jsx b/src/pages/Telemetry/Messages.jsx index e97732b..ad2d3e9 100755 --- a/src/pages/Telemetry/Messages.jsx +++ b/src/pages/Telemetry/Messages.jsx @@ -1,12 +1,12 @@ import { useState, useEffect, memo, useCallback, useContext } from 'react' import { Table, Select, DatePicker, Input } from 'antd' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { makeColumn, makeDateColumn, makeNumericSorter } from '@components/Table' import { MessageService } from '@api' -import { IdWellContext } from '../Well' import '@styles/message.css' diff --git a/src/pages/WellOperations/DrillProcessFlow.jsx b/src/pages/WellOperations/DrillProcessFlow.jsx index b451c25..0d9865d 100755 --- a/src/pages/WellOperations/DrillProcessFlow.jsx +++ b/src/pages/WellOperations/DrillProcessFlow.jsx @@ -1,17 +1,17 @@ import { useState, useEffect, memo, useContext } from 'react' +import { IdWellContext } from '@asb/context' import { EditableTable, makeNumericMinMax, makeNumericStartEnd, } from '@components/Table' -import { DrillFlowChartService } from '@api' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { hasPermission } from '@utils/permissions' import { arrayOrDefault } from '@utils' +import { DrillFlowChartService } from '@api' -import { IdWellContext } from '../Well' const columns = [ makeNumericStartEnd('Глубина, м', 'depth'), diff --git a/src/pages/WellOperations/Tvd/index.jsx b/src/pages/WellOperations/Tvd/index.jsx index 6f61e78..997ca5d 100755 --- a/src/pages/WellOperations/Tvd/index.jsx +++ b/src/pages/WellOperations/Tvd/index.jsx @@ -16,6 +16,7 @@ import 'chartjs-adapter-moment' import zoomPlugin from 'chartjs-plugin-zoom' import ChartDataLabels from 'chartjs-plugin-datalabels' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { formatDate, fractionalSum } from '@utils/datetime' @@ -27,7 +28,6 @@ import AdditionalTables from './AdditionalTables' import '@styles/index.css' import '@styles/tvd.less' -import { IdWellContext } from '@asb/pages/Well' Chart.register( TimeScale, diff --git a/src/pages/WellOperations/WellDrillParams.jsx b/src/pages/WellOperations/WellDrillParams.jsx index 79b7e63..5a4570b 100755 --- a/src/pages/WellOperations/WellDrillParams.jsx +++ b/src/pages/WellOperations/WellDrillParams.jsx @@ -1,5 +1,6 @@ import { useState, useEffect, useCallback, memo, useMemo, useContext } from 'react' +import { IdWellContext } from '@asb/context' import { EditableTable, makeSelectColumn, @@ -13,7 +14,6 @@ import { DrillParamsService, WellOperationService } from '@api' import { hasPermission } from '@utils/permissions' import { arrayOrDefault } from '@utils' -import { IdWellContext } from '../Well' export const getColumns = async (idWell) => { let sectionTypes = await WellOperationService.getSectionTypes(idWell) diff --git a/src/pages/WellOperations/WellOperationsEditor.jsx b/src/pages/WellOperations/WellOperationsEditor.jsx index 4ea8dee..11b0298 100755 --- a/src/pages/WellOperations/WellOperationsEditor.jsx +++ b/src/pages/WellOperations/WellOperationsEditor.jsx @@ -3,6 +3,7 @@ import { Input } from 'antd' import { useLocation } from 'react-router-dom' import { useState, useEffect, memo, useMemo, useCallback, useContext } from 'react' +import { IdWellContext } from '@asb/context' import { EditableTable, makeColumn, @@ -21,7 +22,6 @@ import { hasPermission } from '@utils/permissions' import { arrayOrDefault } from '@utils' import { WellOperationService } from '@api' -import { IdWellContext } from '../Well' const { TextArea } = Input diff --git a/src/pages/WellOperations/WellSectionsStat.jsx b/src/pages/WellOperations/WellSectionsStat.jsx index 8afa41e..089c0c2 100755 --- a/src/pages/WellOperations/WellSectionsStat.jsx +++ b/src/pages/WellOperations/WellSectionsStat.jsx @@ -1,12 +1,12 @@ import { useState, useEffect, memo, useContext } from 'react' +import { IdWellContext } from '@asb/context' import LoaderPortal from '@components/LoaderPortal' import { invokeWebApiWrapperAsync } from '@components/factory' import { Table, makeColumn, makeColumnsPlanFact, makeNumericRender } from '@components/Table' import { calcDuration } from '@utils/datetime' import { OperationStatService } from '@api' -import { IdWellContext } from '../Well' const numericRender = makeNumericRender(2)