2021-07-29 11:38:09 +05:00
|
|
|
export const makeColumn = (title:string, key:string, other?:any) => ({
|
2021-07-29 11:22:25 +05:00
|
|
|
title: title,
|
|
|
|
key: key,
|
|
|
|
dataIndex: key,
|
|
|
|
...other,
|
2021-07-29 15:15:09 +05:00
|
|
|
})
|
2021-07-29 11:22:25 +05:00
|
|
|
|
2021-07-29 11:38:09 +05:00
|
|
|
export const makeColumnsPlanFact = (title:string, keyPlan:string, keyFact?:string, gruopOther?:any) =>
|
2021-07-29 11:22:25 +05:00
|
|
|
{
|
|
|
|
let keyPlanLocal = keyPlan
|
2021-07-29 11:38:09 +05:00
|
|
|
let keyFactLocal = keyFact ?? ''
|
2021-07-29 11:22:25 +05:00
|
|
|
|
|
|
|
if(!keyFact){
|
|
|
|
keyPlanLocal = keyPlan + 'Plan'
|
|
|
|
keyFactLocal = keyPlan + 'Fact'
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
title: title,
|
|
|
|
...gruopOther,
|
|
|
|
children: [
|
|
|
|
makeColumn('план', keyPlanLocal),
|
|
|
|
makeColumn('факт', keyFactLocal),
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|