Рефакторинг

This commit is contained in:
ts_salikhov 2022-08-12 16:18:04 +04:00
parent f6046770e7
commit 983155e0fa
3 changed files with 8 additions and 9 deletions

View File

@ -20,7 +20,7 @@ import {
import Tvd from '@pages/WellOperations/Tvd' import Tvd from '@pages/WellOperations/Tvd'
import WellOperationsTable from '@pages/Cluster/WellOperationsTable' import WellOperationsTable from '@pages/Cluster/WellOperationsTable'
import NewParamsTable from './NewParamsTable' import NewParamsTable from './NewParamsTable'
import CompaniesTable from "@pages/Cluster/CompaniesTable"; import CompaniesTable from '@pages/Cluster/CompaniesTable'
const filtersMinMax = [ const filtersMinMax = [
{ text: 'min', value: 'min' }, { text: 'min', value: 'min' },

View File

@ -27,7 +27,7 @@ import {
import Tvd from '@pages/WellOperations/Tvd' import Tvd from '@pages/WellOperations/Tvd'
import WellOperationsTable from './WellOperationsTable' import WellOperationsTable from './WellOperationsTable'
import CompaniesTable from "@pages/Cluster/CompaniesTable"; import CompaniesTable from '@pages/Cluster/CompaniesTable'
const filtersMinMax = [ const filtersMinMax = [
{ text: 'min', value: 'min' }, { text: 'min', value: 'min' },

View File

@ -1,8 +1,7 @@
import React, { memo, useMemo } from 'react' import React, { memo, useMemo } from 'react'
import { Table } from 'antd'
import { BankOutlined } from '@ant-design/icons' import { BankOutlined } from '@ant-design/icons'
import { makeTextColumn } from '@components/Table' import { makeTextColumn, Table } from '@components/Table'
const columns = [ const columns = [
makeTextColumn('', 'logo'), makeTextColumn('', 'logo'),
@ -13,10 +12,10 @@ const columns = [
const CompaniesTable = memo(({companies}) => { const CompaniesTable = memo(({companies}) => {
const dataCompanies = useMemo(() => companies?.map((company) => ({ const dataCompanies = useMemo(() => companies?.map((company) => ({
key: company.id, key: company.id,
logo: <BankOutlined/>, logo: companies?.logo ? <img src={companies.logo}/> : <BankOutlined/>,
caption: company.caption, caption: company.caption,
companyTypeCaption: company.companyTypeCaption, companyTypeCaption: company.companyTypeCaption,
})), [companies]); })), [companies])
return ( return (
<Table <Table
@ -28,7 +27,7 @@ const CompaniesTable = memo(({companies}) => {
pagination={{ defaultPageSize: 10 }} pagination={{ defaultPageSize: 10 }}
tableName={'well_operations'} tableName={'well_operations'}
/> />
); )
}); })
export default CompaniesTable; export default CompaniesTable