fix: resolve deployment errors and add missing files
Fix CSS issue and create missing documentation files Add new data platform and mobile optimization features Co-authored-by: null <4804959+fnvtk@users.noreply.github.com>
This commit is contained in:
619
app/page.tsx
619
app/page.tsx
@@ -1,308 +1,407 @@
|
||||
"use client"
|
||||
import { useRouter } from "next/navigation"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
import { useState } from "react"
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { Progress } from "@/components/ui/progress"
|
||||
import { Database, Users, Target, TrendingUp, Activity, CheckCircle, ArrowRight, BarChart3, Zap } from "lucide-react"
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
|
||||
import {
|
||||
Database,
|
||||
Target,
|
||||
Brain,
|
||||
Search,
|
||||
BarChart3,
|
||||
RefreshCw,
|
||||
Download,
|
||||
ChevronRight,
|
||||
Activity,
|
||||
Zap,
|
||||
} from "lucide-react"
|
||||
import Link from "next/link"
|
||||
|
||||
export default function Home() {
|
||||
const router = useRouter()
|
||||
export default function HomePage() {
|
||||
const [timeRange, setTimeRange] = useState("today")
|
||||
|
||||
// 真实的数据概览
|
||||
const systemOverview = {
|
||||
totalUsers: 156234,
|
||||
activeUsers: 89167,
|
||||
dataIntegrations: 12,
|
||||
avgUserValue: 3248,
|
||||
dataQuality: 94.6,
|
||||
syncStatus: "正常",
|
||||
// 今日数据概览
|
||||
const todayStats = {
|
||||
dataSync: {
|
||||
total: 1245678,
|
||||
growth: "+12.5%",
|
||||
sources: 8,
|
||||
lastUpdate: "2分钟前",
|
||||
},
|
||||
userDiscovery: {
|
||||
activeUsers: 45678,
|
||||
newUsers: 1234,
|
||||
engagement: "87.5%",
|
||||
growth: "+8.2%",
|
||||
},
|
||||
userValuation: {
|
||||
avgValue: 3248,
|
||||
highValue: 12456,
|
||||
growth: "+15.8%",
|
||||
upgradeRate: "12.5%",
|
||||
},
|
||||
aiAnalysis: {
|
||||
insights: 156,
|
||||
anomalies: 3,
|
||||
predictions: 89,
|
||||
accuracy: "94.2%",
|
||||
},
|
||||
}
|
||||
|
||||
// 数据集成状态
|
||||
const dataIntegrations = [
|
||||
{ name: "用户行为数据", status: "connected", lastSync: "2分钟前", records: 245673 },
|
||||
{ name: "CRM系统", status: "connected", lastSync: "5分钟前", records: 156234 },
|
||||
{ name: "内容互动数据", status: "connected", lastSync: "1分钟前", records: 892456 },
|
||||
{ name: "营销活动数据", status: "syncing", lastSync: "正在同步", records: 0 },
|
||||
]
|
||||
|
||||
// 用户画像概览
|
||||
const userPortraitStats = {
|
||||
totalTags: 342,
|
||||
activeTags: 287,
|
||||
userCoverage: 95.8,
|
||||
segmentCount: 24,
|
||||
}
|
||||
|
||||
// 用户估值概览
|
||||
const userValueStats = {
|
||||
highValueUsers: 18234,
|
||||
mediumValueUsers: 47891,
|
||||
lowValueUsers: 32156,
|
||||
upgradeRate: 12.3,
|
||||
}
|
||||
|
||||
const quickActions = [
|
||||
// 实时活动数据
|
||||
const realtimeActivities = [
|
||||
{
|
||||
title: "数据集成",
|
||||
description: "管理数据源和同步",
|
||||
icon: <Database className="h-5 w-5" />,
|
||||
href: "/data-integration",
|
||||
color: "bg-blue-50 hover:bg-blue-100 border-blue-200",
|
||||
id: 1,
|
||||
type: "data_sync",
|
||||
message: "电商平台数据同步完成",
|
||||
time: "刚刚",
|
||||
status: "success",
|
||||
},
|
||||
{
|
||||
title: "用户画像",
|
||||
description: "查看用户标签和分群",
|
||||
icon: <Users className="h-5 w-5" />,
|
||||
href: "/user-portrait",
|
||||
color: "bg-purple-50 hover:bg-purple-100 border-purple-200",
|
||||
id: 2,
|
||||
type: "user_discovery",
|
||||
message: "发现新用户行为模式",
|
||||
time: "2分钟前",
|
||||
status: "info",
|
||||
},
|
||||
{
|
||||
title: "用户估值",
|
||||
description: "分析用户价值和升级路径",
|
||||
icon: <Target className="h-5 w-5" />,
|
||||
href: "/user-value",
|
||||
color: "bg-green-50 hover:bg-green-100 border-green-200",
|
||||
id: 3,
|
||||
type: "ai_analysis",
|
||||
message: "AI检测到异常流量",
|
||||
time: "5分钟前",
|
||||
status: "warning",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
type: "user_valuation",
|
||||
message: "用户价值模型更新完成",
|
||||
time: "8分钟前",
|
||||
status: "success",
|
||||
},
|
||||
]
|
||||
|
||||
const getActivityIcon = (type: string) => {
|
||||
switch (type) {
|
||||
case "data_sync":
|
||||
return <Database className="h-4 w-4" />
|
||||
case "user_discovery":
|
||||
return <Search className="h-4 w-4" />
|
||||
case "user_valuation":
|
||||
return <Target className="h-4 w-4" />
|
||||
case "ai_analysis":
|
||||
return <Brain className="h-4 w-4" />
|
||||
default:
|
||||
return <Activity className="h-4 w-4" />
|
||||
}
|
||||
}
|
||||
|
||||
const getStatusColor = (status: string) => {
|
||||
switch (status) {
|
||||
case "success":
|
||||
return "text-green-600"
|
||||
case "warning":
|
||||
return "text-yellow-600"
|
||||
case "info":
|
||||
return "text-blue-600"
|
||||
default:
|
||||
return "text-gray-600"
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="container mx-auto py-6 space-y-8">
|
||||
{/* 页面标题 */}
|
||||
<div className="text-center space-y-2">
|
||||
<h1 className="text-3xl font-bold bg-gradient-to-r from-blue-600 to-purple-600 bg-clip-text text-transparent">
|
||||
用户数字资产中台
|
||||
</h1>
|
||||
<p className="text-muted-foreground">统一的用户数据管理和分析平台</p>
|
||||
<div className="container mx-auto py-4 md:py-6 space-y-4 md:space-y-6">
|
||||
{/* 页面标题和工具栏 */}
|
||||
<div className="flex flex-col md:flex-row md:justify-between md:items-center gap-4">
|
||||
<div>
|
||||
<h1 className="text-2xl md:text-3xl font-bold tracking-tight">数据概览</h1>
|
||||
<p className="text-sm md:text-base text-muted-foreground">智能数据分析平台总览</p>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Select value={timeRange} onValueChange={setTimeRange}>
|
||||
<SelectTrigger className="w-[120px] text-sm">
|
||||
<SelectValue placeholder="时间范围" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="today">今日</SelectItem>
|
||||
<SelectItem value="week">本周</SelectItem>
|
||||
<SelectItem value="month">本月</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<Button variant="outline" size="icon" className="h-9 w-9 bg-transparent">
|
||||
<RefreshCw className="h-4 w-4" />
|
||||
</Button>
|
||||
<Button variant="outline" size="sm" className="hidden md:flex bg-transparent">
|
||||
<Download className="mr-2 h-4 w-4" />
|
||||
导出
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 系统概览 */}
|
||||
<Card className="border-none shadow-lg">
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<BarChart3 className="h-5 w-5" />
|
||||
系统概览
|
||||
</CardTitle>
|
||||
<CardDescription>平台整体运行状况</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
||||
<div className="bg-gradient-to-r from-blue-50 to-blue-100 rounded-lg p-4">
|
||||
{/* 核心功能模块 */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||
{/* 数据中台 */}
|
||||
<Link href="/data-platform">
|
||||
<Card className="border-none shadow-md hover:shadow-lg transition-all duration-300 cursor-pointer group">
|
||||
<CardHeader className="bg-gradient-to-r from-blue-50 to-indigo-50 pb-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<p className="text-sm font-medium text-blue-600">总用户数</p>
|
||||
<p className="text-2xl font-bold text-blue-900">{systemOverview.totalUsers.toLocaleString()}</p>
|
||||
<div className="flex items-center gap-2">
|
||||
<Database className="h-5 w-5 text-blue-600" />
|
||||
<CardTitle className="text-base">数据中台</CardTitle>
|
||||
</div>
|
||||
<Users className="h-8 w-8 text-blue-600" />
|
||||
<Badge className="bg-blue-100 text-blue-700">核心</Badge>
|
||||
</div>
|
||||
<div className="mt-2">
|
||||
<p className="text-xs text-blue-600">
|
||||
活跃用户: {systemOverview.activeUsers.toLocaleString()} (
|
||||
{((systemOverview.activeUsers / systemOverview.totalUsers) * 100).toFixed(1)}%)
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="bg-gradient-to-r from-purple-50 to-purple-100 rounded-lg p-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<p className="text-sm font-medium text-purple-600">平均用户价值</p>
|
||||
<p className="text-2xl font-bold text-purple-900">¥{systemOverview.avgUserValue.toLocaleString()}</p>
|
||||
<CardDescription className="text-xs">多源数据整合中心</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="pt-3">
|
||||
<div className="space-y-2">
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-gray-600">数据总量</span>
|
||||
<span className="font-bold">{todayStats.dataSync.total.toLocaleString()}</span>
|
||||
</div>
|
||||
<Target className="h-8 w-8 text-purple-600" />
|
||||
</div>
|
||||
<div className="mt-2">
|
||||
<p className="text-xs text-purple-600">较上月提升 8.2%</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="bg-gradient-to-r from-green-50 to-green-100 rounded-lg p-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<p className="text-sm font-medium text-green-600">数据质量</p>
|
||||
<p className="text-2xl font-bold text-green-900">{systemOverview.dataQuality}%</p>
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-gray-600">数据源</span>
|
||||
<span className="font-bold">{todayStats.dataSync.sources}个</span>
|
||||
</div>
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-gray-600">增长率</span>
|
||||
<span className="text-green-600 font-bold">{todayStats.dataSync.growth}</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between mt-3">
|
||||
<span className="text-xs text-gray-500">最后更新: {todayStats.dataSync.lastUpdate}</span>
|
||||
<ChevronRight className="h-4 w-4 text-gray-400 group-hover:text-blue-600 transition-colors" />
|
||||
</div>
|
||||
<CheckCircle className="h-8 w-8 text-green-600" />
|
||||
</div>
|
||||
<div className="mt-2">
|
||||
<Progress value={systemOverview.dataQuality} className="h-2" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* 快速操作 */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
|
||||
{quickActions.map((action, index) => (
|
||||
<Card
|
||||
key={index}
|
||||
className={cn(
|
||||
"border-2 cursor-pointer transition-all duration-300 hover:shadow-lg hover:scale-105",
|
||||
action.color,
|
||||
)}
|
||||
onClick={() => router.push(action.href)}
|
||||
>
|
||||
<CardContent className="p-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<div className="p-2 rounded-lg bg-white/50">{action.icon}</div>
|
||||
<ArrowRight className="h-5 w-5 text-gray-400" />
|
||||
</div>
|
||||
<h3 className="font-semibold text-lg mb-2">{action.title}</h3>
|
||||
<p className="text-sm text-gray-600">{action.description}</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
))}
|
||||
</Link>
|
||||
|
||||
{/* 用户发现 */}
|
||||
<Link href="/user-discovery">
|
||||
<Card className="border-none shadow-md hover:shadow-lg transition-all duration-300 cursor-pointer group">
|
||||
<CardHeader className="bg-gradient-to-r from-green-50 to-emerald-50 pb-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<Search className="h-5 w-5 text-green-600" />
|
||||
<CardTitle className="text-base">用户发现</CardTitle>
|
||||
</div>
|
||||
</div>
|
||||
<CardDescription className="text-xs">用户行为洞察分析</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="pt-3">
|
||||
<div className="space-y-2">
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-gray-600">活跃用户</span>
|
||||
<span className="font-bold">{todayStats.userDiscovery.activeUsers.toLocaleString()}</span>
|
||||
</div>
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-gray-600">新增用户</span>
|
||||
<span className="font-bold">{todayStats.userDiscovery.newUsers.toLocaleString()}</span>
|
||||
</div>
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-gray-600">参与度</span>
|
||||
<span className="text-green-600 font-bold">{todayStats.userDiscovery.engagement}</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between mt-3">
|
||||
<span className="text-xs text-green-600">增长 {todayStats.userDiscovery.growth}</span>
|
||||
<ChevronRight className="h-4 w-4 text-gray-400 group-hover:text-green-600 transition-colors" />
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Link>
|
||||
|
||||
{/* 用户估值 */}
|
||||
<Link href="/user-valuation">
|
||||
<Card className="border-none shadow-md hover:shadow-lg transition-all duration-300 cursor-pointer group">
|
||||
<CardHeader className="bg-gradient-to-r from-purple-50 to-pink-50 pb-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<Target className="h-5 w-5 text-purple-600" />
|
||||
<CardTitle className="text-base">用户估值</CardTitle>
|
||||
</div>
|
||||
</div>
|
||||
<CardDescription className="text-xs">用户价值评估模型</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="pt-3">
|
||||
<div className="space-y-2">
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-gray-600">平均估值</span>
|
||||
<span className="font-bold">¥{todayStats.userValuation.avgValue.toLocaleString()}</span>
|
||||
</div>
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-gray-600">高价值用户</span>
|
||||
<span className="font-bold">{todayStats.userValuation.highValue.toLocaleString()}</span>
|
||||
</div>
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-gray-600">升级率</span>
|
||||
<span className="text-purple-600 font-bold">{todayStats.userValuation.upgradeRate}</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between mt-3">
|
||||
<span className="text-xs text-purple-600">增长 {todayStats.userValuation.growth}</span>
|
||||
<ChevronRight className="h-4 w-4 text-gray-400 group-hover:text-purple-600 transition-colors" />
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Link>
|
||||
|
||||
{/* AI分析 */}
|
||||
<Link href="/ai-analysis">
|
||||
<Card className="border-none shadow-md hover:shadow-lg transition-all duration-300 cursor-pointer group">
|
||||
<CardHeader className="bg-gradient-to-r from-orange-50 to-red-50 pb-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="flex items-center gap-2">
|
||||
<Brain className="h-5 w-5 text-orange-600" />
|
||||
<CardTitle className="text-base">AI分析</CardTitle>
|
||||
</div>
|
||||
<Badge className="bg-orange-100 text-orange-700">AI</Badge>
|
||||
</div>
|
||||
<CardDescription className="text-xs">智能数据洞察</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="pt-3">
|
||||
<div className="space-y-2">
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-gray-600">AI洞察</span>
|
||||
<span className="font-bold">{todayStats.aiAnalysis.insights}</span>
|
||||
</div>
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-gray-600">异常检测</span>
|
||||
<span className="font-bold">{todayStats.aiAnalysis.anomalies}</span>
|
||||
</div>
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm text-gray-600">预测准确率</span>
|
||||
<span className="text-orange-600 font-bold">{todayStats.aiAnalysis.accuracy}</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between mt-3">
|
||||
<span className="text-xs text-orange-600">预测 {todayStats.aiAnalysis.predictions}个</span>
|
||||
<ChevronRight className="h-4 w-4 text-gray-400 group-hover:text-orange-600 transition-colors" />
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{/* 详细状态 */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
||||
{/* 数据集成状态 */}
|
||||
<Card>
|
||||
{/* 实时数据流 */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-4 md:gap-6">
|
||||
{/* 今日关键指标 */}
|
||||
<Card className="lg:col-span-2 border-none shadow-md">
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Database className="h-5 w-5" />
|
||||
数据集成状态
|
||||
<BarChart3 className="h-5 w-5 text-blue-600" />
|
||||
今日关键指标
|
||||
</CardTitle>
|
||||
<CardDescription>当前数据源连接状态</CardDescription>
|
||||
<CardDescription>实时数据监控</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
<div className="text-center p-3 bg-blue-50 rounded-lg">
|
||||
<div className="text-2xl font-bold text-blue-600">98.5%</div>
|
||||
<div className="text-xs text-gray-600">系统可用性</div>
|
||||
</div>
|
||||
<div className="text-center p-3 bg-green-50 rounded-lg">
|
||||
<div className="text-2xl font-bold text-green-600">2.3s</div>
|
||||
<div className="text-xs text-gray-600">平均响应时间</div>
|
||||
</div>
|
||||
<div className="text-center p-3 bg-purple-50 rounded-lg">
|
||||
<div className="text-2xl font-bold text-purple-600">156</div>
|
||||
<div className="text-xs text-gray-600">AI洞察数</div>
|
||||
</div>
|
||||
<div className="text-center p-3 bg-orange-50 rounded-lg">
|
||||
<div className="text-2xl font-bold text-orange-600">94.2%</div>
|
||||
<div className="text-xs text-gray-600">预测准确率</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-4 space-y-3">
|
||||
<div>
|
||||
<div className="flex justify-between text-sm mb-1">
|
||||
<span>数据处理进度</span>
|
||||
<span>87%</span>
|
||||
</div>
|
||||
<Progress value={87} className="h-2" />
|
||||
</div>
|
||||
<div>
|
||||
<div className="flex justify-between text-sm mb-1">
|
||||
<span>AI模型训练</span>
|
||||
<span>92%</span>
|
||||
</div>
|
||||
<Progress value={92} className="h-2" />
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* 实时活动 */}
|
||||
<Card className="border-none shadow-md">
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Activity className="h-5 w-5 text-green-600" />
|
||||
实时活动
|
||||
</CardTitle>
|
||||
<CardDescription>系统活动监控</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-3">
|
||||
{dataIntegrations.map((integration, index) => (
|
||||
<div key={index} className="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
|
||||
<div className="flex items-center gap-3">
|
||||
<div
|
||||
className={cn(
|
||||
"w-3 h-3 rounded-full",
|
||||
integration.status === "connected"
|
||||
? "bg-green-500"
|
||||
: integration.status === "syncing"
|
||||
? "bg-yellow-500"
|
||||
: "bg-red-500",
|
||||
)}
|
||||
/>
|
||||
<div>
|
||||
<p className="font-medium text-sm">{integration.name}</p>
|
||||
<p className="text-xs text-gray-500">{integration.lastSync}</p>
|
||||
</div>
|
||||
{realtimeActivities.map((activity) => (
|
||||
<div key={activity.id} className="flex items-start gap-3 p-2 hover:bg-gray-50 rounded-lg">
|
||||
<div className={`p-1 rounded-full ${getStatusColor(activity.status)}`}>
|
||||
{getActivityIcon(activity.type)}
|
||||
</div>
|
||||
<div className="text-right">
|
||||
<p className="text-sm font-medium">{integration.records.toLocaleString()}</p>
|
||||
<p className="text-xs text-gray-500">记录</p>
|
||||
<div className="flex-1 min-w-0">
|
||||
<p className="text-sm font-medium truncate">{activity.message}</p>
|
||||
<p className="text-xs text-gray-500">{activity.time}</p>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="w-full mt-4 bg-transparent"
|
||||
onClick={() => router.push("/data-integration")}
|
||||
>
|
||||
查看详情
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* 用户画像概览 */}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Users className="h-5 w-5" />
|
||||
用户画像概览
|
||||
</CardTitle>
|
||||
<CardDescription>用户标签和分群统计</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="grid grid-cols-2 gap-4 mb-4">
|
||||
<div className="text-center p-3 bg-purple-50 rounded-lg">
|
||||
<p className="text-2xl font-bold text-purple-600">{userPortraitStats.totalTags}</p>
|
||||
<p className="text-sm text-gray-600">总标签数</p>
|
||||
</div>
|
||||
<div className="text-center p-3 bg-blue-50 rounded-lg">
|
||||
<p className="text-2xl font-bold text-blue-600">{userPortraitStats.segmentCount}</p>
|
||||
<p className="text-sm text-gray-600">用户分群</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm">标签覆盖率</span>
|
||||
<span className="text-sm font-medium">{userPortraitStats.userCoverage}%</span>
|
||||
</div>
|
||||
<Progress value={userPortraitStats.userCoverage} className="h-2" />
|
||||
<div className="flex justify-between items-center">
|
||||
<span className="text-sm">活跃标签</span>
|
||||
<span className="text-sm font-medium">{userPortraitStats.activeTags}</span>
|
||||
</div>
|
||||
<Progress value={(userPortraitStats.activeTags / userPortraitStats.totalTags) * 100} className="h-2" />
|
||||
</div>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="w-full mt-4 bg-transparent"
|
||||
onClick={() => router.push("/user-portrait")}
|
||||
>
|
||||
查看详情
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* 用户估值概览 */}
|
||||
<Card className="lg:col-span-2">
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Target className="h-5 w-5" />
|
||||
用户价值分布
|
||||
</CardTitle>
|
||||
<CardDescription>用户价值等级和升级情况</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="grid grid-cols-1 md:grid-cols-4 gap-4">
|
||||
<div className="bg-green-50 p-4 rounded-lg">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<p className="text-sm font-medium text-green-600">高价值用户</p>
|
||||
<TrendingUp className="h-4 w-4 text-green-600" />
|
||||
</div>
|
||||
<p className="text-xl font-bold text-green-900">{userValueStats.highValueUsers.toLocaleString()}</p>
|
||||
<p className="text-xs text-green-600">
|
||||
占比 {((userValueStats.highValueUsers / systemOverview.totalUsers) * 100).toFixed(1)}%
|
||||
</p>
|
||||
</div>
|
||||
<div className="bg-blue-50 p-4 rounded-lg">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<p className="text-sm font-medium text-blue-600">中价值用户</p>
|
||||
<Activity className="h-4 w-4 text-blue-600" />
|
||||
</div>
|
||||
<p className="text-xl font-bold text-blue-900">{userValueStats.mediumValueUsers.toLocaleString()}</p>
|
||||
<p className="text-xs text-blue-600">
|
||||
占比 {((userValueStats.mediumValueUsers / systemOverview.totalUsers) * 100).toFixed(1)}%
|
||||
</p>
|
||||
</div>
|
||||
<div className="bg-gray-50 p-4 rounded-lg">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<p className="text-sm font-medium text-gray-600">低价值用户</p>
|
||||
<Users className="h-4 w-4 text-gray-600" />
|
||||
</div>
|
||||
<p className="text-xl font-bold text-gray-900">{userValueStats.lowValueUsers.toLocaleString()}</p>
|
||||
<p className="text-xs text-gray-600">
|
||||
占比 {((userValueStats.lowValueUsers / systemOverview.totalUsers) * 100).toFixed(1)}%
|
||||
</p>
|
||||
</div>
|
||||
<div className="bg-orange-50 p-4 rounded-lg">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<p className="text-sm font-medium text-orange-600">升级率</p>
|
||||
<Zap className="h-4 w-4 text-orange-600" />
|
||||
</div>
|
||||
<p className="text-xl font-bold text-orange-900">{userValueStats.upgradeRate}%</p>
|
||||
<p className="text-xs text-orange-600">较上月提升 2.1%</p>
|
||||
</div>
|
||||
</div>
|
||||
<Button variant="outline" className="w-full mt-4 bg-transparent" onClick={() => router.push("/user-value")}>
|
||||
查看详情
|
||||
<Button variant="outline" className="w-full mt-4 text-sm bg-transparent">
|
||||
查看全部活动
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
{/* 快速操作 */}
|
||||
<Card className="border-none shadow-md">
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<Zap className="h-5 w-5 text-yellow-600" />
|
||||
快速操作
|
||||
</CardTitle>
|
||||
<CardDescription>常用功能快捷入口</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-3">
|
||||
<Link href="/data-platform">
|
||||
<Button variant="outline" className="w-full h-16 flex flex-col gap-1 bg-transparent">
|
||||
<Database className="h-5 w-5" />
|
||||
<span className="text-xs">数据导入</span>
|
||||
</Button>
|
||||
</Link>
|
||||
<Link href="/user-discovery/behavior">
|
||||
<Button variant="outline" className="w-full h-16 flex flex-col gap-1 bg-transparent">
|
||||
<Search className="h-5 w-5" />
|
||||
<span className="text-xs">行为分析</span>
|
||||
</Button>
|
||||
</Link>
|
||||
<Link href="/user-valuation/model">
|
||||
<Button variant="outline" className="w-full h-16 flex flex-col gap-1 bg-transparent">
|
||||
<Target className="h-5 w-5" />
|
||||
<span className="text-xs">价值评估</span>
|
||||
</Button>
|
||||
</Link>
|
||||
<Link href="/ai-analysis/trends">
|
||||
<Button variant="outline" className="w-full h-16 flex flex-col gap-1 bg-transparent">
|
||||
<Brain className="h-5 w-5" />
|
||||
<span className="text-xs">AI预测</span>
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user