From 542ec296c7ba52d72bbb0e386672124cd7be4e5c Mon Sep 17 00:00:00 2001 From: GJ Date: Fri, 4 Sep 2026 19:41:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=B6=E5=8F=A3=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E4=BE=A7=E6=A0=8F=E4=B8=8E=E5=88=9B=E4=BD=9C=E6=8B=86?= =?UTF-8?q?=E8=A7=A3=E9=A1=B5=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 71 ++++++++++------ src/components/ui/WorkspaceTools.vue | 4 +- src/features/breakdown/BreakdownPage.vue | 80 +++++++++++++++++-- .../breakdown/components/SubjectList.vue | 22 ++++- src/features/create-drama/CreateDramaPage.vue | 14 +++- src/features/create-drama/EpisodeReader.vue | 20 ++++- src/features/workflows/HistoryPanel.vue | 22 ++++- src/styles/admin.css | 6 ++ tests/components/ui/layout.test.ts | 35 +++++++- .../features/breakdown/BreakdownPage.test.ts | 14 +++- .../create-drama/EpisodeReader.test.ts | 3 +- tests/features/workflows/pages.test.ts | 8 ++ 12 files changed, 250 insertions(+), 49 deletions(-) diff --git a/src/App.vue b/src/App.vue index c14af74..d2eb7af 100644 --- a/src/App.vue +++ b/src/App.vue @@ -38,10 +38,12 @@ const NARROW_NAV = '(max-width: 800px)' const SIDER_COLLAPSED_WIDTH = 64 /** 展开侧栏宽度,窄屏裁切动画以内层保持该宽度。 */ const SIDER_EXPANDED_WIDTH = 208 +/** 窄屏折叠侧栏宽度,给正文多留空间,仍覆盖 44px 点击区。 */ +const SIDER_COLLAPSED_WIDTH_NARROW = 48 +/** 窄屏展开侧栏宽度。 */ +const SIDER_EXPANDED_WIDTH_NARROW = 168 /** 菜单图标尺寸,折叠/展开共用,避免切换时缩放。 */ const NAV_ICON_SIZE = 20 -/** 折叠与展开共用的图标左偏移,避免切换时图标跳动。 */ -const NAV_ICON_INDENT = SIDER_COLLAPSED_WIDTH / 2 - NAV_ICON_SIZE / 2 /** 应用外壳固定在视口内,业务数据仍由各工作区自行加载。 */ const route = useRoute() @@ -51,6 +53,12 @@ const collapsed = ref(narrow.value) const settingsOpen = ref(false) /** 窄屏折叠只裁切文字,不把菜单收成图标,避免推挤动画时错位。 */ const menuCollapsed = computed(() => !narrow.value && collapsed.value) +/** 当前视口下的折叠侧栏宽度。 */ +const siderCollapsedWidth = computed(() => (narrow.value ? SIDER_COLLAPSED_WIDTH_NARROW : SIDER_COLLAPSED_WIDTH)) +/** 当前视口下的展开侧栏宽度。 */ +const siderExpandedWidth = computed(() => (narrow.value ? SIDER_EXPANDED_WIDTH_NARROW : SIDER_EXPANDED_WIDTH)) +/** 折叠与展开共用的图标左偏移,避免切换时图标跳动。 */ +const navIconIndent = computed(() => siderCollapsedWidth.value / 2 - NAV_ICON_SIZE / 2) /** 视口跨过断点时:进入窄屏收回侧栏。 */ function syncNarrow(event: MediaQueryListEvent) { @@ -144,19 +152,25 @@ const menuOptions = computed(() => [