feat(web): 登录页主题适配 + 工作台角色化重构
- 登录页接入 4 套主题系统(渐变色/面板背景/文字色),添加 ThemeSwitcher - 工作台按角色(医生/护士/管理员/运营)显示专属统计卡片和快捷入口 - 移除系统信息填充卡片,硬编码颜色替换为 CSS 变量
This commit is contained in:
@@ -2,6 +2,7 @@ import { useNavigate } from 'react-router-dom';
|
||||
import { Form, Input, Button, message, Divider } from 'antd';
|
||||
import { UserOutlined, LockOutlined, SafetyCertificateOutlined } from '@ant-design/icons';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import ThemeSwitcher from '../components/ThemeSwitcher';
|
||||
|
||||
export default function Login() {
|
||||
const navigate = useNavigate();
|
||||
@@ -23,100 +24,23 @@ export default function Login() {
|
||||
};
|
||||
|
||||
return (
|
||||
<div style={{ display: 'flex', minHeight: '100vh' }}>
|
||||
<div className="login-root">
|
||||
{contextHolder}
|
||||
|
||||
{/* 左侧品牌展示区 */}
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
background: 'linear-gradient(135deg, #312E81 0%, #2563eb 50%, #60a5fa 100%)',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
padding: '60px',
|
||||
position: 'relative',
|
||||
overflow: 'hidden',
|
||||
}}
|
||||
>
|
||||
{/* 装饰性背景元素 */}
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: '-20%',
|
||||
right: '-10%',
|
||||
width: '500px',
|
||||
height: '500px',
|
||||
borderRadius: '50%',
|
||||
background: 'rgba(255, 255, 255, 0.05)',
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
bottom: '-15%',
|
||||
left: '-8%',
|
||||
width: '400px',
|
||||
height: '400px',
|
||||
borderRadius: '50%',
|
||||
background: 'rgba(255, 255, 255, 0.03)',
|
||||
}}
|
||||
/>
|
||||
<div className="login-brand-panel">
|
||||
<div className="deco-circle" style={{ top: '-20%', right: '-10%', width: 500, height: 500 }} />
|
||||
<div className="deco-circle" style={{ bottom: '-15%', left: '-8%', width: 400, height: 400, background: 'rgba(255, 255, 255, 0.03)' }} />
|
||||
|
||||
{/* 品牌内容 */}
|
||||
<div style={{ position: 'relative', zIndex: 1, textAlign: 'center', maxWidth: '480px' }}>
|
||||
<div
|
||||
style={{
|
||||
width: 64,
|
||||
height: 64,
|
||||
borderRadius: 16,
|
||||
background: 'rgba(255, 255, 255, 0.15)',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
margin: '0 auto 32px',
|
||||
backdropFilter: 'blur(8px)',
|
||||
border: '1px solid rgba(255, 255, 255, 0.2)',
|
||||
}}
|
||||
>
|
||||
<SafetyCertificateOutlined style={{ fontSize: 32, color: '#fff' }} />
|
||||
<div style={{ position: 'relative', zIndex: 1, textAlign: 'center', maxWidth: 480 }}>
|
||||
<div className="brand-icon">
|
||||
<SafetyCertificateOutlined />
|
||||
</div>
|
||||
|
||||
<h1
|
||||
style={{
|
||||
color: '#fff',
|
||||
fontSize: 36,
|
||||
fontWeight: 800,
|
||||
margin: '0 0 16px',
|
||||
letterSpacing: '-1px',
|
||||
lineHeight: 1.2,
|
||||
}}
|
||||
>
|
||||
ERP Platform
|
||||
</h1>
|
||||
<p
|
||||
style={{
|
||||
color: 'rgba(255, 255, 255, 0.7)',
|
||||
fontSize: 16,
|
||||
lineHeight: 1.6,
|
||||
margin: 0,
|
||||
}}
|
||||
>
|
||||
新一代模块化企业资源管理平台
|
||||
</p>
|
||||
<p
|
||||
style={{
|
||||
color: 'rgba(255, 255, 255, 0.5)',
|
||||
fontSize: 14,
|
||||
lineHeight: 1.6,
|
||||
marginTop: 8,
|
||||
}}
|
||||
>
|
||||
身份权限 · 工作流引擎 · 消息中心 · 系统配置
|
||||
</p>
|
||||
<h1 className="brand-title">HMR Platform</h1>
|
||||
<p className="brand-desc">新一代健康管理平台</p>
|
||||
<p className="brand-sub-desc">慢病跟踪 · 工作流引擎 · 消息中心 · 系统配置</p>
|
||||
|
||||
{/* 底部特性点 */}
|
||||
<div style={{ marginTop: 48, display: 'flex', gap: 32, justifyContent: 'center' }}>
|
||||
{[
|
||||
{ label: '多租户架构', value: 'SaaS' },
|
||||
@@ -124,12 +48,8 @@ export default function Login() {
|
||||
{ label: '事件驱动', value: '可扩展' },
|
||||
].map((item) => (
|
||||
<div key={item.label} style={{ textAlign: 'center' }}>
|
||||
<div style={{ color: 'rgba(255, 255, 255, 0.9)', fontSize: 18, fontWeight: 700 }}>
|
||||
{item.value}
|
||||
</div>
|
||||
<div style={{ color: 'rgba(255, 255, 255, 0.5)', fontSize: 12, marginTop: 4 }}>
|
||||
{item.label}
|
||||
</div>
|
||||
<div className="feature-item-value">{item.value}</div>
|
||||
<div className="feature-item-label">{item.label}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -137,23 +57,14 @@ export default function Login() {
|
||||
</div>
|
||||
|
||||
{/* 右侧登录表单区 */}
|
||||
<main
|
||||
style={{
|
||||
width: 480,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
justifyContent: 'center',
|
||||
padding: '60px',
|
||||
background: '#fff',
|
||||
}}
|
||||
>
|
||||
<main className="login-form-panel">
|
||||
<div className="login-theme-switcher">
|
||||
<ThemeSwitcher />
|
||||
</div>
|
||||
|
||||
<div style={{ maxWidth: 360, width: '100%', margin: '0 auto' }}>
|
||||
<h2 style={{ marginBottom: 4, fontWeight: 700, fontSize: 24 }}>
|
||||
欢迎回来
|
||||
</h2>
|
||||
<p style={{ fontSize: 14, color: '#475569' }}>
|
||||
请登录您的账户以继续
|
||||
</p>
|
||||
<h2 className="form-title">欢迎回来</h2>
|
||||
<p className="form-subtitle">请登录您的账户以继续</p>
|
||||
|
||||
<Divider style={{ margin: '24px 0' }} />
|
||||
|
||||
@@ -163,9 +74,9 @@ export default function Login() {
|
||||
rules={[{ required: true, message: '请输入用户名' }]}
|
||||
>
|
||||
<Input
|
||||
prefix={<UserOutlined style={{ color: '#94a3b8' }} />}
|
||||
prefix={<UserOutlined style={{ color: 'var(--login-input-icon-color)' }} />}
|
||||
placeholder="用户名"
|
||||
style={{ height: 44, borderRadius: 10 }}
|
||||
style={{ height: 44, borderRadius: 'var(--erp-radius-md)' }}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
@@ -173,9 +84,9 @@ export default function Login() {
|
||||
rules={[{ required: true, message: '请输入密码' }]}
|
||||
>
|
||||
<Input.Password
|
||||
prefix={<LockOutlined style={{ color: '#94a3b8' }} />}
|
||||
prefix={<LockOutlined style={{ color: 'var(--login-input-icon-color)' }} />}
|
||||
placeholder="密码"
|
||||
style={{ height: 44, borderRadius: 10 }}
|
||||
style={{ height: 44, borderRadius: 'var(--erp-radius-md)' }}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item style={{ marginBottom: 0 }}>
|
||||
@@ -184,22 +95,15 @@ export default function Login() {
|
||||
htmlType="submit"
|
||||
loading={loading}
|
||||
block
|
||||
style={{
|
||||
height: 44,
|
||||
borderRadius: 10,
|
||||
fontSize: 15,
|
||||
fontWeight: 600,
|
||||
}}
|
||||
style={{ height: 44, borderRadius: 'var(--erp-radius-md)', fontSize: 15, fontWeight: 600 }}
|
||||
>
|
||||
登录
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
||||
<div style={{ marginTop: 32, textAlign: 'center' }}>
|
||||
<p style={{ fontSize: 12, color: '#475569', margin: 0 }}>
|
||||
ERP Platform · Powered by Rust + React
|
||||
</p>
|
||||
<div className="form-footer">
|
||||
HMR Platform · ©汕头市智界科技有限公司
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user