forked from ddrilling/asb_cloud_front
26 lines
566 B
TypeScript
26 lines
566 B
TypeScript
export const makeColumn = (title:string, key:string, other?:any) => ({
|
|
title: title,
|
|
key: key,
|
|
dataIndex: key,
|
|
...other,
|
|
});
|
|
|
|
export const makeColumnsPlanFact = (title:string, keyPlan:string, keyFact?:string, gruopOther?:any) =>
|
|
{
|
|
let keyPlanLocal = keyPlan
|
|
let keyFactLocal = keyFact ?? ''
|
|
|
|
if(!keyFact){
|
|
keyPlanLocal = keyPlan + 'Plan'
|
|
keyFactLocal = keyPlan + 'Fact'
|
|
}
|
|
|
|
return {
|
|
title: title,
|
|
...gruopOther,
|
|
children: [
|
|
makeColumn('план', keyPlanLocal),
|
|
makeColumn('факт', keyFactLocal),
|
|
]
|
|
}
|
|
} |