From ebf7c8890ab8e30efe5556f310c56ab6462537bb Mon Sep 17 00:00:00 2001 From: yanlongqi Date: Tue, 18 Nov 2025 11:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=80=83=E8=AF=95=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2UI=E5=92=8C=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 重构试卷列表页面布局,提升视觉效果 - 优化试卷卡片样式,添加悬停效果和背景装饰 - 改进移动端响应式设计,增强移动设备用户体验 - 统一返回按钮样式,使用一致的图标和文案 - 调整页面间距和对齐方式,提升整体视觉层次 - 优化代码格式,统一引号使用规范 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- web/src/pages/ExamAnswerView.tsx | 7 +- web/src/pages/ExamManagement.module.less | 156 +++++++- web/src/pages/ExamManagement.tsx | 53 ++- web/src/pages/ExamResultNew.tsx | 466 ++++++++++++++--------- 4 files changed, 445 insertions(+), 237 deletions(-) diff --git a/web/src/pages/ExamAnswerView.tsx b/web/src/pages/ExamAnswerView.tsx index 8cc93c8..7f3a5a3 100644 --- a/web/src/pages/ExamAnswerView.tsx +++ b/web/src/pages/ExamAnswerView.tsx @@ -12,7 +12,7 @@ import { message } from 'antd' import { - HomeOutlined + LeftOutlined } from '@ant-design/icons' import * as examApi from '../api/exam' import type { Question } from '../types/question' @@ -198,11 +198,10 @@ const ExamAnswerView: React.FC = () => { diff --git a/web/src/pages/ExamManagement.module.less b/web/src/pages/ExamManagement.module.less index 4ac08b7..73eae95 100644 --- a/web/src/pages/ExamManagement.module.less +++ b/web/src/pages/ExamManagement.module.less @@ -7,17 +7,14 @@ .header { display: flex; justify-content: space-between; - align-items: flex-start; + align-items: center; margin-bottom: 24px; h2 { - margin: 0 0 4px 0; - font-size: 24px; - } - - .subtitle { margin: 0; - color: rgba(0, 0, 0, 0.45); + font-size: 24px; + flex: 1; + text-align: center; } } @@ -32,16 +29,22 @@ font-size: 18px; color: #1890ff; } + + span { + line-height: 1.4; + } } .cardContent { - .description { - margin-bottom: 16px; - color: rgba(0, 0, 0, 0.65); - font-size: 14px; + margin-top: 12px; + + .infoRow { + display: flex; + gap: 16px; + margin-bottom: 12px; } - .statItem { + .infoItem { display: flex; align-items: center; gap: 6px; @@ -50,15 +53,97 @@ svg { color: #1890ff; + font-size: 14px; } } .stats { - margin-top: 16px; - padding-top: 16px; - border-top: 1px solid #f0f0f0; display: flex; gap: 8px; + margin-top: 8px; + } + + .statTag { + font-size: 12px; + } +} + +// 试卷卡片样式优化 +.examCard { + border-radius: 12px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); + border: 1px solid #f0f0f0; + transition: all 0.3s ease; + position: relative; + overflow: hidden; + + &:hover { + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); + transform: translateY(-2px); + } + + :global(.ant-card-body) { + padding: 16px; + position: relative; + z-index: 2; + } + + // 右侧背景图片 + &::after { + content: ''; + position: absolute; + top: 35px; + right: 15px; + width: 50px; + height: 50px; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8d4f1' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'%3E%3C/path%3E%3Cpolyline points='14,2 14,8 20,8'%3E%3C/polyline%3E%3Cline x1='16' y1='13' x2='8' y2='13'%3E%3C/line%3E%3Cline x1='16' y1='17' x2='8' y2='17'%3E%3C/line%3E%3Cpolyline points='10,9 9,9 8,9'%3E%3C/polyline%3E%3C/svg%3E"); + background-size: contain; + background-repeat: no-repeat; + background-position: center; + opacity: 0.12; + z-index: 1; + } +} + +// 卡片操作按钮样式优化 +:global(.ant-card-actions) { + background: #fafafa; + + li { + margin: 0 !important; + + button { + height: auto; + padding: 8px 12px; + font-size: 12px; + line-height: 1.4; + white-space: nowrap; + + .anticon { + font-size: 14px; + } + + &:hover { + background: rgba(24, 144, 255, 0.05); + } + } + + button.ant-btn-link { + color: rgba(0, 0, 0, 0.65); + + &:hover { + color: #1890ff; + } + + &.ant-btn-dangerous { + color: #ff4d4f; + + &:hover { + color: #ff7875; + background: rgba(255, 77, 79, 0.05); + } + } + } } } @@ -82,6 +167,7 @@ h2 { font-size: 20px; + text-align: center; } button { @@ -91,15 +177,49 @@ .cardTitle { font-size: 15px; + margin-bottom: 8px; + + svg { + font-size: 16px; + } } .cardContent { - .description { + margin-top: 8px; + + .infoRow { + flex-direction: column; + gap: 8px; + margin-bottom: 8px; + } + + .infoItem { font-size: 13px; } - .statItem { - font-size: 13px; + .stats { + margin-top: 6px; + flex-wrap: wrap; } + + .statTag { + font-size: 11px; + } + + // 移动端卡片操作按钮优化 + :global(.ant-card-actions) { + li { + button { + padding: 6px 8px; + font-size: 11px; + } + } + } + + } + + // 移动端样式调整 + .examCard::after { + display: none; } } diff --git a/web/src/pages/ExamManagement.tsx b/web/src/pages/ExamManagement.tsx index 5d5caee..06463fa 100644 --- a/web/src/pages/ExamManagement.tsx +++ b/web/src/pages/ExamManagement.tsx @@ -10,8 +10,6 @@ import { List, Tag, Modal, - Row, - Col, Empty, Spin, Drawer, @@ -27,7 +25,8 @@ import { CheckCircleOutlined, TrophyOutlined, HistoryOutlined, - PrinterOutlined + PrinterOutlined, + ArrowLeftOutlined } from '@ant-design/icons' import * as examApi from '../api/exam' import styles from './ExamManagement.module.less' @@ -177,10 +176,13 @@ const ExamManagement: React.FC = () => {
-
-

模拟考试

-

创建和管理模拟试卷

-
+ +

模拟考试

{record.exam?.id && (
- ) -} + ); +}; -export default ExamResultNew +export default ExamResultNew;