From f73babef8a18fb3ccfd82dd9f991ae06c1b8284c Mon Sep 17 00:00:00 2001 From: Emrys <219520811+Emryswu@users.noreply.github.com> Date: Mon, 19 Oct 2026 19:03:44 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E7=99=BB=E5=BD=95=E9=A1=B5?= =?UTF-8?q?=E4=B8=8E=E6=93=8D=E4=BD=9C=E5=AE=A1=E8=AE=A1=E9=A1=B5=E6=8C=89?= =?UTF-8?q?=E6=95=88=E6=9E=9C=E5=9B=BE=E6=94=B9=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 登录页:顶部深色品牌栏,左侧复用首页实验室横幅与三条卖点,右侧圆角登录卡片; 快速体验改为四张角色卡片(图标、说明、选中态),只保留系统真实具备的功能 - 审计页:首页同款横幅,表格列出时间、操作图标、中文角色标签、详情与对象、操作人; 支持按角色与操作类型筛选、分页,详情里的状态码显示为中文 - 后端 /api/audit-logs 新增 actorRole 筛选,集成测试覆盖与 action 组合 - 补齐支付、退款、对账等审计动作的中文名;角色图标与配色抽成 roleTag 共用 - 弹窗关闭按钮改用 Icon - 测试:扫描后端代码确认每个审计动作都有中文名;演示账号与种子数据一致; 筛选项不随当前行变化;翻页沿用已应用的筛选;慢响应不覆盖新页 --- frontend/app/components/LoginView.tsx | 86 +++--- frontend/app/components/icons.tsx | 4 + frontend/app/components/roleTag.tsx | 26 ++ frontend/app/components/ui.tsx | 6 +- frontend/app/components/views/AuditView.tsx | 114 +++++++- frontend/app/globals.css | 117 +++++--- frontend/app/lib/labels.ts | 31 +++ frontend/app/page.tsx | 41 ++- frontend/tests/login-audit.test.mjs | 263 ++++++++++++++++++ frontend/tests/session-isolation.test.mjs | 2 +- .../labops/audit/OperationLogController.java | 3 +- .../audit/OperationLogQueryService.java | 10 +- .../BusinessOperationsIntegrationTest.java | 18 ++ 13 files changed, 630 insertions(+), 91 deletions(-) create mode 100644 frontend/app/components/roleTag.tsx create mode 100644 frontend/tests/login-audit.test.mjs diff --git a/frontend/app/components/LoginView.tsx b/frontend/app/components/LoginView.tsx index 5f1eacf..9a5eaf1 100644 --- a/frontend/app/components/LoginView.tsx +++ b/frontend/app/components/LoginView.tsx @@ -1,9 +1,25 @@ import type { FormEvent } from "react"; import type { ToastState } from "../lib/types"; +import { Icon, type IconName } from "./icons"; +import { roleStyle } from "./roleTag"; import { Brand, Toast } from "./ui"; type LoginState = { username: string; password: string }; +/** Seeded demo accounts (DemoUserInitializer); a card fills the form so the visitor can sign in at once. */ +export const DEMO_ACCOUNTS = [ + { role: "STUDENT", label: "学生", note: "查看设备,提交预约与报修", username: "student", password: "student123" }, + { role: "TEACHER", label: "教师", note: "审批预约,管理实验设备", username: "teacher", password: "teacher123" }, + { role: "TECHNICIAN", label: "维修员", note: "接单处理,跟踪工单进度", username: "technician", password: "tech123" }, + { role: "ADMIN", label: "管理员", note: "全局管理、支付对账与审计", username: "admin", password: "admin123" }, +] as const; + +const STORY_POINTS: { icon: IconName; text: string }[] = [ + { icon: "box", text: "设备状态一眼看清" }, + { icon: "calendar", text: "预约冲突实时拦截" }, + { icon: "wrench", text: "故障进度全程追踪" }, +]; + export function LoginView({ login, busy, toast, onLoginChange, onSubmit, onDemo }: { login: LoginState; busy: boolean; @@ -13,37 +29,45 @@ export function LoginView({ login, busy, toast, onLoginChange, onSubmit, onDemo onDemo: (username: string, password: string) => void; }) { return
-
- -
- LAB OPERATIONS GRID / 2026 -

设备预约与维护,
一张工作台搞定。

-

用清晰的排期、设备状态和维修进度,让实验室每天都按计划运转。

-
-
-
01 / 排期预约冲突实时拦截
-
02 / 设备运行状态一眼识别
-
03 / 维修故障进度全程追踪
-
-
-
- -
- SECURE ACCESS / 安全访问 -

进入设备运行台

-

使用实验室账号进入对应角色空间

- - - -
快速体验角色
-
- - - - -
-
-
+
+
+
+