diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index 291c4a3..55f5c56 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx @@ -18,10 +18,10 @@ const navItems = [ { path: '/', label: '首页', icon: Home }, { path: '/process-matrix', label: '49过程矩阵', icon: LayoutGrid }, { path: '/process-practice', label: '过程背诵练习', icon: GraduationCap }, - { path: '/principles', label: '十二项原则', icon: BookMarked }, { path: '/knowledge-areas', label: '知识领域', icon: BookOpen }, { path: '/process-groups', label: '过程组', icon: Layers }, { path: '/process-graph', label: '过程关系图', icon: Share2 }, + { path: '/principles', label: '十二项原则', icon: BookMarked }, { path: '/settings', label: '设置', icon: Settings }, ] diff --git a/src/data/changelog.json b/src/data/changelog.json index 4b44fe0..48cd153 100644 --- a/src/data/changelog.json +++ b/src/data/changelog.json @@ -1,5 +1,12 @@ { "changelogEntries": [ + { + "id": "2026-03-18-principles-layout-fix", + "date": "2026-03-18", + "type": "fix", + "title": "修复十二项原则布局(sticky结构)、格子配色及菜单位置", + "scope": "整合" + }, { "id": "2026-03-18-principles-page", "date": "2026-03-18", diff --git a/src/pages/PrinciplesPage.tsx b/src/pages/PrinciplesPage.tsx index bd4c906..7dfe47e 100644 --- a/src/pages/PrinciplesPage.tsx +++ b/src/pages/PrinciplesPage.tsx @@ -413,208 +413,213 @@ export default function PrinciplesPage() { // ─── 渲染 ───────────────────────────────────────────────────── return ( -
-
+ // 与 ProcessPracticePage 保持相同的 flex-col 布局结构 +
- {/* 标题栏 */} -
-
-

- PMBOK 第七版 -

-

+ {/* 顶部粘性区:标题 + 进度条 */} +
+
+
+

十二项原则

-
- -
- {isPracticeMode && ( - - )} -
- - +
+ {isPracticeMode && ( + <> + + 进度:{answeredCount} / {principles.length} + + + + )} +
+ + +
-
- - {/* 进度条 */} - {isPracticeMode && ( -
-
+ {isPracticeMode && ( +
- - {answeredCount} / {principles.length} - -
- )} + )} +
+
+ + {/* 中间可滚动区:原则表格 */} +
+
+
+ + + + {principleGroups.map((group) => ( + + ))} + + + + {[0, 1, 2, 3].map((rowIdx) => ( + + {principleGroups.map((group) => { + const principle = group.items[rowIdx] + if (!principle) { + return ( + + ) + })} + + ))} + +
+ {group.label} +
+ ) + } + + const isAnswered = !!answeredCells.get(principle.id) + const isCurrent = + isPracticeMode && principle.id === currentPrincipleId + const isShowingAnswer = + showAnswerForCell?.principleId === principle.id - {/* 原则表格 */} -
- - - - {principleGroups.map((group) => ( - - ))} - - - - {[0, 1, 2, 3].map((rowIdx) => ( - - {principleGroups.map((group) => { - const principle = group.items[rowIdx] - if (!principle) { return ( - ) - })} - - ))} - -
- {group.label} -
- ) - } + key={principle.id} + className="border border-gray-200 dark:border-gray-700 p-0 align-top" + > +
+ {/* 原则名称列 */} + {isPracticeMode ? ( + + ) : ( +
+ {principle.name} +
+ )} - const isAnswered = !!answeredCells.get(principle.id) - const isCurrent = - isPracticeMode && principle.id === currentPrincipleId - const isShowingAnswer = - showAnswerForCell?.principleId === principle.id - - return ( -
-
- {/* 原则名称列 */} - {isPracticeMode ? ( - - ) : ( -
- {principle.name} + {/* 描述列 */} +
+

+ {principle.description} +

- )} - - {/* 描述列 */} -
-

- {principle.description} -

-
-
-
- - {/* 练习输入区 */} - {isPracticeMode && currentPrinciple && ( -
-
-

- 当前提示 · {currentPrinciple.categoryId === 'people' ? '人' : currentPrinciple.categoryId === 'environment' ? '环境' : '事'} -

-

- {currentPrinciple.description} -

-
- -
- -
- -

- 长按单元格 / Ctrl+H 查看答案 · Tab / Shift+Tab 切换题目 · Esc 清空输入 -

+
- )} +
+ {/* 底部粘性区:练习输入(与 ProcessPracticePage 结构一致) */} + {isPracticeMode && currentPrinciple && ( +
+
+
+
+ + +
+
+
+ {currentPrinciple.description} + + · 长按格子 / Ctrl+H 查看答案 · Tab 切换 + +
+
+
+ )} + {/* 无障碍播报区 */}