From 1dc10f569dbb61db31a85ef8941708ac9c92c80e Mon Sep 17 00:00:00 2001 From: Cheng Zhou Date: Thu, 9 Jul 2026 14:59:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=BD=91=E9=A1=B5=E7=AB=AF):=20=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E7=99=BB=E5=BD=95=E5=90=8E=E5=B7=A5=E4=BD=9C=E5=8F=B0?= =?UTF-8?q?=E4=B8=8E=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/index.html | 2 +- .../src/components/Layout.desktop.test.ts | 14 + frontend/src/components/StudySelector.vue | 76 +- frontend/src/components/WebLayout.vue | 82 +- frontend/src/main.test.ts | 3 +- frontend/src/router.test.ts | 36 +- frontend/src/router/index.ts | 59 +- .../src/views/DesktopProjectEntry.test.ts | 2 + frontend/src/views/DesktopProjectEntry.vue | 2 +- frontend/src/views/Login.test.ts | 14 +- frontend/src/views/Login.vue | 15 +- frontend/src/views/WebWorkbenchEntry.test.ts | 31 + frontend/src/views/WebWorkbenchEntry.vue | 1232 +++++++++++++++++ frontend/src/views/admin/Projects.test.ts | 14 +- frontend/src/views/admin/Projects.vue | 21 +- 15 files changed, 1418 insertions(+), 185 deletions(-) create mode 100644 frontend/src/views/WebWorkbenchEntry.test.ts create mode 100644 frontend/src/views/WebWorkbenchEntry.vue diff --git a/frontend/index.html b/frontend/index.html index 066879be..4c164dd6 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -65,7 +65,7 @@
CTMS

正在启动 CTMS

-

正在加载桌面客户端...

+

正在加载系统...

diff --git a/frontend/src/components/Layout.desktop.test.ts b/frontend/src/components/Layout.desktop.test.ts index 96cc53f0..255cfb41 100644 --- a/frontend/src/components/Layout.desktop.test.ts +++ b/frontend/src/components/Layout.desktop.test.ts @@ -67,6 +67,20 @@ describe("desktop layout shell", () => { expect(navigation).toContain("export const getActiveLayoutPath"); }); + it("keeps web project switching routed through the workbench entry", () => { + const webLayout = readWebLayoutSource(); + + expect(webLayout).toContain('class="workbench-return-button"'); + expect(webLayout).toContain('await router.push("/workbench")'); + expect(webLayout).toContain("const showAdminNavigation = computed(() => Boolean(auth.user) && (!study.currentStudy || isAdminContext.value))"); + expect(webLayout).not.toContain("hasDropdown: true"); + expect(webLayout).not.toContain("type: 'study'"); + expect(webLayout).not.toContain('type: "study"'); + expect(webLayout).not.toContain("`切换项目:${item.name}`"); + expect(webLayout).not.toContain("study.setCurrentStudy(cmd.value)"); + expect(webLayout).not.toContain('router.push("/project/overview");'); + }); + it("keeps desktop context labels and command entry points de-duplicated", () => { const source = readDesktopLayoutSource(); diff --git a/frontend/src/components/StudySelector.vue b/frontend/src/components/StudySelector.vue index f30c7e48..7d5460df 100644 --- a/frontend/src/components/StudySelector.vue +++ b/frontend/src/components/StudySelector.vue @@ -7,23 +7,8 @@ @@ -31,48 +16,20 @@ diff --git a/frontend/src/components/WebLayout.vue b/frontend/src/components/WebLayout.vue index 710ed978..e2dc18ba 100644 --- a/frontend/src/components/WebLayout.vue +++ b/frontend/src/components/WebLayout.vue @@ -22,7 +22,7 @@ - + @@ -141,25 +141,8 @@