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