From 6014c140b6075f0edef7c0836892fc933da4d2cf Mon Sep 17 00:00:00 2001 From: Alexey Date: Tue, 27 Jul 2021 14:05:32 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=B2=D0=B0=D1=80=D0=BD=D0=B8=D0=BD=D0=B3?= =?UTF-8?q?=D0=B8.=20=D0=94=D0=BB=D1=8F=20=D0=B3=D1=80=D0=B0=D1=84=D0=B8?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BE=D0=BF=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B8?= =?UTF-8?q?-=D0=B2=D1=80=D0=B5=D0=BC=D1=8F=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=BF=D0=B5=D1=80=D0=B8=D0=BE=D0=B4?= =?UTF-8?q?=20=D0=BF=D0=BE=20=D1=83=D0=BC=D0=BE=D0=BB=D1=87=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8E=201=20=D0=B4=D0=B5=D0=BD=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AnalysisDepthToDay.jsx | 5 +++-- src/components/AnalysisDepthToInterval.jsx | 8 +++----- src/components/AnalysisOperationTime.jsx | 13 +++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/AnalysisDepthToDay.jsx b/src/components/AnalysisDepthToDay.jsx index f7f5517..9577cb0 100644 --- a/src/components/AnalysisDepthToDay.jsx +++ b/src/components/AnalysisDepthToDay.jsx @@ -3,6 +3,7 @@ import { useParams } from "react-router-dom" import notify from "../components/notify" import { useState, useEffect } from 'react' import { AnalyticsService } from "../services/api" +import LoaderPortal from '../components/LoaderPortal' const lines = [ { label: "Глубина забоя", yAccessorName: "wellDepth", color: '#f00' }, @@ -31,11 +32,11 @@ export function AnalysisDepthToDay() { }, [id]) return ( - <> + - + ) } \ No newline at end of file diff --git a/src/components/AnalysisDepthToInterval.jsx b/src/components/AnalysisDepthToInterval.jsx index 840206c..36d1531 100644 --- a/src/components/AnalysisDepthToInterval.jsx +++ b/src/components/AnalysisDepthToInterval.jsx @@ -1,10 +1,10 @@ import { useParams } from "react-router-dom" -import { DatePicker } from 'antd' import notify from "../components/notify" import { useState, useEffect } from 'react' import { AnalyticsService } from '../services/api' import { ChartDepthToInterval } from './charts/ChartDepthToInterval' import { Select } from 'antd' +import LoaderPortal from '../components/LoaderPortal' const { Option } = Select @@ -19,8 +19,6 @@ const timePeriodCollection = [ { value: '86400', label: '24 часа' } ] -const { RangePicker } = DatePicker - const lines = [{ label: 'График скорость проходки-интервал', yAccessorName: "intervalDepthProgress", xAccessorName: "intervalStartDate", color: '#00f' }] export function AnalysisDepthToInterval() { @@ -48,7 +46,7 @@ export function AnalysisDepthToInterval() { }, [id, chartInterval]) return ( - <> + @@ -56,6 +54,6 @@ export function AnalysisDepthToInterval() { data={depthToIntervalData} lines={lines} /> - + ) } \ No newline at end of file diff --git a/src/components/AnalysisOperationTime.jsx b/src/components/AnalysisOperationTime.jsx index 1bcd261..690cab6 100644 --- a/src/components/AnalysisOperationTime.jsx +++ b/src/components/AnalysisOperationTime.jsx @@ -5,6 +5,8 @@ import { useState, useEffect } from 'react' import { AnalyticsService } from '../services/api' import { ChartOperationTime } from './charts/ChartOperationTime' import locale from "antd/lib/locale/ru_RU"; +import LoaderPortal from '../components/LoaderPortal' +import moment from 'moment' const { RangePicker } = DatePicker @@ -14,10 +16,7 @@ export function AnalysisOperationTime() { let { id } = useParams() const [operationTimeData, setOperationTimeData] = useState([]) const [loader, setLoader] = useState(false) - const [range, setRange] = useState([]) - - let begin = null - let end = null + const [range, setRange] = useState([moment().subtract(1,'days'), moment()]) const onChangeRange = (range) => { setRange(range) @@ -29,6 +28,8 @@ export function AnalysisOperationTime() { useEffect(() => { setLoader(true) + let begin = null + let end = null if (range?.length > 1) { begin = range[0].toISOString() end = range[1].toISOString() @@ -44,7 +45,7 @@ export function AnalysisOperationTime() { }, [id, range]) return ( - <> + - + ) } \ No newline at end of file