import React, { useState, useEffect } from 'react' import { Card, Row, Col, Statistic, Spin } from 'antd' import { DesktopOutlined, TeamOutlined, BellOutlined, CheckCircleOutlined, ToolOutlined, CloseCircleOutlined, ExclamationCircleOutlined } from '@ant-design/icons' import axios from 'axios' function Dashboard({ onNavigate }) { const [stats, setStats] = useState(null) const [loading, setLoading] = useState(true) useEffect(() => { fetchStats() }, []) const fetchStats = async () => { try { const res = await axios.get('/api/dashboard/stats') if (res.data.success) { setStats(res.data.data) } } catch (err) { console.error('获取统计数据失败:', err) } finally { setLoading(false) } } if (loading) { return
} return (

数据概览

onNavigate('devices')}> } valueStyle={{ color: '#1890ff' }} /> } valueStyle={{ color: '#52c41a' }} /> } valueStyle={{ color: '#faad14' }} /> } valueStyle={{ color: '#f5222d' }} /> onNavigate('personnel')}> } valueStyle={{ color: '#722ed1' }} /> } valueStyle={{ color: '#13c2c2' }} /> onNavigate('notifications')}> } valueStyle={{ color: '#fa541c' }} suffix={/ {stats?.notifTotal || 0}} />

系统信息

系统版本:v1.0.0

系统名称:设备管理系统

数据库:SQLite

前端框架:React + Ant Design

后端框架:Express.js

部署方式:服务器 / 桌面应用

) } export default Dashboard