Рефакторинг

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: 'Участники', title: 'Участники',
dataIndex: 'companies', dataIndex: 'companies',
render: (value) => { render: (value) => (
return <Button onClick={() => { <Button onClick={() => {
setCompanies(value) setCompanies(value)
setIsCompaniesModalVisible(true) setIsCompaniesModalVisible(true)
}}> }}>
<TeamOutlined/> <TeamOutlined/>
</Button> </Button>
}, ),
}, },
], [location.pathname]) ], [location.pathname])

View File

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

View File

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