forked from ddrilling/asb_cloud_front
Add components factory
This commit is contained in:
parent
9273e82f19
commit
611244edee
26
src/components/factory.js
Normal file
26
src/components/factory.js
Normal file
@ -0,0 +1,26 @@
|
||||
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),
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user