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 15:17:54 +05:00
|
|
|
export const makeColumnsPlanFact = (title:string, keyPlan:string, keyFact?:string, groupOther?: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,
|
2021-07-29 15:17:54 +05:00
|
|
|
...groupOther,
|
2021-07-29 11:22:25 +05:00
|
|
|
children: [
|
|
|
|
makeColumn('план', keyPlanLocal),
|
|
|
|
makeColumn('факт', keyFactLocal),
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|