diff --git a/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToDay.jsx b/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToDay.jsx index 3da4ebe..60aea51 100644 --- a/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToDay.jsx +++ b/src/pages/TelemetryAnalysis/TelemetryAnalysisDepthToDay.jsx @@ -10,27 +10,25 @@ export const TelemetryAnalysisDepthToDay = memo(({ idWell }) => { const [bitPositionData, setBitPositionData] = useState([]) const [loader, setLoader] = useState(false) - useEffect(() => { - setLoader(true) - invokeWebApiWrapperAsync( - async () => { - const depthToDayData = await TelemetryAnalyticsService.getWellDepthToDay(idWell) + useEffect(() => invokeWebApiWrapperAsync( + async () => { + const depthToDayData = await TelemetryAnalyticsService.getWellDepthToDay(idWell) - const depths = depthToDayData.map(el => ({depth: el.wellDepth, date: el.date})) - .sort((a, b) => new Date(a.date) - new Date(b.date)) - setDepthData(depths) + const depths = depthToDayData.map(el => ({depth: el.wellDepth, date: el.date})) + .sort((a, b) => new Date(a.date) - new Date(b.date)) + setDepthData(depths) - const bitPositions = depthToDayData.map(el => ({depth: el.bitDepth, date: el.date})) - .sort((a, b) => new Date(a.date) - new Date(b.date)) - setBitPositionData(bitPositions) - }, - setLoader, - `Не удалось получить данные для анализа Глубина-День по скважине "${idWell}"`) - }, [idWell]) + const bitPositions = depthToDayData.map(el => ({depth: el.bitDepth, date: el.date})) + .sort((a, b) => new Date(a.date) - new Date(b.date)) + setBitPositionData(bitPositions) + }, + setLoader, + `Не удалось получить данные для анализа Глубина-День по скважине "${idWell}"` + ), [idWell]) return ( -
+
(<>123) +import { memo } from 'react' + +export const TelemetryAnalysisOperationsToInterval = memo(({ idWell }) => (<>{idWell} 123)) export default TelemetryAnalysisOperationsToInterval diff --git a/src/pages/TelemetryAnalysis/index.jsx b/src/pages/TelemetryAnalysis/index.jsx index 1a06a09..3c7e8ca 100644 --- a/src/pages/TelemetryAnalysis/index.jsx +++ b/src/pages/TelemetryAnalysis/index.jsx @@ -28,26 +28,26 @@ export const TelemetryAnalysis = memo(({ idWell }) => { - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/src/pages/TelemetryView/Setpoints.jsx b/src/pages/TelemetryView/Setpoints.jsx index 77563f3..cd50a7c 100644 --- a/src/pages/TelemetryView/Setpoints.jsx +++ b/src/pages/TelemetryView/Setpoints.jsx @@ -11,6 +11,7 @@ import { SetpointsService } from '@api' import { SetpointSender } from './SetpointSender' import { SetpointViewer, getSetpointStatus } from './SetpointViewer' +import { hasPermission } from '@asb/utils/permissions' export const Setpoints = ({ idWell, ...other }) => { const [isModalVisible, setIsModalVisible] = useState(false) @@ -49,7 +50,7 @@ export const Setpoints = ({ idWell, ...other }) => { { dataIndex: 'id', render: (id) => }, ] - const updateTable = () => invokeWebApiWrapperAsync( + const updateTable = async () => await invokeWebApiWrapperAsync( async () => { const setpoints = await SetpointsService.getByIdWell(idWell) setSetpoints(setpoints) @@ -58,16 +59,19 @@ export const Setpoints = ({ idWell, ...other }) => { `Не удалось загрузить список для скважины "${idWell}"` ) - useEffect(updateTable, [idWell]) + const onOpenClick = async () => { + await updateTable() + setIsModalVisible(true) + } const onSenderClose = (pushed) => { if (pushed) updateTable() setIsSenderVisible(false) } - return ( + return hasPermission('Setpoints.get') && (
- { title={'Рекомендованные уставки'} visible={isModalVisible} onCancel={() => setIsModalVisible(false)} - footer={ + footer={hasPermission('Setpoints.edit') && ( - } + )} > ( - + Пользователь} + value={data[data.length - 1]?.user} + /> ) export default UserOfWell diff --git a/src/pages/TelemetryView/index.jsx b/src/pages/TelemetryView/index.jsx index 8b522bd..a795599 100644 --- a/src/pages/TelemetryView/index.jsx +++ b/src/pages/TelemetryView/index.jsx @@ -1,5 +1,20 @@ -import { useState, useEffect } from 'react' import { Select } from 'antd' +import { useState, useEffect } from 'react' + +import { + DrillFlowChartService, + OperationStatService, + TelemetryDataSaubService, + TelemetryDataSpinService, + WellService +} from '@api' +import { makeDateSorter } from '@components/Table' +import LoaderPortal from '@components/LoaderPortal' +import { Grid, GridItem, Flex } from '@components/Grid' +import { invokeWebApiWrapperAsync } from '@components/factory' +import { PeriodPicker, defaultPeriod } from '@components/PeriodPicker' +import { hasPermission } from '@utils/permissions' +import { Subscribe } from '@services/signalr' import { MonitoringColumn } from './MonitoringColumn' import { CustomColumn } from './CustomColumn' @@ -8,26 +23,12 @@ import { ModeDisplay } from './ModeDisplay' import { UserOfWell } from './UserOfWells' import { Setpoints } from './Setpoints' -import LoaderPortal from '../../components/LoaderPortal' -import { Grid, GridItem, Flex } from '../../components/Grid' -import { Subscribe } from '../../services/signalr' -import { - DrillFlowChartService, - OperationStatService, - TelemetryDataSaubService, - TelemetryDataSpinService, - WellService -} from '../../services/api' -import { makeDateSorter } from '../../components/Table' -import { invokeWebApiWrapperAsync } from '../../components/factory' -import { PeriodPicker, defaultPeriod } from '../../components/PeriodPicker' +import MomentStabPicEnabled from '@images/DempherOn.png' +import MomentStabPicDisabled from '@images/DempherOff.png' +import SpinPicEnabled from '@images/SpinEnabled.png' +import SpinPicDisabled from '@images/SpinDisabled.png' -import MomentStabPicEnabled from '../../images/DempherOn.png' -import MomentStabPicDisabled from '../../images/DempherOff.png' -import SpinPicEnabled from '../../images/SpinEnabled.png' -import SpinPicDisabled from '../../images/SpinDisabled.png' - -import '../../styles/message.css' +import '@styles/message.css' const { Option } = Select @@ -386,7 +387,7 @@ export default function TelemetryView({ idWell }) {
Статус:  -