"use client" import { useState, useEffect } from "react" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Users, TrendingUp, Database, Activity, Zap, DollarSign, BarChart3, RefreshCw, AlertCircle, CheckCircle2, Clock, ArrowUpRight, ArrowDownRight, Cpu, HardDrive, Globe, Shield } from 'lucide-react' import { Progress } from "@/components/ui/progress" import { LineChart, Line, BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell } from 'recharts' export default function PlatformDashboard() { const [refreshing, setRefreshing] = useState(false) const [lastUpdate, setLastUpdate] = useState(new Date()) const monthlyData = [ { month: '1月', users: 3.85, value: 98.5 }, { month: '2月', users: 3.92, value: 102.5 }, { month: '3月', users: 4.05, value: 108.5 }, { month: '4月', users: 4.12, value: 114.2 }, { month: '5月', users: 4.21, value: 119.8 }, { month: '6月', users: 4.29, value: 125.8 }, ] const levelData = [ { name: 'S级', value: 3.0, color: '#8b5cf6' }, { name: 'A级', value: 11.0, color: '#3b82f6' }, { name: 'B级', value: 25.0, color: '#10b981' }, { name: 'C级', value: 40.0, color: '#f59e0b' }, { name: 'D级', value: 21.0, color: '#9ca3af' }, ] // 模拟真实平台数据 const platformStats = { totalUsers: 4285670000, // 42.8亿用户 totalProjects: 156, // 156个项目 totalEnterprises: 48, // 48家企业 totalWeChatAccounts: 892, // 892个微信号 dataCoverage: 87.3, // 数据覆盖率 assetValue: 12580000000, // 125.8亿资产价值 todayGrowth: 2845000, // 今日新增用户 activeRate: 68.5, // 活跃率 aiModelStatus: "running", // AI运行状态 dataSync: 94.2, // 数据同步进度 } // 项目分布数据 const projectDistribution = [ { name: "美妆行业", projects: 42, users: 1285000000, value: 3850000000, growth: 12.5 }, { name: "教育培训", projects: 28, users: 856000000, value: 2280000000, growth: 8.3 }, { name: "电商零售", projects: 35, users: 1124000000, value: 3560000000, growth: 15.2 }, { name: "金融服务", projects: 18, users: 624000000, value: 1950000000, growth: 6.8 }, { name: "其他行业", projects: 33, users: 396670000, value: 940000000, growth: 4.2 }, ] // 价值评分分布 (S/A/B/C/D级) const valueDistribution = [ { level: "S", count: 128456700, percentage: 3.0, avgValue: 580, color: "bg-purple-500" }, { level: "A", count: 471424550, percentage: 11.0, avgValue: 320, color: "bg-blue-500" }, { level: "B", count: 1071416750, percentage: 25.0, avgValue: 180, color: "bg-green-500" }, { level: "C", count: 1714283500, percentage: 40.0, avgValue: 85, color: "bg-yellow-500" }, { level: "D", count: 900088500, percentage: 21.0, avgValue: 25, color: "bg-gray-400" }, ] // AI模型运行数据 const aiModels = [ { name: "数据清洗模型", status: "running", accuracy: 96.8, processedToday: 2845000, avgTime: 1.2 }, { name: "用户标签模型", status: "running", accuracy: 94.5, processedToday: 2845000, avgTime: 0.8 }, { name: "价值预测模型", status: "running", accuracy: 91.2, processedToday: 1580000, avgTime: 2.5 }, { name: "流失预警模型", status: "training", accuracy: 88.9, processedToday: 0, avgTime: 0 }, ] // 数据流转实时状态 const dataFlow = { incoming: 4250, // 每秒接入数据 processing: 3890, // 每秒处理数据 outgoing: 3650, // 每秒输出数据 queueSize: 12580, // 队列大小 } const refreshData = async () => { setRefreshing(true) // 模拟刷新延迟 await new Promise((resolve) => setTimeout(resolve, 1000)) setLastUpdate(new Date()) setRefreshing(false) } const formatNumber = (num: number): string => { if (num >= 1000000000) return `${(num / 1000000000).toFixed(1)}B` if (num >= 1000000) return `${(num / 1000000).toFixed(1)}M` if (num >= 1000) return `${(num / 1000).toFixed(1)}K` return num.toString() } const formatCurrency = (num: number): string => { if (num >= 100000000) return `${(num / 100000000).toFixed(1)}亿` if (num >= 10000) return `${(num / 10000).toFixed(1)}万` return num.toString() } return (

平台总览

神射手数据资产中台 - 实时监控

系统正常运行
最后更新: {lastUpdate.toLocaleTimeString("zh-CN")}
{/* 核心指标 */}
用户资产总量
{formatNumber(platformStats.totalUsers)}
+{formatNumber(platformStats.todayGrowth)} 今日新增
活跃率: {platformStats.activeRate}%
数据资产价值
¥{formatCurrency(platformStats.assetValue)}
+15.8% 本月增长
人均价值: ¥{(platformStats.assetValue / platformStats.totalUsers).toFixed(2)}
项目与企业
企业数 {platformStats.totalEnterprises}
项目数 {platformStats.totalProjects}
微信号 {platformStats.totalWeChatAccounts}
AI运行状态
4个模型运行中
平均准确率 92.9%
今日处理 {formatNumber(7270000)}
平均耗时 1.2s
用户增长趋势 资产价值趋势
价值评分分布 `${name} ${value}%`} outerRadius={80} fill="#8884d8" dataKey="value" > {levelData.map((entry, index) => ( ))}
{valueDistribution.map((item, index) => (
{item.level}
{formatNumber(item.count)}
))}
数据流转实时状态
数据接入
{dataFlow.incoming}/s
数据处理
{dataFlow.processing}/s
数据输出
{dataFlow.outgoing}/s
队列大小
{dataFlow.queueSize}
{/* 项目分布 */} 项目运营与企业分布
{projectDistribution.map((item, index) => (
{item.name}
{item.projects} 项目
+{item.growth}%
用户数
{formatNumber(item.users)}
资产价值
¥{formatCurrency(item.value)}
人均价值
¥{(item.value / item.users).toFixed(2)}
))}
) }