From 4aa1eb00b6c8c9c3bcbc5418d8fe0ae7d6dc7118 Mon Sep 17 00:00:00 2001 From: Cheng Zhou Date: Thu, 2 Jul 2026 15:52:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(desktop):=20=E6=94=B6=E5=8F=A3=E6=A1=8C?= =?UTF-8?q?=E9=9D=A2=E5=B7=A5=E4=BD=9C=E5=8F=B0=E8=A7=86=E8=A7=89=E4=B8=8E?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=8F=8D=E9=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/scripts/verify-desktop-release.mjs | 10 + frontend/src-tauri/tauri.conf.json | 6 +- .../src/audit/export/auditExportService.ts | 18 +- frontend/src/components/DesktopLayout.vue | 383 ++++++++++++-- .../src/components/Layout.desktop.test.ts | 81 ++- .../src/components/PermissionAccessLogs.vue | 9 +- .../components/attachments/AttachmentList.vue | 82 ++- .../src/session/desktopActivityCenter.test.ts | 64 +++ frontend/src/session/desktopActivityCenter.ts | 134 +++++ .../src/session/desktopUpdateManager.test.ts | 21 + frontend/src/session/desktopUpdateManager.ts | 49 +- frontend/src/styles/main.css | 231 ++++++++ frontend/src/utils/fileTaskFeedback.test.ts | 52 +- frontend/src/utils/fileTaskFeedback.ts | 79 ++- .../src/views/documents/DocumentList.test.ts | 30 ++ frontend/src/views/documents/DocumentList.vue | 459 +++++++++++++--- frontend/src/views/ia/DrugShipments.test.ts | 32 ++ frontend/src/views/ia/DrugShipments.vue | 500 +++++++++++++++--- .../views/ia/RiskIssueMonitoringVisits.vue | 9 +- 19 files changed, 2027 insertions(+), 222 deletions(-) create mode 100644 frontend/src/session/desktopActivityCenter.test.ts create mode 100644 frontend/src/session/desktopActivityCenter.ts diff --git a/frontend/scripts/verify-desktop-release.mjs b/frontend/scripts/verify-desktop-release.mjs index adf48e35..93d2b92d 100644 --- a/frontend/scripts/verify-desktop-release.mjs +++ b/frontend/scripts/verify-desktop-release.mjs @@ -71,6 +71,13 @@ const verifyTauriConfig = async () => { assert(!/\bconnect-src\b[^;]*\bhttp:\b/.test(csp), "Tauri CSP must not allow broad http: API access."); assert(mainWindow?.minWidth === 1180, "Main desktop window must keep the minimum width at 1180."); assert(mainWindow?.minHeight === 760, "Main desktop window must keep the minimum height at 760."); + assert(mainWindow?.decorations === true, "Main desktop window must keep native window decorations enabled."); + assert(mainWindow?.titleBarStyle === "Overlay", "Main desktop window must use the macOS overlay title bar."); + assert(mainWindow?.hiddenTitle === true, "Main desktop window must hide the native title text."); + assert( + mainWindow?.trafficLightPosition?.x === 16 && mainWindow?.trafficLightPosition?.y === 18, + "Main desktop window must keep traffic light controls at x=16 y=18.", + ); }; const verifyCapabilities = async () => { @@ -118,6 +125,9 @@ const verifyCapabilities = async () => { `${file}: notification permission ${identifier} is broader than the CTMS Desktop notification boundary.`, ); } + if (identifier.startsWith("core:window:")) { + fail(`${file}: window permissions are not allowed; use Tauri overlay drag regions instead.`); + } if (identifier.startsWith("opener:")) { assert(identifier === "opener:allow-open-path", `${file}: opener permission ${identifier} is not allowed.`); } diff --git a/frontend/src-tauri/tauri.conf.json b/frontend/src-tauri/tauri.conf.json index 238281de..05c6042b 100644 --- a/frontend/src-tauri/tauri.conf.json +++ b/frontend/src-tauri/tauri.conf.json @@ -17,7 +17,11 @@ "width": 1440, "height": 900, "minWidth": 1180, - "minHeight": 760 + "minHeight": 760, + "decorations": true, + "titleBarStyle": "Overlay", + "hiddenTitle": true, + "trafficLightPosition": { "x": 16, "y": 18 } } ], "security": { diff --git a/frontend/src/audit/export/auditExportService.ts b/frontend/src/audit/export/auditExportService.ts index b6c1182b..5943e2ca 100644 --- a/frontend/src/audit/export/auditExportService.ts +++ b/frontend/src/audit/export/auditExportService.ts @@ -24,9 +24,17 @@ export const exportAuditCsv = async (events: AuditEvent[], options: AuditExportO const rows = formatAuditRows(events); const csv = buildCsv(rows); const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" }); - await saveFileWithFeedback({ - suggestedName: options.fileName.endsWith(".csv") ? options.fileName : `${options.fileName}.csv`, - mimeType: "text/csv;charset=utf-8", - data: blob, - }); + await saveFileWithFeedback( + { + suggestedName: options.fileName.endsWith(".csv") ? options.fileName : `${options.fileName}.csv`, + mimeType: "text/csv;charset=utf-8", + data: blob, + }, + { + kind: "export", + title: "导出审计记录", + pendingDetail: "等待选择保存位置", + completedDetail: "导出文件已保存", + }, + ); }; diff --git a/frontend/src/components/DesktopLayout.vue b/frontend/src/components/DesktopLayout.vue index 4095a5b1..001f8f12 100644 --- a/frontend/src/components/DesktopLayout.vue +++ b/frontend/src/components/DesktopLayout.vue @@ -4,8 +4,7 @@