fix(web): 列表最新动态显示操作人、流转树焦点模式保留活跃并发分支
This commit is contained in:
@ -164,9 +164,14 @@ export const TaskFlowView = memo(function TaskFlowView({ tasks, onAction, curren
|
||||
// 🚀 焦点模式 vs 全景模式:共用同一套垂直时间线布局,仅数据过滤不同
|
||||
const visibleMains = useMemo(() => {
|
||||
if (showFullMap) return allMains;
|
||||
// 焦点模式:过滤掉已完成/已入库的历史主线,保留活跃主线 + 所有协助分支
|
||||
return allMains.filter(t => active(t.status));
|
||||
}, [allMains, showFullMap]);
|
||||
// 焦点模式:保留自身活跃的主线,或含活跃分支(后代)的主线,
|
||||
// 避免「主线已完成、但并发协助分支仍在进行中」时整条分支被错误隐藏
|
||||
const hasActiveDescendant = (node: TaskResponse): boolean => {
|
||||
const kids = childMap[node.id] || [];
|
||||
return kids.some(k => active(k.status) || hasActiveDescendant(k));
|
||||
};
|
||||
return allMains.filter(t => active(t.status) || hasActiveDescendant(t));
|
||||
}, [allMains, childMap, showFullMap]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user