From 8ef6a03ed3cfc5b334d6403bbd65326063a6de1d Mon Sep 17 00:00:00 2001 From: goodmice Date: Fri, 17 Jun 2022 18:48:43 +0500 Subject: [PATCH] =?UTF-8?q?*=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D1=81=D0=B5=D0=BB=D0=B5=D0=BA=D1=82=D0=BE=D1=80=20?= =?UTF-8?q?=D0=BA=D0=B0=D1=82=D0=B5=D0=B3=D0=BE=D1=80=D0=B8=D0=B9=20=D0=BE?= =?UTF-8?q?=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D1=8F=D0=B5=D0=BC=D1=8B?= =?UTF-8?q?=D1=85=20=D0=BE=D0=BF=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B9=20*?= =?UTF-8?q?=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=20=D0=BE=D1=82=D1=81=D1=83=D1=82=D1=81?= =?UTF-8?q?=D0=B2=D0=B8=D0=B8=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=B3=D1=80=D0=B0=D1=84=D0=B8=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Telemetry/Operations/index.jsx | 30 +++++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/pages/Telemetry/Operations/index.jsx b/src/pages/Telemetry/Operations/index.jsx index e1ed381..7efee11 100644 --- a/src/pages/Telemetry/Operations/index.jsx +++ b/src/pages/Telemetry/Operations/index.jsx @@ -1,5 +1,5 @@ import { memo, useCallback, useEffect, useMemo, useState } from 'react' -import { InputNumber } from 'antd' +import { Empty, InputNumber, Select } from 'antd' import moment from 'moment' import { useIdWell } from '@asb/context' @@ -22,9 +22,11 @@ const Operations = memo(() => { const [dateRange, setDateRange] = useState([]) const [yDomain, setYDomain] = useState(20) const [dates, setDates] = useState() - const [data, setData] = useState({ operations: [], stats: [] }) + const [data, setData] = useState({}) const [drillers, setDrillers] = useState([]) const [drillersLoader, setDrillersLoader] = useState(false) + const [selectedCategory, setSelectedCategory] = useState(14) + const [categories, setCategories] = useState() const idWell = useIdWell() @@ -51,13 +53,13 @@ const Operations = memo(() => { const updateData = useCallback(async () => invokeWebApiWrapperAsync( async () => { if (!dates) return - const data = await DetectedOperationService.get(idWell, undefined, dates[0].toISOString(), dates[1].toISOString()) + const data = await DetectedOperationService.get(idWell, selectedCategory, dates[0].toISOString(), dates[1].toISOString()) setData(data) }, setIsLoading, 'Не удалось загрузить список определённых операций', 'Получение списка определённых операций', - ), [idWell, dates]) + ), [idWell, dates, selectedCategory]) useEffect(() => { if (permissions.driller.get) @@ -67,6 +69,9 @@ const Operations = memo(() => { useEffect(() => { invokeWebApiWrapperAsync( async () => { + const categories = arrayOrDefault(await DetectedOperationService.getCategories(idWell)) + setCategories(categories.map(({ id, name }) => ({ value: id, label: name }))) + const dates = await TelemetryDataSaubService.getDataDatesRange(idWell) if (dates) { const dt = [moment(dates.from), moment(dates.to)] @@ -87,6 +92,13 @@ const Operations = memo(() => { return (
+