2D布局回退状态判定: 父WIP→并行同Y / 父COMPLETED→串行换行(后端已限制COMPLETED后不可spawn)
This commit is contained in:
@ -66,12 +66,10 @@ export default {
|
||||
const layout = (tasks, parentRowIdx, parentX) => {
|
||||
if (!tasks || !tasks.length) return;
|
||||
tasks.forEach(t => {
|
||||
// 时间戳判定:子任务创建于父任务完成之后 → 串行(下一行);否则 → 并行(同Y偏右)
|
||||
const parentNode = this.taskDataMap[t.parent_task_id];
|
||||
const isSerial = !t.parent_task_id || (
|
||||
parentNode && parentNode.completed_at &&
|
||||
new Date(t.created_at) > new Date(parentNode.completed_at)
|
||||
);
|
||||
// 工业拓扑:父WIP→并行(同Y);父COMPLETED→串行(换行)
|
||||
// 后端保证 COMPLETED 后不可 spawn,故 COMPLETED 的子任务必为转交产物
|
||||
const parent = this.taskDataMap[t.parent_task_id];
|
||||
const isSerial = !t.parent_task_id || (parent && parent.status === 'COMPLETED');
|
||||
const rowIdx = isSerial ? (parentRowIdx >= 0 ? parentRowIdx + 1 : rows.length) : parentRowIdx;
|
||||
while (rows.length <= rowIdx) rows.push({ y: 0, tasks: [] });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user