From e3e5a1bf4e6b0600125475b78ca75131125ebb66 Mon Sep 17 00:00:00 2001 From: goodm2ice Date: Mon, 7 Feb 2022 16:30:43 +0500 Subject: [PATCH] =?UTF-8?q?*=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=80=D0=BE=D1=83=D1=82=D0=B8=D0=BD=D0=B3=20?= =?UTF-8?q?=D0=BE=D0=BF=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B8=20=D0=BF=D0=BE?= =?UTF-8?q?=20=D1=81=D0=BA=D0=B2=D0=B0=D0=B6=D0=B8=D0=BD=D0=B5=20*=20?= =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D1=81=20=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=B0=D0=BC=D0=B8=20=D0=B4=D0=BB=D1=8F=20Setpoints=20*?= =?UTF-8?q?=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B4=D1=81=D0=BA=D0=B0=D0=B7=D0=BA=D0=B0=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BF=D0=BE=D0=BB=D1=8F=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BC=D0=BE=D0=BD=D0=B8=D1=82=D0=BE=D1=80=D0=B8=D0=BD?= =?UTF-8?q?=D0=B3=D0=B5=20*=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=B1=D0=BB=D0=BE=D0=BA=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B0=20=D1=81=D1=82=D0=B0=D1=82=D1=83=D1=81=D0=B0=20?= =?UTF-8?q?=D1=81=D0=BA=D0=B2=D0=B0=D0=B6=D0=B8=D0=BD=D1=8B=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=BE=D1=82=D1=81=D1=83=D1=82=D1=81=D1=82=D0=B2=D0=B8?= =?UTF-8?q?=D0=B8=20=D1=80=D0=B0=D0=B7=D1=80=D0=B5=D1=88=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TelemetryAnalysisDepthToDay.jsx | 30 ++++++------- .../TelemetryAnalysisOperationsToInterval.jsx | 4 +- src/pages/TelemetryAnalysis/index.jsx | 40 ++++++++--------- src/pages/TelemetryView/Setpoints.jsx | 16 ++++--- src/pages/TelemetryView/UserOfWells.jsx | 11 ++--- src/pages/TelemetryView/index.jsx | 43 ++++++++++--------- 6 files changed, 75 insertions(+), 69 deletions(-) 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 }) {
Статус:  -