export const makeColumn = (title:string, key:string, other?:any) => ({ title: title, key: key, dataIndex: key, ...other, }) export const makeColumnsPlanFact = (title:string, key:string|string[], gruopOther?:any, columsOther?:any|any[]) => { let keyPlanLocal = key let keyFactLocal = key if(key instanceof Array){ keyPlanLocal = key[0] keyFactLocal = key[1] }else{ keyPlanLocal = key + 'Plan' keyFactLocal = key + 'Fact' } let columsOtherLoacl :any[2] if(columsOther instanceof Array) columsOtherLoacl = [columsOther[0], columsOther[1]] else columsOtherLoacl = [columsOther, columsOther] return { title: title, ...gruopOther, children: [ makeColumn('план', keyPlanLocal, columsOtherLoacl[0]), makeColumn('факт', keyFactLocal, columsOtherLoacl[1]), ] } }