From 107016ba5ef3bc5219ac2d877a4f9a760e4f441d Mon Sep 17 00:00:00 2001 From: goodmice Date: Thu, 28 Apr 2022 12:06:13 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BA=D1=80=D1=8B=D1=82=20=D1=81=D1=82?= =?UTF-8?q?=D0=BE=D0=BB=D0=B1=D0=B5=D1=86=20=D0=BF=D0=BB=D0=B0=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=BE=D0=B3=D0=BE=20=D0=9D=D0=9F=D0=92;=20=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=9D?= =?UTF-8?q?=D0=9F=D0=92=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=BE?= =?UTF-8?q?=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) => ( +