CF2-55: Fixed filters

This commit is contained in:
KharchenkoVV 2021-08-26 17:45:36 +05:00
parent ed4fe093e0
commit a4cd429737
3 changed files with 21 additions and 35 deletions

View File

@ -120,10 +120,10 @@ export const makeNumericColumn = (title: any, dataIndex: any, filters: any, widt
width: width
})
export const makeNumericColumnPlanFact = (title: any, dataIndex: any, filters: any) =>
export const makeNumericColumnPlanFact = (title: any, dataIndex: any, filters: any, width: string) =>
makeGroupColumn( title, [
makeNumericColumn('п', dataIndex + 'Plan', filters, ''),
makeNumericColumn('ф', dataIndex + 'Fact', filters, ''),
makeNumericColumn('п', dataIndex + 'Plan', filters, width),
makeNumericColumn('ф', dataIndex + 'Fact', filters, width),
])
export const calcAndUpdateStats = (data: any, keys: any) => {

View File

@ -16,24 +16,7 @@ const filtersMinMax = [
},
]
const filtersSectionsType = [
{
text: "Направление",
value: "Направление",
},
{
text: "Кондуктор",
value: "Кондуктор",
},
{
text: "Транспорт. ствол",
value: "Транспорт. Ствол",
},
{
text: "Хвостовик",
value: "Хвостовик",
},
]
const filtersSectionsType = [ ]
const ModalWindowButton = ({buttonIcon, buttonText, modalTitle, modalContent}) =>{
const [isModalVisible, setIsModalVisible] = useState(false)
@ -72,7 +55,7 @@ const columns = [
makeNumericColumnPlanFact('Спуск КНБК', 'sectionBhaDownSpeed', filtersMinMax),//Скорость спуска КНБК
makeNumericColumnPlanFact('Подъем КНБК', 'sectionBhaUpSpeed', filtersMinMax),//Скорость подъема КНБК
makeNumericColumnPlanFact('Скорость спуска ОК', 'sectionCasingDownSpeed', filtersMinMax),
makeNumericColumnPlanFact('НПВ, сут', 'notProductiveTime', filtersMinMax),
makeNumericColumnPlanFact('НПВ, сут', 'nonProductiveTime', filtersMinMax, '70px'),
{
title: "TVD",
render: (_, record) => <ModalWindowButton
@ -117,18 +100,18 @@ export default function ClusterSections({clusterData}) {
"sectionBhaUpSpeedFact",
"sectionCasingDownSpeedPlan",
"sectionCasingDownSpeedFact",
"notProductiveTimePlan",
"notProductiveTimeFact"
"nonProductiveTimePlan",
"nonProductiveTimeFact"
])
useEffect(() => {
let resArr = []
let i = 1;
let rows = []
clusterData.statsWells?.forEach(el => {
el.sections.forEach(section => {
let row = {
key: section.id + i++,
id: section.id + i++,
key: el.caption + section.id,
id: el.caption + section.id,
caption: el.caption,
sectionType: section.caption,
sectionWellDepthPlan: section.plan.wellDepthEnd,
@ -147,16 +130,19 @@ export default function ClusterSections({clusterData}) {
sectionBhaUpSpeedFact: section.fact.bhaUpSpeed.toFixed(2),
sectionCasingDownSpeedPlan: section.plan.casingDownSpeed.toFixed(2),
sectionCasingDownSpeedFact: section.fact.casingDownSpeed.toFixed(2),
notProductiveTimePlan: section.plan.nonProductiveHours.toFixed(2),
notProductiveTimeFact: section.fact.nonProductiveHours.toFixed(2),
nonProductiveTimePlan: section.plan.nonProductiveHours.toFixed(2),
nonProductiveTimeFact: section.fact.nonProductiveHours.toFixed(2),
companies: el.companies
}
resArr.push(row)
rows.push(row)
if(!filtersSectionsType.some(el => el.text === section.caption))
filtersSectionsType.push({text: section.caption, value: section.caption})
})
})
setWellsStat(resArr)
setWellsStat(rows)
}, [id, clusterData])
@ -167,7 +153,7 @@ export default function ClusterSections({clusterData}) {
setSelectedWellsKeys(keys)
},
}
return (
<>
<Table

View File

@ -77,8 +77,8 @@ export default function ClusterWells({clusterData}) {
(_, item) => <Link to={`/well/${item.id}`}>{item.caption}</Link>),
makeTextColumn('Тип скв.', 'wellType', filtersWellsType),
makeGroupColumn( 'Фактические сроки', [
makeNumericColumn('начало', 'factStart', filtersMinMax),
makeNumericColumn('окончание', 'factEnd', filtersMinMax),
makeNumericColumn('начало', 'factStart'),
makeNumericColumn('окончание', 'factEnd'),
]),
makeNumericColumnPlanFact('Продолжительность', 'period', filtersMinMax),
makeNumericColumnPlanFact('МСП', 'rateOfPenetration', filtersMinMax),