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>
|
||||
|
||||
@ -412,12 +412,15 @@ export default function AdminTasksPage() {
|
||||
{/* 最新动态 */}
|
||||
<div className="col-span-2 text-xs">
|
||||
{p.latest_record_time ? (
|
||||
<Tooltip title={(p.latest_record_content || "") + (p.latest_record_has_images ? " [含图片]" : "")}>
|
||||
<Tooltip title={(p.latest_record_assignee_name ? `${p.latest_record_assignee_name}: ` : "") + (p.latest_record_content || "") + (p.latest_record_has_images ? " [含图片]" : "")}>
|
||||
<div className="cursor-default">
|
||||
<div className="text-[10px] text-gray-400">{new Date(p.latest_record_time).toLocaleString("zh-CN", { month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit" })}</div>
|
||||
<div className="mt-0.5 flex items-center gap-1 truncate text-[11px] text-gray-600">
|
||||
{p.latest_record_has_images && <span className="shrink-0">📷</span>}
|
||||
<span className="truncate">{p.latest_record_content || (p.latest_record_has_images ? "图片记录" : "—")}</span>
|
||||
<span className="truncate">
|
||||
{p.latest_record_assignee_name && <span className="font-medium text-gray-700">{p.latest_record_assignee_name}: </span>}
|
||||
{p.latest_record_content || (p.latest_record_has_images ? "图片记录" : "—")}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</Tooltip>
|
||||
|
||||
@ -21,6 +21,8 @@ export interface ProductResponse {
|
||||
latest_record_time: string | null;
|
||||
latest_record_content: string | null;
|
||||
latest_record_has_images: boolean;
|
||||
latest_record_assignee_id: string | null;
|
||||
latest_record_assignee_name: string | null;
|
||||
}
|
||||
|
||||
/** MOM 物料选项 */
|
||||
|
||||
Reference in New Issue
Block a user