Рефакторинг

This commit is contained in:
ts_salikhov 2022-08-12 15:56:29 +04:00
parent cf34baa0a3
commit f6046770e7
3 changed files with 26 additions and 13 deletions

View File

@ -180,14 +180,14 @@ const WellCompositeSections = memo(({ statsWells, selectedSections }) => {
{
title: 'Участники',
dataIndex: 'companies',
render: (value) => {
return <Button onClick={() => {
render: (value) => (
<Button onClick={() => {
setCompanies(value)
setIsCompaniesModalVisible(true)
}}>
<TeamOutlined/>
</Button>
},
),
},
], [location.pathname])

View File

@ -138,16 +138,28 @@ const ClusterWells = memo(({ statsWells }) => {
makeNumericColumnPlanFact('Рейсовая скорость, м/ч', 'routeSpeed', filtersMinMax, makeFilterMinMaxFunction, numericRender),
makeNumericColumn('НПВ, ч', 'notProductiveTimeFact', filtersMinMax, makeFilterMinMaxFunction, numericRender),
makeColumn('TVD', 'tvd', { align: 'center', render: (_, value) => (
<Button onClick={() => { setSelectedWellId(value?.id); setIsTVDModalVisible(true) }} children={<LineChartOutlined />} />
<Button onClick={() => {
setSelectedWellId(value?.id)
setIsTVDModalVisible(true)
}}>
<LineChartOutlined />
</Button>
) }),
makeColumn('Операции', 'operations', { align: 'center', render: (_, value) => (
<Button onClick={() => { setSelectedWellId(value?.id); setIsOpsModalVisible(true) }} children={<ProfileOutlined />} />
<Button onClick={() => {
setSelectedWellId(value?.id)
setIsOpsModalVisible(true)
}}>
<ProfileOutlined />
</Button>
) }),
makeColumn('Участники', 'companies', { align: 'center', render: (value) => (
<Button onClick={() => {
setCompanies(value);
setIsCompaniesModalVisible(true);
}} children={<TeamOutlined />} />
<Button onClick={() => {
setCompanies(value)
setIsCompaniesModalVisible(true)
}}>
<TeamOutlined />
</Button>
) }),
], [location.pathname])

View File

@ -1,7 +1,8 @@
import React, {memo, useMemo} from 'react';
import {makeTextColumn} from "@components/Table";
import {Table} from "antd";
import {BankOutlined} from "@ant-design/icons";
import React, { memo, useMemo } from 'react'
import { Table } from 'antd'
import { BankOutlined } from '@ant-design/icons'
import { makeTextColumn } from '@components/Table'
const columns = [
makeTextColumn('', 'logo'),