From 09ebdd5b46ad395f7622ec6fe6b2b0cdfd7f1ebe Mon Sep 17 00:00:00 2001 From: goodmice Date: Thu, 28 Apr 2022 09:30:17 +0500 Subject: [PATCH 01/14] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=84=D0=B8=D0=BA=D1=81=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=B7=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE=D0=B2=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=20=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=86-=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=D0=B0=D0=BA=D1=82=D0=BE=D1=80=D0=BE=D0=B2=20=D0=BE=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/WellOperations/WellOperationsEditor.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/WellOperations/WellOperationsEditor.jsx b/src/pages/WellOperations/WellOperationsEditor.jsx index 6c50d0f..4ea8dee 100755 --- a/src/pages/WellOperations/WellOperationsEditor.jsx +++ b/src/pages/WellOperations/WellOperationsEditor.jsx @@ -132,6 +132,7 @@ export const WellOperationsEditor = memo(({ idType, showNpt, ...other }) => { bordered size={'small'} columns={columns} + sticky={true} dataSource={operations} onRowAdd={hasPermission('WellOperation.edit') && makeActionHandler('insertRange', handlerProps, recordParser, 'Добавление операции по скважине')} onRowEdit={hasPermission('WellOperation.edit') && makeActionHandler('update', handlerProps, recordParser, 'Редактирование операции по скважине')} From 62e697065308fb93d2752d545bee359d4da1463e Mon Sep 17 00:00:00 2001 From: goodmice Date: Thu, 28 Apr 2022 11:18:39 +0500 Subject: [PATCH 02/14] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D1=81=D1=82=D0=BE=D0=BB=D0=B1=D0=B5=D1=86=20?= =?UTF-8?q?=D0=B4=D0=BB=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B8=20=D0=9D=D0=9F=D0=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/WellOperations/Tvd/AdditionalTables.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/WellOperations/Tvd/AdditionalTables.jsx b/src/pages/WellOperations/Tvd/AdditionalTables.jsx index 1889b63..d9fd228 100755 --- a/src/pages/WellOperations/Tvd/AdditionalTables.jsx +++ b/src/pages/WellOperations/Tvd/AdditionalTables.jsx @@ -1,5 +1,5 @@ import { Descriptions } from 'antd' -import { memo, useEffect, useState } from 'react' +import { memo, useEffect, useMemo, useState } from 'react' import { makeNumericRender } from '@components/Table' import { invokeWebApiWrapperAsync } from '@components/factory' @@ -21,6 +21,8 @@ const printDate = (date) => formatDate(date) ?? '-' export const AdditionalTables = memo(({ operations, xLabel, setIsLoading }) => { const [additionalData, setAdditionalData] = useState({}) + const nptSum = useMemo(() => operations.fact?.reduce((out, row) => out + (row?.durationHours ?? 0), 0), [operations.fact]) + useEffect(() => invokeWebApiWrapperAsync( async () => { const [factStartDate, factEndDate] = calcEndDate(operations.fact) @@ -49,6 +51,7 @@ export const AdditionalTables = memo(({ operations, xLabel, setIsLoading }) => { {printDate(additionalData.endDate)} {numericRender(additionalData.lag)} + {numericRender(nptSum)}
From 107016ba5ef3bc5219ac2d877a4f9a760e4f441d Mon Sep 17 00:00:00 2001 From: goodmice Date: Thu, 28 Apr 2022 12:06:13 +0500 Subject: [PATCH 03/14] =?UTF-8?q?=D0=A1=D0=BA=D1=80=D1=8B=D1=82=20=D1=81?= =?UTF-8?q?=D1=82=D0=BE=D0=BB=D0=B1=D0=B5=D1=86=20=D0=BF=D0=BB=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BE=D0=B3=D0=BE=20=D0=9D=D0=9F=D0=92;=20=D0=BE?= =?UTF-8?q?=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=9D=D0=9F=D0=92=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=BD=D0=B0=20=D1=87=D0=B0=D1=81=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Cluster/ClusterWells.jsx | 47 +++++++++++------------------- 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/src/pages/Cluster/ClusterWells.jsx b/src/pages/Cluster/ClusterWells.jsx index f919f2f..eaa447b 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 } from 'react' +import { useState, useEffect, memo, useMemo, useCallback } from 'react' import { Tag, Button, Modal } from 'antd' import { LineChartOutlined, ProfileOutlined } from '@ant-design/icons' @@ -11,6 +11,7 @@ import { makeNumericColumnPlanFact, Table, makeNumericRender, + makeNumericColumn, } from '@components/Table' import { CompanyView } from '@components/views' import LoaderPortal from '@components/LoaderPortal' @@ -36,6 +37,7 @@ const DAY_IN_MS = 86_400_000 const ONLINE_DEADTIME = 600_000 const getDate = (str) => isRawDate(str) ? new Date(str).toLocaleString() : '-' +const numericRender = makeNumericRender(1) export const ClusterWells = memo(({ statsWells }) => { const [selectedWellId, setSelectedWellId] = useState(0) @@ -127,38 +129,23 @@ export const ClusterWells = memo(({ statsWells }) => { makeColumn('начало', 'factStart', { sorter: makeDateSorter('factStart'), render: getDate }), makeColumn('окончание', 'factEnd', { sorter: makeDateSorter('factEnd'), render: getDate }), ]), - makeNumericColumnPlanFact('Продолжительность, сут', 'period', filtersMinMax, makeFilterMinMaxFunction, makeNumericRender(1)), - makeNumericColumnPlanFact('МСП, м/ч', 'rateOfPenetration', filtersMinMax, makeFilterMinMaxFunction, makeNumericRender(1)), - makeNumericColumnPlanFact('Рейсовая скорость, м/ч', 'routeSpeed', filtersMinMax, makeFilterMinMaxFunction, makeNumericRender(1)), - makeNumericColumnPlanFact('НПВ, сут', 'notProductiveTime', filtersMinMax, makeFilterMinMaxFunction, makeNumericRender(1)), - { - title: 'TVD', - key: 'tvd', - render: (value) => , - align: 'center' - }, - { - title: 'Операции', - key: 'operations', - render: (value) => , - align: 'center' - }, - { - title: 'Участники', - key: 'companies', - dataIndex: 'companies', + makeNumericColumnPlanFact('Продолжительность, сут', 'period', filtersMinMax, makeFilterMinMaxFunction, numericRender), + makeNumericColumnPlanFact('МСП, м/ч', 'rateOfPenetration', filtersMinMax, makeFilterMinMaxFunction, numericRender), + makeNumericColumnPlanFact('Рейсовая скорость, м/ч', 'routeSpeed', filtersMinMax, makeFilterMinMaxFunction, numericRender), + makeNumericColumn('НПВ, ч', 'notProductiveTimeFact', filtersMinMax, makeFilterMinMaxFunction, (npt) => numericRender(npt * 24)), + makeColumn('TVD', 'tvd', { align: 'center', render: (_, value) => ( +