修复页面bug
This commit is contained in:
@@ -1,15 +1,6 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Card, Space, Typography, Row, Col, Statistic, Progress, Button } from 'antd';
|
||||
import {
|
||||
RocketOutlined,
|
||||
TeamOutlined,
|
||||
AppstoreOutlined,
|
||||
CloudServerOutlined,
|
||||
TrophyOutlined,
|
||||
ThunderboltOutlined,
|
||||
GlobalOutlined,
|
||||
SafetyOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { RocketOutlined, TeamOutlined, AppstoreOutlined, CloudServerOutlined, TrophyOutlined, ThunderboltOutlined, GlobalOutlined, SafetyOutlined } from '@ant-design/icons';
|
||||
import TenantScopeFilter from '@/components/TenantScopeFilter';
|
||||
|
||||
const { Title, Paragraph } = Typography;
|
||||
@@ -18,24 +9,15 @@ const Welcome: React.FC = () => {
|
||||
const [time, setTime] = useState(new Date());
|
||||
|
||||
useEffect(() => {
|
||||
let isMounted = true;
|
||||
const timer = setInterval(() => {
|
||||
if (isMounted) {
|
||||
setTime(new Date());
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
return () => {
|
||||
isMounted = false;
|
||||
clearInterval(timer);
|
||||
};
|
||||
const timer = setInterval(() => setTime(new Date()), 1000);
|
||||
return () => clearInterval(timer);
|
||||
}, []);
|
||||
|
||||
const stats = [
|
||||
{ title: '今日订单', value: 1234, icon: <AppstoreOutlined />, color: '#667eea' },
|
||||
{ title: '活跃用户', value: 856, icon: <TeamOutlined />, color: '#764ba2' },
|
||||
{ title: '设备在线', value: 98, suffix: '%', icon: <CloudServerOutlined />, color: '#f093fb' },
|
||||
{ title: '系统状态', value: 99.9, suffix: '%', icon: <SafetyOutlined />, color: '#4facfe' },
|
||||
{ title: '系统可用率', value: 99.9, suffix: '%', icon: <SafetyOutlined />, color: '#4facfe' },
|
||||
];
|
||||
|
||||
const quickActions = [
|
||||
@@ -47,29 +29,15 @@ const Welcome: React.FC = () => {
|
||||
|
||||
return (
|
||||
<div className="page-enter" style={{ padding: 24 }}>
|
||||
{/* 欢迎横幅 */}
|
||||
<Card
|
||||
className="modern-card"
|
||||
style={{
|
||||
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
||||
border: 'none',
|
||||
marginBottom: 24,
|
||||
color: 'white'
|
||||
}}
|
||||
>
|
||||
<Card className="modern-card" style={{ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)', border: 'none', marginBottom: 24, color: 'white' }}>
|
||||
<Row align="middle" justify="space-between">
|
||||
<Col>
|
||||
<Space direction="vertical" size={8}>
|
||||
<Title level={2} style={{ color: 'white', margin: 0 }}>
|
||||
<RocketOutlined style={{ marginRight: 12 }} />
|
||||
欢迎使用 Go-Fly Admin
|
||||
<RocketOutlined style={{ marginRight: 12 }} /> 欢迎使用 Go-Fly Admin
|
||||
</Title>
|
||||
<Paragraph style={{ color: 'rgba(255,255,255,0.8)', margin: 0, fontSize: 16 }}>
|
||||
现代化的智能管理平台 · 科技驱动未来
|
||||
</Paragraph>
|
||||
<Paragraph style={{ color: 'rgba(255,255,255,0.6)', margin: 0 }}>
|
||||
当前时间:{time.toLocaleString()}
|
||||
</Paragraph>
|
||||
<Paragraph style={{ color: 'rgba(255,255,255,0.8)', margin: 0, fontSize: 16 }}>现代化的智能管理平台 · 科技驱动未来</Paragraph>
|
||||
<Paragraph style={{ color: 'rgba(255,255,255,0.6)', margin: 0 }}>当前时间:{time.toLocaleString()}</Paragraph>
|
||||
</Space>
|
||||
</Col>
|
||||
<Col>
|
||||
@@ -78,45 +46,20 @@ const Welcome: React.FC = () => {
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
{/* 数据统计卡片 */}
|
||||
<Row gutter={[24, 24]} style={{ marginBottom: 24 }}>
|
||||
{stats.map((stat, index) => (
|
||||
<Col xs={12} sm={12} md={6} key={index}>
|
||||
<Card
|
||||
className="modern-card"
|
||||
style={{
|
||||
textAlign: 'center',
|
||||
borderLeft: `4px solid ${stat.color}`,
|
||||
background: 'var(--bg-card)'
|
||||
}}
|
||||
>
|
||||
<div style={{ color: stat.color, fontSize: 24, marginBottom: 8 }}>
|
||||
{stat.icon}
|
||||
</div>
|
||||
<Statistic
|
||||
title={stat.title}
|
||||
value={stat.value}
|
||||
suffix={stat.suffix}
|
||||
valueStyle={{
|
||||
color: 'var(--text-primary)',
|
||||
fontSize: 28,
|
||||
fontWeight: 'bold'
|
||||
}}
|
||||
/>
|
||||
<Card className="modern-card" style={{ textAlign: 'center', borderLeft: `4px solid ${stat.color}`, background: 'var(--bg-card)' }}>
|
||||
<div style={{ color: stat.color, fontSize: 24, marginBottom: 8 }}>{stat.icon}</div>
|
||||
<Statistic title={stat.title} value={stat.value} suffix={stat.suffix} valueStyle={{ color: 'var(--text-primary)', fontSize: 28, fontWeight: 'bold' }} />
|
||||
</Card>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
|
||||
<Row gutter={[24, 24]}>
|
||||
{/* 系统状态 */}
|
||||
<Col xs={24} md={12}>
|
||||
<Card className="modern-card" title={
|
||||
<span style={{ color: 'var(--text-primary)' }}>
|
||||
<ThunderboltOutlined style={{ marginRight: 8, color: '#667eea' }} />
|
||||
系统状态
|
||||
</span>
|
||||
}>
|
||||
<Card className="modern-card" title={<span style={{ color: 'var(--text-primary)' }}><ThunderboltOutlined style={{ marginRight: 8, color: '#667eea' }} />系统状态</span>}>
|
||||
<Space direction="vertical" style={{ width: '100%' }} size={16}>
|
||||
<div>
|
||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: 8 }}>
|
||||
@@ -143,14 +86,8 @@ const Welcome: React.FC = () => {
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
{/* 快捷操作 */}
|
||||
<Col xs={24} md={12}>
|
||||
<Card className="modern-card" title={
|
||||
<span style={{ color: 'var(--text-primary)' }}>
|
||||
<TrophyOutlined style={{ marginRight: 8, color: '#667eea' }} />
|
||||
快捷操作
|
||||
</span>
|
||||
}>
|
||||
<Card className="modern-card" title={<span style={{ color: 'var(--text-primary)' }}><TrophyOutlined style={{ marginRight: 8, color: '#667eea' }} />快捷操作</span>}>
|
||||
<Row gutter={[16, 16]}>
|
||||
{quickActions.map((action, index) => (
|
||||
<Col span={12} key={index}>
|
||||
@@ -158,16 +95,7 @@ const Welcome: React.FC = () => {
|
||||
block
|
||||
size="large"
|
||||
className="tech-button"
|
||||
style={{
|
||||
height: 64,
|
||||
background: `linear-gradient(135deg, ${action.color}33, ${action.color}11)`,
|
||||
border: `1px solid ${action.color}44`,
|
||||
color: action.color,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center'
|
||||
}}
|
||||
style={{ height: 64, background: `linear-gradient(135deg, ${action.color}33, ${action.color}11)`, border: `1px solid ${action.color}44`, color: action.color, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center' }}
|
||||
>
|
||||
<div style={{ fontSize: 20, marginBottom: 4 }}>{action.icon}</div>
|
||||
<div style={{ fontSize: 12 }}>{action.title}</div>
|
||||
@@ -179,45 +107,13 @@ const Welcome: React.FC = () => {
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
{/* 功能介绍 */}
|
||||
<Card className="modern-card" style={{ marginTop: 24 }} title={
|
||||
<span style={{ color: 'var(--text-primary)' }}>
|
||||
<GlobalOutlined style={{ marginRight: 8, color: '#667eea' }} />
|
||||
平台特性
|
||||
</span>
|
||||
}>
|
||||
<Card className="modern-card" style={{ marginTop: 24 }} title={<span style={{ color: 'var(--text-primary)' }}><GlobalOutlined style={{ marginRight: 8, color: '#667eea' }} />平台特性</span>}>
|
||||
<Row gutter={[24, 24]}>
|
||||
<Col xs={24} sm={12} md={8}>
|
||||
<div style={{ textAlign: 'center', padding: 16 }}>
|
||||
<div style={{ fontSize: 32, color: '#667eea', marginBottom: 12 }}>
|
||||
<RocketOutlined />
|
||||
</div>
|
||||
<div style={{ fontSize: 32, color: '#667eea', marginBottom: 12 }}><RocketOutlined /></div>
|
||||
<Title level={4} style={{ color: 'var(--text-primary)' }}>高性能架构</Title>
|
||||
<Paragraph style={{ color: 'var(--text-secondary)' }}>
|
||||
基于微服务架构,支持高并发访问,确保系统稳定运行
|
||||
</Paragraph>
|
||||
</div>
|
||||
</Col>
|
||||
<Col xs={24} sm={12} md={8}>
|
||||
<div style={{ textAlign: 'center', padding: 16 }}>
|
||||
<div style={{ fontSize: 32, color: '#764ba2', marginBottom: 12 }}>
|
||||
<SafetyOutlined />
|
||||
</div>
|
||||
<Title level={4} style={{ color: 'var(--text-primary)' }}>安全可靠</Title>
|
||||
<Paragraph style={{ color: 'var(--text-secondary)' }}>
|
||||
多层安全防护,数据加密传输,保障业务数据安全
|
||||
</Paragraph>
|
||||
</div>
|
||||
</Col>
|
||||
<Col xs={24} sm={12} md={8}>
|
||||
<div style={{ textAlign: 'center', padding: 16 }}>
|
||||
<div style={{ fontSize: 32, color: '#f093fb', marginBottom: 12 }}>
|
||||
<ThunderboltOutlined />
|
||||
</div>
|
||||
<Title level={4} style={{ color: 'var(--text-primary)' }}>智能运维</Title>
|
||||
<Paragraph style={{ color: 'var(--text-secondary)' }}>
|
||||
实时监控预警,自动化运维管理,降低运维成本
|
||||
</Paragraph>
|
||||
<Paragraph style={{ color: 'var(--text-secondary)' }}>基于微服务架构,支持高并发访问,确保系统稳定运行</Paragraph>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
@@ -226,5 +122,4 @@ const Welcome: React.FC = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default Welcome;
|
||||
|
||||
export default Welcome;
|
||||
Reference in New Issue
Block a user