From b4062590fcbae550d3e6f9ad26c7c534ea910597 Mon Sep 17 00:00:00 2001 From: YONGYE Date: Sat, 4 Apr 2026 10:18:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E8=AE=B8=E5=A4=9A?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=97=B6=E9=81=87=E5=88=B0=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 2 ++ src/components/Layout/index.css | 10 +++++-- src/pages/Dashboard/index.css | 44 +++++++++++++++++++++++++---- src/pages/Dashboard/index.tsx | 2 +- src/pages/FileManagement/index.tsx | 15 +++++++--- src/pages/OrderManagement/index.tsx | 13 +++++++-- src/pages/PriceManagement/index.tsx | 12 +++++++- src/pages/PrintSettings/index.tsx | 1 + src/pages/Statistics/index.tsx | 1 + src/pages/UserManagement/index.tsx | 7 ++++- 10 files changed, 89 insertions(+), 18 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index ea970434..1d5c3419 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -12,6 +12,8 @@ import './App.css' function App() { const isAuthenticated = () => { + // 临时免登录,方便预览 + // return true return localStorage.getItem('admin_token') !== null } diff --git a/src/components/Layout/index.css b/src/components/Layout/index.css index 03282068..c54859ea 100644 --- a/src/components/Layout/index.css +++ b/src/components/Layout/index.css @@ -39,12 +39,16 @@ } .admin-menu .ant-menu-item-selected { - background: linear-gradient(135deg, #1890ff 0%, #36cfc9 100%); + background: linear-gradient(135deg, #1890ff 0%, #36cfc9 100%) !important; } -.admin-menu .ant-menu-item-selected a, +.admin-menu .ant-menu-item-selected .ant-menu-title-content, .admin-menu .ant-menu-item-selected .anticon { - color: #fff; + color: #fff !important; +} + +.admin-menu .ant-menu-item-selected:hover { + background: linear-gradient(135deg, #1890ff 0%, #36cfc9 100%) !important; } .admin-header { diff --git a/src/pages/Dashboard/index.css b/src/pages/Dashboard/index.css index 7ec88dcf..a3a3e051 100644 --- a/src/pages/Dashboard/index.css +++ b/src/pages/Dashboard/index.css @@ -25,6 +25,7 @@ border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); transition: all 0.3s ease; + height: 100%; } .stat-card:hover { @@ -32,30 +33,63 @@ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); } +.stat-card .ant-card-body { + padding: 20px; + height: 100%; + display: flex; + align-items: center; +} + .stat-content { display: flex; align-items: center; gap: 16px; + min-height: 72px; + padding: 8px 0; } .stat-icon { - width: 56px; - height: 56px; - border-radius: 12px; + width: 64px; + height: 64px; + border-radius: 16px; display: flex; align-items: center; justify-content: center; - font-size: 24px; + font-size: 28px; + flex-shrink: 0; } .stat-info { flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + min-width: 0; } .stat-title { font-size: 14px; display: block; - margin-bottom: 4px; + margin-bottom: 8px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.stat-card .ant-statistic-content { + font-size: 24px; + font-weight: 600; + line-height: 1.4; +} + +.stat-card .ant-statistic-content-prefix { + font-size: 18px; + margin-right: 4px; +} + +.stat-card .ant-statistic-content-suffix { + font-size: 14px; + margin-left: 4px; } .today-row { diff --git a/src/pages/Dashboard/index.tsx b/src/pages/Dashboard/index.tsx index 44b4e97b..0713ba6f 100644 --- a/src/pages/Dashboard/index.tsx +++ b/src/pages/Dashboard/index.tsx @@ -121,7 +121,7 @@ const Dashboard = () => { value={card.value} prefix={card.prefix} precision={card.precision || 0} - valueStyle={{ color: card.color, fontSize: '24px', fontWeight: 600 }} + valueStyle={{ color: card.color }} /> diff --git a/src/pages/FileManagement/index.tsx b/src/pages/FileManagement/index.tsx index 351dd9a3..2d658248 100644 --- a/src/pages/FileManagement/index.tsx +++ b/src/pages/FileManagement/index.tsx @@ -129,6 +129,7 @@ const FileManagement = () => { title: '文件名', dataIndex: 'name', key: 'name', + width: 280, render: (text: string, record: File) => ( {getFileIcon(text)} @@ -145,39 +146,45 @@ const FileManagement = () => { title: '类型', dataIndex: 'name', key: 'type', - width: 100, + width: 90, + align: 'center' as const, render: (text: string) => getFileTypeTag(text), }, { title: '大小', dataIndex: 'size', key: 'size', - width: 120, + width: 100, + align: 'center' as const, render: (size: number) => formatFileSize(size), }, { title: '页数', dataIndex: 'page_count', key: 'page_count', - width: 100, + width: 90, + align: 'center' as const, render: (count: number) => count ? `${count} 页` : '-', }, { title: '用户ID', dataIndex: 'user_id', key: 'user_id', + width: 140, render: (text: string) => {text?.substring(0, 8)}..., }, { title: '上传时间', dataIndex: 'created_at', key: 'created_at', + width: 180, render: (text: string) => new Date(text).toLocaleString('zh-CN'), }, { title: '操作', key: 'action', - width: 180, + width: 160, + fixed: 'right' as const, render: (_: unknown, record: File) => (