fix: 优化用户管理页面UI显示

- 移除未使用的 TrophyOutlined 图标导入
- 移除总答题数统计的图标前缀,保持UI简洁
- 修复 Spin 组件的使用方式,改为使用子元素而非 tip 属性
- 添加 type_stats 的空值检查,防止潜在的空指针错误

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
yanlongqi 2025-11-10 16:29:02 +08:00
parent f79d1368b8
commit d7ba3e1d65

View File

@ -20,7 +20,6 @@ import {
import {
ArrowLeftOutlined,
UserOutlined,
TrophyOutlined,
CheckCircleOutlined,
CloseCircleOutlined,
} from '@ant-design/icons'
@ -164,7 +163,6 @@ const UserManagement: React.FC = () => {
<Statistic
title="总答题数"
value={totalStats.totalAnswers}
prefix={<TrophyOutlined />}
valueStyle={{ color: '#52c41a' }}
/>
</Card>
@ -304,7 +302,9 @@ const UserManagement: React.FC = () => {
>
{detailLoading ? (
<div style={{ textAlign: 'center', padding: '50px 0' }}>
<Spin size="large" tip="加载中..." />
<Spin size="large">
<div style={{ paddingTop: 50 }}>...</div>
</Spin>
</div>
) : (
selectedUser && (
@ -420,7 +420,7 @@ const UserManagement: React.FC = () => {
</Descriptions>
{/* 题型统计 */}
{selectedUser.type_stats.length > 0 && (
{selectedUser.type_stats && selectedUser.type_stats.length > 0 && (
<>
<Title level={5}></Title>
<Table