From bc4a89258eaec22cb7af6676581780802b521c63 Mon Sep 17 00:00:00 2001 From: tony Date: Thu, 15 Jan 2026 10:37:50 +0800 Subject: [PATCH] =?UTF-8?q?gitignore=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- training-system/README.md | 157 +++++++++++- training-system/agents/architect.md | 31 +++ training-system/agents/backend.md | 30 +++ training-system/agents/devops.md | 20 ++ training-system/agents/doc.md | 28 +++ training-system/agents/frontend.md | 28 +++ training-system/agents/pm.md | 32 +++ training-system/agents/qa.md | 29 +++ training-system/agents/security.md | 29 +++ training-system/agents/supervisor.md | 34 +++ training-system/docs/Prompt/PM_Prompt.md | 3 + .../src/main/resources/static/css/common.css | 225 +++++++++++------- .../src/main/resources/static/exam/edit.html | 17 +- .../src/main/resources/static/exam/list.html | 17 +- .../main/resources/static/exam/my-exams.html | 14 +- .../resources/static/exam/paper-edit.html | 17 +- .../resources/static/exam/paper-preview.html | 17 +- .../src/main/resources/static/exam/paper.html | 17 +- .../static/exam/question-category.html | 17 +- .../resources/static/exam/question-edit.html | 17 +- .../main/resources/static/exam/question.html | 17 +- .../main/resources/static/exam/result.html | 14 +- .../src/main/resources/static/index.html | 77 +----- .../src/main/resources/static/js/common.js | 207 +++++++++++----- .../resources/static/knowledge/category.html | 38 +-- .../main/resources/static/knowledge/list.html | 72 +----- .../main/resources/static/knowledge/view.html | 14 +- .../src/main/resources/static/login.html | 25 +- .../src/main/resources/static/system/org.html | 22 +- .../main/resources/static/system/user.html | 23 +- .../resources/static/training/detail.html | 78 +++--- .../static/training/my-training.html | 14 +- .../resources/static/training/plan-edit.html | 17 +- .../main/resources/static/training/plan.html | 17 +- 34 files changed, 823 insertions(+), 591 deletions(-) create mode 100644 training-system/agents/architect.md create mode 100644 training-system/agents/backend.md create mode 100644 training-system/agents/devops.md create mode 100644 training-system/agents/doc.md create mode 100644 training-system/agents/frontend.md create mode 100644 training-system/agents/pm.md create mode 100644 training-system/agents/qa.md create mode 100644 training-system/agents/security.md create mode 100644 training-system/agents/supervisor.md diff --git a/training-system/README.md b/training-system/README.md index 609ade3..67c2868 100644 --- a/training-system/README.md +++ b/training-system/README.md @@ -1,18 +1,137 @@ -# 培训系统 (Peixun) +# 道路救援企业培训系统 -基于 Spring Boot 3.1.2 的企业级培训管理系统 +> 版本:V1.0.1 | 基于 Spring Boot 3.1.2 + +为道路救援企业打造的一站式内部培训平台,通过知识沉淀、在线考核、培训管理三大核心能力,提升员工专业技能水平和服务标准化程度。 + +--- ## 技术栈 -- **Java**: 17 -- **构建工具**: Maven -- **框架**: Spring Boot 3.1.2 -- **ORM**: MyBatis Plus 3.5.3.1 -- **数据库**: MySQL 8.0.33 -- **API文档**: Springdoc OpenAPI 2.2.0 -- **序列化**: Jackson -- **工具库**: Lombok +| 类别 | 技术 | 版本 | +|-----|------|------| +| 语言 | Java | 17 | +| 构建 | Maven | 3.6+ | +| 框架 | Spring Boot | 3.1.2 | +| ORM | MyBatis Plus | 3.5.3.1 | +| 数据库 | MySQL | 8.0+ | +| 认证 | JWT (java-jwt) | 4.4.0 | +| API文档 | Springdoc OpenAPI | 2.2.0 | +| 工具库 | Lombok、Hutool | - | +--- + +## 功能模块 + +| 模块 | 功能说明 | +|-----|---------| +| **人员管理** | 组织架构(中心→部门→小组)、员工管理、角色权限 | +| **知识库** | 文档/视频上传、在线预览、分类管理、状态流转 | +| **考题管理** | 单选/多选/判断题、题目解析、题库分类 | +| **试卷管理** | 手动组卷、自动组卷、试卷预览 | +| **考试管理** | 发布考试、指定对象、在线答题、自动阅卷 | +| **培训计划** | 关联多个知识+多个考试、分配学员、进度跟踪 | + +--- + +## 快速开始 + +### 环境要求 + +- JDK 17+ +- Maven 3.6+ +- MySQL 8.0+ + +### 1. 克隆项目 + +```bash +git clone +cd training-system +``` + +### 2. 初始化数据库 + +```sql +CREATE DATABASE training_system DEFAULT CHARACTER SET utf8mb4; +USE training_system; +SOURCE sql/init.sql; +``` + +### 3. 修改配置 + +编辑 `src/main/resources/application.yml`,配置数据库连接: + +```yaml +spring: + datasource: + url: jdbc:mysql://localhost:3306/training_system + username: root + password: 你的密码 +``` + +### 4. 启动应用 + +```bash +mvn spring-boot:run +``` + +### 5. 访问系统 + +- 系统地址:http://localhost:8080 +- API文档:http://localhost:8080/swagger-ui.html +- 默认账号:`admin` / `123456` + +--- + +## 生产部署 + +### 打包 + +```bash +mvn clean package -DskipTests +``` + +生成文件:`target/training-system-1.0.0.jar` + +### Linux部署 + +```bash +# 上传JAR包和SQL脚本到服务器 +scp target/training-system-1.0.0.jar user@server:/opt/training/ +scp sql/init.sql user@server:/opt/training/ + +# 创建生产配置 /opt/training/application-prod.yml +# 启动应用 +java -jar training-system-1.0.0.jar --spring.profiles.active=prod +``` + +详细部署指南见 [部署文档](docs/Deploy.md) + +--- + +## 项目结构 + +``` +training-system/ +├── src/main/java/com/sino/training/ +│ ├── common/ # 公共模块(配置、异常、工具类) +│ ├── module/ +│ │ ├── system/ # 系统模块(用户、部门、小组) +│ │ ├── knowledge/ # 知识库模块 +│ │ ├── exam/ # 考试模块(题目、试卷、考试) +│ │ └── training/ # 培训计划模块 +│ └── TrainingApplication.java +├── src/main/resources/ +│ ├── static/ # 前端静态资源 +│ ├── application.yml # 配置文件 +│ └── mapper/ # MyBatis XML +├── sql/ +│ └── init.sql # 数据库初始化脚本 +├── docs/ # 项目文档 +└── pom.xml +``` + +--- ## 编码规范 @@ -21,6 +140,20 @@ - Service + Impl 负责业务处理 - Mapper 只做数据访问 - 必须使用 Lombok 简化代码 -- 所有代码必须可读、可维护、有必要注释 -- 生成的代码必须可直接运行 +--- + +## 相关文档 + +- [产品需求文档 (PRD)](docs/PRD.md) +- [低层级需求文档 (LLR)](docs/LLR.md) +- [测试计划](docs/TestPlan.md) + +--- + +## 版本记录 + +| 版本 | 日期 | 更新内容 | +|-----|------|---------| +| V1.0.1 | 2026-01-13 | 培训计划支持多考试任务 | +| V1.0.0 | 2026-01-08 | 初始版本发布 | diff --git a/training-system/agents/architect.md b/training-system/agents/architect.md new file mode 100644 index 0000000..3052ae8 --- /dev/null +++ b/training-system/agents/architect.md @@ -0,0 +1,31 @@ +# Role: Architect Agent(系统架构师) + +## 你的身份 +你是系统架构师,负责整体技术设计。 + +## 你的目标 +- 设计清晰、可扩展的系统架构 +- 降低长期复杂度 + +## 你可以做的事 +- 技术选型 +- 系统拆分 +- 定义模块边界和接口规范 + +## 你不能做的事 +- 不实现具体业务逻辑 +- 不写完整功能代码 + +## 输入 +- requirements.md +- Supervisor 指令 + +## 输出 +- architecture.md +- 目录结构建议 +- API 设计说明 + +## 工作规则 +- 设计必须支持未来扩展 +- 避免过度设计 +- 明确模块职责 \ No newline at end of file diff --git a/training-system/agents/backend.md b/training-system/agents/backend.md new file mode 100644 index 0000000..c2a28c5 --- /dev/null +++ b/training-system/agents/backend.md @@ -0,0 +1,30 @@ +# Role: Backend Agent(后端工程师) + +## 你的身份 +你是后端工程师,只负责实现后端业务逻辑。 + +## 你的目标 +- 按架构和需求实现稳定、可测试的代码 + +## 你可以做的事 +- 编写业务代码 +- 实现 API +- 编写必要的单元测试 + +## 你不能做的事 +- 不更改架构设计 +- 不新增未经批准的功能 + +## 输入 +- architecture.md +- requirements.md +- Supervisor 指令 + +## 输出 +- 后端源码 +- 测试代码 + +## 工作规则 +- 代码必须可读 +- 必须遵循项目规范 +- 所有假设必须说明 \ No newline at end of file diff --git a/training-system/agents/devops.md b/training-system/agents/devops.md new file mode 100644 index 0000000..08e7915 --- /dev/null +++ b/training-system/agents/devops.md @@ -0,0 +1,20 @@ +# Role: DevOps Agent(部署与运维) + +## 你的身份 +你负责系统交付与运行环境。 + +## 你的目标 +- 系统可部署、可回滚、可监控 + +## 输入 +- 架构设计 +- 运行要求 + +## 输出 +- 部署方案 +- CI/CD 建议 +- 环境说明 + +## 工作规则 +- 优先稳定性 +- 避免复杂配置 \ No newline at end of file diff --git a/training-system/agents/doc.md b/training-system/agents/doc.md new file mode 100644 index 0000000..15555ff --- /dev/null +++ b/training-system/agents/doc.md @@ -0,0 +1,28 @@ +# Role: Doc Agent(文档工程师) + +## 你的身份 +你是项目文档负责人。 + +## 你的目标 +- 让人和 AI 都能快速理解项目 + +## 你可以做的事 +- 编写 README +- 编写使用说明和开发规范 + +## 你不能做的事 +- 不修改代码 +- 不解释未实现的功能 + +## 输入 +- 最终代码 +- 架构与需求文档 + +## 输出 +- README.md +- 使用与维护说明 + +## 工作规则 +- 文档必须准确 +- 避免废话 +- 假设读者是新加入的开发者或 AI \ No newline at end of file diff --git a/training-system/agents/frontend.md b/training-system/agents/frontend.md new file mode 100644 index 0000000..37c3dcb --- /dev/null +++ b/training-system/agents/frontend.md @@ -0,0 +1,28 @@ +# Role: Frontend Agent(前端工程师) + +## 你的身份 +你是前端工程师,负责 UI 与交互实现。 + +## 你的目标 +- 提供清晰、一致的用户体验 + +## 你可以做的事 +- 编写前端代码 +- 实现页面和交互逻辑 + +## 你不能做的事 +- 不改后端接口定义 +- 不引入未确认的 UI 框架 + +## 输入 +- architecture.md +- requirements.md +- API 文档 + +## 输出 +- 前端源码 +- 简要交互说明 + +## 工作规则 +- 优先可维护性 +- 不做“看起来更酷”的无关改动 \ No newline at end of file diff --git a/training-system/agents/pm.md b/training-system/agents/pm.md new file mode 100644 index 0000000..207b514 --- /dev/null +++ b/training-system/agents/pm.md @@ -0,0 +1,32 @@ +# Role: Product Manager Agent(产品经理) + +## 你的身份 +你是负责需求分析和功能拆解的产品经理。 + +## 你的目标 +- 将模糊需求转化为清晰、可执行的需求 +- 定义验收标准 + +## 你可以做的事 +- 追问需求细节 +- 编写用户故事(User Story) +- 定义功能边界和非功能需求 + +## 你不能做的事 +- 不做技术选型 +- 不设计系统架构 +- 不写代码 + +## 输入 +- 用户原始需求 +- Supervisor 的指令 + +## 输出 +- requirements.md +- 功能清单 +- 验收标准(Acceptance Criteria) + +## 工作规则 +- 所有需求必须可测试 +- 明确“不做什么” +- 避免模糊词(如:尽量、可能) \ No newline at end of file diff --git a/training-system/agents/qa.md b/training-system/agents/qa.md new file mode 100644 index 0000000..2f185f0 --- /dev/null +++ b/training-system/agents/qa.md @@ -0,0 +1,29 @@ +# Role: QA / Tester Agent(测试工程师) + +## 你的身份 +你是专门负责找问题的人。 + +## 你的目标 +- 尽可能暴露缺陷和风险 + +## 你可以做的事 +- 设计测试用例 +- 提出反例和异常场景 +- 发现逻辑漏洞 + +## 你不能做的事 +- 不修复代码 +- 不修改需求 + +## 输入 +- 功能说明 +- 源码或接口定义 + +## 输出 +- 测试用例 +- Bug 列表 +- 风险说明 + +## 工作规则 +- 假设开发会犯错 +- 重点关注边界条件 \ No newline at end of file diff --git a/training-system/agents/security.md b/training-system/agents/security.md new file mode 100644 index 0000000..7d1f11a --- /dev/null +++ b/training-system/agents/security.md @@ -0,0 +1,29 @@ +# Role: Security Agent(安全审计) + +## 你的身份 +你是安全专家。 + +## 你的目标 +- 发现安全漏洞和设计风险 + +## 你可以做的事 +- 审查代码和接口 +- 指出潜在攻击面 +- 提供修复建议 + +## 你不能做的事 +- 不实现功能 +- 不更改业务逻辑 + +## 输入 +- 架构设计 +- 代码或接口文档 + +## 输出 +- 安全问题清单 +- 风险等级 +- 修复建议 + +## 工作规则 +- 默认系统处于敌对环境 +- 不忽略“看起来不太可能”的问题 \ No newline at end of file diff --git a/training-system/agents/supervisor.md b/training-system/agents/supervisor.md new file mode 100644 index 0000000..414f6b6 --- /dev/null +++ b/training-system/agents/supervisor.md @@ -0,0 +1,34 @@ +# Role: Supervisor Agent(项目总负责人) + +## 你的身份 +你是整个项目的总负责人,负责项目最终质量与方向。 +你不写具体业务代码。 + +## 你的目标 +- 确保项目符合需求、可维护、可扩展 +- 确保每个 Agent 各司其职 +- 防止范围蔓延和架构混乱 + +## 你可以做的事 +- 拆分项目阶段 +- 指派 Agent 执行任务 +- 审核、拒绝或要求返工任何 Agent 的输出 +- 汇总各 Agent 结果 + +## 你不能做的事 +- 不直接编写业务代码 +- 不绕过其他 Agent 直接下结论 + +## 输入 +- 用户需求 +- 各 Agent 的输出文档 + +## 输出 +- 决策说明 +- 是否通过 / 是否返工 +- 下一步执行指令 + +## 工作规则 +- 若信息不足,必须要求澄清 +- 优先考虑长期维护而非短期实现 +- 所有结论必须有理由 \ No newline at end of file diff --git a/training-system/docs/Prompt/PM_Prompt.md b/training-system/docs/Prompt/PM_Prompt.md index 893a2f5..aec107f 100644 --- a/training-system/docs/Prompt/PM_Prompt.md +++ b/training-system/docs/Prompt/PM_Prompt.md @@ -29,3 +29,6 @@ MVP原型设计与确认:在我确认上述路线图后,请你仅针对 MVP版 ## prompt:适用于需求变更 {我想增加/修改/优化.......。}请给出解决方案,用ASCII绘制成原型图,把所有影响到的部分绘制出来,包括原型和技术方案。注意:请仔细检查不要影响非相关模块,要保证依据你的方案实现后,能完成完美的实现需求。 +## prompt:版本更新-PRD.md文档变更 +汇总一下本次版本更新,这个版本号设定为1.0.1,在PRD.md文档顶部新版本更新区域写入对应的产品更新,对应的ASCII图,以及涉及到的技术架构和要点更新。 + diff --git a/training-system/src/main/resources/static/css/common.css b/training-system/src/main/resources/static/css/common.css index 496ebe3..30327ce 100644 --- a/training-system/src/main/resources/static/css/common.css +++ b/training-system/src/main/resources/static/css/common.css @@ -3,6 +3,63 @@ * 基于 Bootstrap 5 扩展 */ +/* ========== CSS变量体系 ========== */ +:root { + /* 主色系 - 蓝色 */ + --primary-color: #0d6efd; + --primary-hover: #0b5ed7; + --primary-light: rgba(13, 110, 253, 0.1); + --primary-gradient: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%); + + /* 侧边栏 */ + --sidebar-bg: linear-gradient(180deg, #1a1c23 0%, #2d3748 100%); + --sidebar-width: 250px; + + /* 文字颜色 */ + --text-primary: #1a1c23; + --text-secondary: #6c757d; + --text-muted: #94a3b8; + + /* 边框与背景 */ + --border-color: #e9ecef; + --bg-light: #f8f9fa; + --bg-card: #ffffff; + --bg-hover: rgba(255, 255, 255, 0.08); + + /* 状态色 */ + --success-color: #198754; + --success-light: rgba(25, 135, 84, 0.1); + --warning-color: #ffc107; + --warning-light: rgba(255, 193, 7, 0.1); + --danger-color: #dc3545; + --danger-light: rgba(220, 53, 69, 0.1); + --info-color: #0dcaf0; + --info-light: rgba(13, 202, 240, 0.1); + + /* 阴影 */ + --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08); + --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1); + --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15); + + /* 圆角 */ + --radius-sm: 4px; + --radius-md: 8px; + --radius-lg: 12px; + --radius-xl: 16px; + + /* 间距 */ + --spacing-xs: 4px; + --spacing-sm: 8px; + --spacing-md: 16px; + --spacing-lg: 24px; + --spacing-xl: 32px; + + /* 动画 */ + --transition-fast: 0.15s ease; + --transition-normal: 0.2s ease; + --transition-slow: 0.3s ease; +} + /* ========== 布局相关 ========== */ html, body { height: 100%; @@ -16,14 +73,14 @@ html, body { /* ========== 侧边栏 ========== */ .sidebar { - width: 250px; + width: var(--sidebar-width); min-height: 100vh; - background: linear-gradient(180deg, #1a1c23 0%, #2d3748 100%); + background: var(--sidebar-bg); position: fixed; left: 0; top: 0; z-index: 1000; - transition: all 0.3s ease; + transition: all var(--transition-slow); } .sidebar-logo { @@ -38,8 +95,8 @@ html, body { .sidebar-logo-icon { width: 36px; height: 36px; - background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%); - border-radius: 8px; + background: var(--primary-gradient); + border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; @@ -75,20 +132,20 @@ html, body { padding: 12px 20px; color: rgba(255, 255, 255, 0.7); text-decoration: none; - transition: all 0.2s ease; + transition: all var(--transition-normal); cursor: pointer; border-left: 3px solid transparent; } .menu-item:hover { color: #fff; - background: rgba(255, 255, 255, 0.08); + background: var(--bg-hover); } .menu-item.active { color: #fff; - background: rgba(13, 110, 253, 0.2); - border-left-color: #0d6efd; + background: var(--primary-light); + border-left-color: var(--primary-color); } .menu-item i { @@ -135,12 +192,18 @@ html, body { font-size: 14px; } +/* 侧边栏分隔线 */ +.sidebar-divider { + border-top: 1px solid rgba(255, 255, 255, 0.1); + margin: var(--spacing-md) 0; +} + /* ========== 主内容区 ========== */ .main-wrapper { flex: 1; - margin-left: 250px; + margin-left: var(--sidebar-width); min-height: 100vh; - background-color: #f8f9fa; + background-color: var(--bg-light); display: flex; flex-direction: column; } @@ -148,12 +211,12 @@ html, body { /* 顶部导航 */ .top-header { height: 64px; - background: #fff; - border-bottom: 1px solid #e9ecef; + background: var(--bg-card); + border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; - padding: 0 24px; + padding: 0 var(--spacing-lg); position: sticky; top: 0; z-index: 100; @@ -162,7 +225,7 @@ html, body { .header-title { font-size: 18px; font-weight: 600; - color: #1a1c23; + color: var(--text-primary); } .header-user { @@ -175,32 +238,32 @@ html, body { width: 36px; height: 36px; border-radius: 50%; - background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%); + background: var(--primary-gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 500; - margin-right: 8px; + margin-right: var(--spacing-sm); } /* 内容区域 */ .main-content { flex: 1; - padding: 24px; + padding: var(--spacing-lg); } /* ========== 页面卡片 ========== */ .page-card { - background: #fff; - border-radius: 8px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); - margin-bottom: 24px; + background: var(--bg-card); + border-radius: var(--radius-md); + box-shadow: var(--shadow-sm); + margin-bottom: var(--spacing-lg); } .page-card-header { - padding: 16px 24px; - border-bottom: 1px solid #e9ecef; + padding: var(--spacing-md) var(--spacing-lg); + border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; @@ -209,69 +272,69 @@ html, body { .page-card-title { font-size: 16px; font-weight: 600; - color: #1a1c23; + color: var(--text-primary); margin: 0; } .page-card-body { - padding: 24px; + padding: var(--spacing-lg); } /* ========== 统计卡片 ========== */ .stat-card { - background: #fff; - border-radius: 8px; - padding: 24px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); - transition: all 0.2s ease; + background: var(--bg-card); + border-radius: var(--radius-md); + padding: var(--spacing-lg); + box-shadow: var(--shadow-sm); + transition: all var(--transition-normal); } .stat-card:hover { - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); + box-shadow: var(--shadow-md); transform: translateY(-2px); } .stat-card-icon { width: 48px; height: 48px; - border-radius: 12px; + border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 24px; - margin-bottom: 16px; + margin-bottom: var(--spacing-md); } .stat-card-icon.primary { - background: rgba(13, 110, 253, 0.1); - color: #0d6efd; + background: var(--primary-light); + color: var(--primary-color); } .stat-card-icon.success { - background: rgba(25, 135, 84, 0.1); - color: #198754; + background: var(--success-light); + color: var(--success-color); } .stat-card-icon.warning { - background: rgba(255, 193, 7, 0.1); - color: #ffc107; + background: var(--warning-light); + color: var(--warning-color); } .stat-card-icon.info { - background: rgba(13, 202, 240, 0.1); - color: #0dcaf0; + background: var(--info-light); + color: var(--info-color); } .stat-card-value { font-size: 28px; font-weight: 700; - color: #1a1c23; - margin-bottom: 4px; + color: var(--text-primary); + margin-bottom: var(--spacing-xs); } .stat-card-label { font-size: 14px; - color: #6c757d; + color: var(--text-secondary); } /* ========== 工具栏 ========== */ @@ -280,21 +343,21 @@ html, body { flex-wrap: wrap; align-items: center; justify-content: space-between; - gap: 12px; - margin-bottom: 20px; + gap: var(--spacing-sm); + margin-bottom: var(--spacing-lg); } .toolbar-left { display: flex; flex-wrap: wrap; align-items: center; - gap: 12px; + gap: var(--spacing-sm); } .toolbar-right { display: flex; align-items: center; - gap: 12px; + gap: var(--spacing-sm); } /* ========== 表格增强 ========== */ @@ -304,8 +367,8 @@ html, body { .table th { font-weight: 600; - color: #495057; - background-color: #f8f9fa; + color: var(--text-secondary); + background-color: var(--bg-light); white-space: nowrap; } @@ -365,8 +428,8 @@ html, body { /* ========== 空状态 ========== */ .empty-state { text-align: center; - padding: 48px 24px; - color: #6c757d; + padding: 48px var(--spacing-lg); + color: var(--text-secondary); } .empty-state i { @@ -390,34 +453,34 @@ html, body { /* ========== 文件上传区域 ========== */ .upload-area { - border: 2px dashed #dee2e6; - border-radius: 8px; - padding: 32px; + border: 2px dashed var(--border-color); + border-radius: var(--radius-md); + padding: var(--spacing-xl); text-align: center; cursor: pointer; - transition: all 0.2s ease; - background: #f8f9fa; + transition: all var(--transition-normal); + background: var(--bg-light); } .upload-area:hover { - border-color: #0d6efd; + border-color: var(--primary-color); background: rgba(13, 110, 253, 0.02); } .upload-area.dragover { - border-color: #0d6efd; + border-color: var(--primary-color); background: rgba(13, 110, 253, 0.05); } .upload-area i { font-size: 48px; - color: #6c757d; - margin-bottom: 16px; + color: var(--text-secondary); + margin-bottom: var(--spacing-md); } .upload-area p { margin: 0; - color: #6c757d; + color: var(--text-secondary); } .upload-area .upload-hint { @@ -457,54 +520,54 @@ html, body { .answer-sheet { display: flex; flex-wrap: wrap; - gap: 8px; + gap: var(--spacing-sm); } .answer-sheet-item { width: 36px; height: 36px; - border-radius: 4px; + border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; cursor: pointer; - border: 1px solid #dee2e6; - background: #fff; - transition: all 0.2s ease; + border: 1px solid var(--border-color); + background: var(--bg-card); + transition: all var(--transition-normal); } .answer-sheet-item:hover { - border-color: #0d6efd; + border-color: var(--primary-color); } .answer-sheet-item.current { - border-color: #0d6efd; - background: #0d6efd; + border-color: var(--primary-color); + background: var(--primary-color); color: #fff; } .answer-sheet-item.answered { background: #d1e7dd; - border-color: #198754; - color: #198754; + border-color: var(--success-color); + color: var(--success-color); } /* ========== 考试计时器 ========== */ .exam-timer { display: flex; align-items: center; - gap: 8px; - padding: 8px 16px; - background: #fff3cd; - border-radius: 8px; + gap: var(--spacing-sm); + padding: var(--spacing-sm) var(--spacing-md); + background: var(--warning-light); + border-radius: var(--radius-md); font-weight: 600; } .exam-timer.warning { - background: #f8d7da; - color: #842029; + background: var(--danger-light); + color: var(--danger-color); } .exam-timer i { @@ -526,11 +589,11 @@ html, body { } .top-header { - padding: 0 16px; + padding: 0 var(--spacing-md); } .main-content { - padding: 16px; + padding: var(--spacing-md); } } diff --git a/training-system/src/main/resources/static/exam/edit.html b/training-system/src/main/resources/static/exam/edit.html index 4d083db..3c34dab 100644 --- a/training-system/src/main/resources/static/exam/edit.html +++ b/training-system/src/main/resources/static/exam/edit.html @@ -17,20 +17,7 @@
- +
@@ -147,6 +134,8 @@ let examId = null, allUsers = [], filteredUsers = [], selectedUserIds = new Set(), papers = []; document.addEventListener('DOMContentLoaded', async function() { + TrainingSystem.initSidebar('exam'); + TrainingSystem.initUserInfo(); const urlParams = new URLSearchParams(window.location.search); examId = urlParams.get('id'); loadPapers(); diff --git a/training-system/src/main/resources/static/exam/list.html b/training-system/src/main/resources/static/exam/list.html index df3e59c..ae64918 100644 --- a/training-system/src/main/resources/static/exam/list.html +++ b/training-system/src/main/resources/static/exam/list.html @@ -10,20 +10,7 @@
- +
@@ -98,6 +85,8 @@ let currentPage = 1, pageSize = 10, detailModal; document.addEventListener('DOMContentLoaded', function() { + TrainingSystem.initSidebar('exam'); + TrainingSystem.initUserInfo(); detailModal = new bootstrap.Modal(document.getElementById('detailModal')); loadList(); }); diff --git a/training-system/src/main/resources/static/exam/my-exams.html b/training-system/src/main/resources/static/exam/my-exams.html index fa4f95a..71e8414 100644 --- a/training-system/src/main/resources/static/exam/my-exams.html +++ b/training-system/src/main/resources/static/exam/my-exams.html @@ -32,17 +32,7 @@
- +
@@ -76,6 +66,8 @@ let allExams = [], currentTab = 'all'; document.addEventListener('DOMContentLoaded', function() { + TrainingSystem.initSidebar('my-exams'); + TrainingSystem.initUserInfo(); loadExams(); }); diff --git a/training-system/src/main/resources/static/exam/paper-edit.html b/training-system/src/main/resources/static/exam/paper-edit.html index 9f7b575..0a0ebfc 100644 --- a/training-system/src/main/resources/static/exam/paper-edit.html +++ b/training-system/src/main/resources/static/exam/paper-edit.html @@ -37,20 +37,7 @@
- +
@@ -197,6 +184,8 @@ let questionPage = 1, questionPageSize = 20, hasMore = true; document.addEventListener('DOMContentLoaded', function() { + TrainingSystem.initSidebar('paper'); + TrainingSystem.initUserInfo(); const urlParams = new URLSearchParams(window.location.search); paperId = urlParams.get('id'); loadCategories(); diff --git a/training-system/src/main/resources/static/exam/paper-preview.html b/training-system/src/main/resources/static/exam/paper-preview.html index 5b8b277..a19ce62 100644 --- a/training-system/src/main/resources/static/exam/paper-preview.html +++ b/training-system/src/main/resources/static/exam/paper-preview.html @@ -39,20 +39,7 @@
- +
@@ -75,6 +62,8 @@ if (!TrainingSystem.initPage()) {} document.addEventListener('DOMContentLoaded', function() { + TrainingSystem.initSidebar('paper'); + TrainingSystem.initUserInfo(); const urlParams = new URLSearchParams(window.location.search); const paperId = urlParams.get('id'); if (paperId) { diff --git a/training-system/src/main/resources/static/exam/paper.html b/training-system/src/main/resources/static/exam/paper.html index e4a322e..3f2c5ab 100644 --- a/training-system/src/main/resources/static/exam/paper.html +++ b/training-system/src/main/resources/static/exam/paper.html @@ -23,20 +23,7 @@
- +
@@ -82,6 +69,8 @@ let currentPage = 1, pageSize = 10; document.addEventListener('DOMContentLoaded', function() { + TrainingSystem.initSidebar('paper'); + TrainingSystem.initUserInfo(); loadList(); }); diff --git a/training-system/src/main/resources/static/exam/question-category.html b/training-system/src/main/resources/static/exam/question-category.html index a13d240..1eb2c5e 100644 --- a/training-system/src/main/resources/static/exam/question-category.html +++ b/training-system/src/main/resources/static/exam/question-category.html @@ -20,20 +20,7 @@
- +
@@ -63,7 +50,7 @@