共3个回答
OI
游客oiHIeZ
可以的,参见:https://github.com/neuronetio/gantt-elastic/pull/69
添加“group”任务类型和组件,并在group中的tasks上赋值一个数组。
模型样例:
{
id: 1,
label: 'Make some noise',
user:
'<a href="https://www.google.com/search?q=John+Doe" target="_blank" style="color:#0077c0;">John Doe</a>',
start: getDate(-24 * 5),
duration: 15 * 24 * 60 * 60 * 1000,
percent: 85,
type: 'project',
},
{
id: 2,
label: 'Group',
user: '<a href="https://www.google.com/search?q=Clark+Kent" target="_blank" style="color:#0077c0;">Clark Kent</a>',
start: getDate(-24 * 2),
duration: 6 * 24 * 60 * 60 * 1000,
percent: 25,
type: 'group',
tasks: [
{
id: 21,
label: 'Group subtask 1',
user: '<a href="https://www.google.com/search?q=Clark+Kent" target="_blank" style="color:#0077c0;">Clark Kent</a>',
start: getDate(-24 * 2),
duration: 2 * 24 * 60 * 60 * 1000,
percent: 50,
type: 'project',
},
{
id: 22,
label: 'Group subtask 2',
user: '<a href="https://www.google.com/search?q=Clark+Kent" target="_blank" style="color:#0077c0;">Clark Kent</a>',
start: getDate(24 * 2),
duration: 2 * 24 * 60 * 60 * 1000,
percent: 50,
type: 'task',
},
],
},