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), ] } }