diff --git a/src/components/DocumentCockpit.tsx b/src/components/DocumentCockpit.tsx index b3da2b2..8a32602 100644 --- a/src/components/DocumentCockpit.tsx +++ b/src/components/DocumentCockpit.tsx @@ -70,6 +70,8 @@ export function DocumentCockpit() { // rdm.project.list 返回 { projects: [...] };容忍裸数组形态。 const rows = Array.isArray(list) ? list : (list?.projects ?? []) setProjects(rows) + // 设计 §6.2:进入驾驶舱默认选中第一个可见项目,驱动概览首屏。 + if (rows.length > 0) setPid(prev => prev || rows[0].id) }) .catch(e => { if (!c) setError(e.message) }) return () => { c = true }