Dashboard.tsx 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import React from 'react';
  2. import {
  3. Card, Row, Col, Typography, Statistic, Space
  4. } from 'antd';
  5. import {
  6. UserOutlined, BellOutlined, EyeOutlined
  7. } from '@ant-design/icons';
  8. const { Title } = Typography;
  9. // 仪表盘页面
  10. export const DashboardPage = () => {
  11. return (
  12. <div>
  13. <div className="mb-6 flex justify-between items-center">
  14. <Title level={2}>仪表盘</Title>
  15. </div>
  16. <Row gutter={[16, 16]}>
  17. <Col xs={24} sm={12} lg={8}>
  18. <Card className="shadow-sm transition-all duration-300 hover:shadow-md">
  19. <div className="flex items-center justify-between mb-2">
  20. <Typography.Title level={5}>活跃用户</Typography.Title>
  21. <UserOutlined style={{ fontSize: 24, color: '#1890ff' }} />
  22. </div>
  23. <Statistic
  24. value={112893}
  25. loading={false}
  26. valueStyle={{ fontSize: 28 }}
  27. prefix={<span style={{ color: '#52c41a' }}>↑</span>}
  28. suffix="人"
  29. />
  30. <div style={{ marginTop: 8, fontSize: 12, color: '#8c8c8c' }}>
  31. 较昨日增长 12.5%
  32. </div>
  33. </Card>
  34. </Col>
  35. <Col xs={24} sm={12} lg={8}>
  36. <Card className="shadow-sm transition-all duration-300 hover:shadow-md">
  37. <div className="flex items-center justify-between mb-2">
  38. <Typography.Title level={5}>系统消息</Typography.Title>
  39. <BellOutlined style={{ fontSize: 24, color: '#faad14' }} />
  40. </div>
  41. <Statistic
  42. value={93}
  43. loading={false}
  44. valueStyle={{ fontSize: 28 }}
  45. prefix={<span style={{ color: '#faad14' }}>●</span>}
  46. suffix="条"
  47. />
  48. <div style={{ marginTop: 8, fontSize: 12, color: '#8c8c8c' }}>
  49. 其中 5 条未读
  50. </div>
  51. </Card>
  52. </Col>
  53. <Col xs={24} sm={12} lg={8}>
  54. <Card className="shadow-sm transition-all duration-300 hover:shadow-md">
  55. <div className="flex items-center justify-between mb-2">
  56. <Typography.Title level={5}>在线用户</Typography.Title>
  57. <EyeOutlined style={{ fontSize: 24, color: '#722ed1' }} />
  58. </div>
  59. <Statistic
  60. value={1128}
  61. loading={false}
  62. valueStyle={{ fontSize: 28 }}
  63. suffix="人"
  64. />
  65. <div style={{ marginTop: 8, fontSize: 12, color: '#8c8c8c' }}>
  66. 当前在线率 32.1%
  67. </div>
  68. </Card>
  69. </Col>
  70. </Row>
  71. </div>
  72. );
  73. };