From 901763fae0e26c90f7571ee8d665ce3d9da5460d Mon Sep 17 00:00:00 2001 From: v0 Date: Sat, 19 Jul 2025 02:34:18 +0000 Subject: [PATCH] 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> --- app/ai-analysis/loading.tsx | 47 + app/ai-analysis/page.tsx | 442 +++++++++ app/components/BottomNav.tsx | 11 +- app/components/MobileSidebar.tsx | 106 ++- app/data-platform/loading.tsx | 62 +- app/data-platform/page.tsx | 803 ++++++++-------- app/globals.css | 9 +- app/loading.tsx | 3 + app/page.tsx | 619 +++++++------ app/user-discovery/loading.tsx | 3 + app/user-discovery/page.tsx | 429 +++++++++ app/user-valuation/loading.tsx | 3 + app/user-valuation/page.tsx | 871 ++++++++++++++++++ components/tag-rules/rule-editor.tsx | 562 +---------- lib/documentation/docx-generator.ts | 219 +++-- .../enhanced-screenshot-service.ts | 440 ++------- lib/documentation/page-registry.ts | 243 ++--- lib/documentation/screenshot-service.ts | 162 +++- package.json | 2 +- pnpm-lock.yaml | 62 +- 20 files changed, 3216 insertions(+), 1882 deletions(-) create mode 100644 app/ai-analysis/loading.tsx create mode 100644 app/ai-analysis/page.tsx create mode 100644 app/loading.tsx create mode 100644 app/user-discovery/loading.tsx create mode 100644 app/user-discovery/page.tsx create mode 100644 app/user-valuation/loading.tsx create mode 100644 app/user-valuation/page.tsx diff --git a/app/ai-analysis/loading.tsx b/app/ai-analysis/loading.tsx new file mode 100644 index 0000000..105009d --- /dev/null +++ b/app/ai-analysis/loading.tsx @@ -0,0 +1,47 @@ +export default function AIAnalysisLoading() { + return ( +
+ {/* 页面标题骨架 */} +
+
+
+
+
+
+
+
+
+
+
+ + {/* 概览卡片骨架 */} +
+
+
+ {Array.from({ length: 6 }).map((_, i) => ( +
+
+
+
+ ))} +
+
+ + {/* 内容卡片骨架 */} + {Array.from({ length: 3 }).map((_, i) => ( +
+
+
+ {Array.from({ length: 2 }).map((_, j) => ( +
+
+
+
+
+ ))} +
+
+ ))} +
+ ) +} diff --git a/app/ai-analysis/page.tsx b/app/ai-analysis/page.tsx new file mode 100644 index 0000000..0225980 --- /dev/null +++ b/app/ai-analysis/page.tsx @@ -0,0 +1,442 @@ +"use client" + +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 { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" +import { + Brain, + TrendingUp, + AlertTriangle, + Zap, + Filter, + RefreshCw, + Download, + ChevronRight, + ChevronDown, +} from "lucide-react" +import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible" + +export default function AIAnalysisPage() { + const [timeRange, setTimeRange] = useState("today") + const [expandedSections, setExpandedSections] = useState({ + overview: true, + trends: true, + anomaly: false, + predictions: false, + }) + + // AI分析数据 + const aiData = { + overview: { + totalInsights: 156, + trendsIdentified: 23, + anomaliesDetected: 3, + predictionsGenerated: 89, + accuracy: 94.2, + modelPerformance: 97.8, + }, + trendAnalysis: [ + { + trend: "用户活跃度上升趋势", + confidence: 95.8, + impact: "高", + timeframe: "未来7天", + description: "基于用户行为模式分析,预测用户活跃度将持续上升", + recommendation: "增加内容推送频率,优化用户体验", + }, + { + trend: "移动端使用增长", + confidence: 89.2, + impact: "中高", + timeframe: "未来14天", + description: "移动端用户访问量呈现明显增长趋势", + recommendation: "优化移动端界面,提升响应速度", + }, + { + trend: "高价值用户转化提升", + confidence: 92.5, + impact: "高", + timeframe: "未来30天", + description: "高价值用户转化率预计将显著提升", + recommendation: "制定针对性营销策略,加强用户维护", + }, + ], + anomalyDetection: [ + { + type: "流量异常", + severity: "中等", + detected: "今天 13:45", + description: "检测到异常流量峰值,比平时高出45%", + status: "已处理", + action: "已启动自动扩容机制", + }, + { + type: "用户行为异常", + severity: "低", + detected: "今天 11:20", + description: "部分用户群体行为模式发生变化", + status: "监控中", + action: "持续观察用户行为变化", + }, + { + type: "数据质量异常", + severity: "高", + detected: "今天 09:15", + description: "数据源同步出现延迟,影响实时分析", + status: "已修复", + action: "已重新同步数据,恢复正常", + }, + ], + predictiveModels: [ + { + model: "用户流失预测模型", + accuracy: 94.2, + lastTrained: "今天 06:00", + predictions: 1245, + status: "运行中", + description: "预测用户流失风险,准确率达94.2%", + }, + { + model: "价值提升预测模型", + accuracy: 91.8, + lastTrained: "今天 05:30", + predictions: 856, + status: "运行中", + description: "预测用户价值提升潜力,指导运营策略", + }, + { + model: "内容推荐模型", + accuracy: 87.5, + lastTrained: "今天 04:45", + predictions: 2341, + status: "运行中", + description: "个性化内容推荐,提升用户参与度", + }, + ], + } + + const toggleSection = (section: string) => { + setExpandedSections((prev) => ({ + ...prev, + [section]: !prev[section], + })) + } + + const getImpactColor = (impact: string) => { + switch (impact) { + case "高": + return "bg-red-100 text-red-800" + case "中高": + return "bg-orange-100 text-orange-800" + case "中": + return "bg-yellow-100 text-yellow-800" + case "低": + return "bg-green-100 text-green-800" + default: + return "bg-gray-100 text-gray-800" + } + } + + const getSeverityColor = (severity: string) => { + switch (severity) { + case "高": + return "bg-red-100 text-red-800" + case "中等": + return "bg-yellow-100 text-yellow-800" + case "低": + return "bg-green-100 text-green-800" + default: + return "bg-gray-100 text-gray-800" + } + } + + const getStatusColor = (status: string) => { + switch (status) { + case "运行中": + return "bg-green-100 text-green-800" + case "已处理": + return "bg-blue-100 text-blue-800" + case "监控中": + return "bg-yellow-100 text-yellow-800" + case "已修复": + return "bg-green-100 text-green-800" + default: + return "bg-gray-100 text-gray-800" + } + } + + return ( +
+ {/* 页面标题和工具栏 */} +
+
+

AI分析

+

智能数据洞察与预测分析

+
+
+ + + + +
+
+ + {/* AI分析概览 */} + setExpandedSections((prev) => ({ ...prev, overview: open }))} + > + + + +
+
+ +
+ AI分析概览 + 智能分析引擎运行状态 +
+
+ {expandedSections.overview ? ( + + ) : ( + + )} +
+
+
+ + +
+
+
{aiData.overview.totalInsights}
+
AI洞察
+
+
+
{aiData.overview.trendsIdentified}
+
趋势识别
+
+
+
+ {aiData.overview.anomaliesDetected} +
+
异常检测
+
+
+
+ {aiData.overview.predictionsGenerated} +
+
预测生成
+
+
+
{aiData.overview.accuracy}%
+
预测准确率
+
+
+
{aiData.overview.modelPerformance}%
+
模型性能
+
+
+
+
+
+
+ + {/* 趋势识别 */} + setExpandedSections((prev) => ({ ...prev, trends: open }))} + > + + + +
+
+ +
+ 趋势识别 + AI驱动的趋势预测分析 +
+
+ {expandedSections.trends ? ( + + ) : ( + + )} +
+
+
+ + +
+ {aiData.trendAnalysis.map((trend, index) => ( +
+
+
+
+

{trend.trend}

+ {trend.impact}影响 +
+

{trend.description}

+

建议: {trend.recommendation}

+
+
+
+
{trend.confidence}%
+
置信度
+
+
+
{trend.timeframe}
+
预测时间
+
+
+
+
+
+ 置信度 + {trend.confidence}% +
+ +
+
+ ))} +
+
+
+
+
+ + {/* 异常检测 */} + setExpandedSections((prev) => ({ ...prev, anomaly: open }))} + > + + + +
+
+ +
+ 异常检测 + 智能异常监控与预警 +
+
+ {expandedSections.anomaly ? ( + + ) : ( + + )} +
+
+
+ + +
+ {aiData.anomalyDetection.map((anomaly, index) => ( +
+
+
+
+

{anomaly.type}

+ {anomaly.severity} + {anomaly.status} +
+

{anomaly.description}

+

处理措施: {anomaly.action}

+
+
+
{anomaly.detected}
+
检测时间
+
+
+
+ ))} +
+
+
+
+
+ + {/* 预测模型 */} + setExpandedSections((prev) => ({ ...prev, predictions: open }))} + > + + + +
+
+ +
+ 预测模型 + 机器学习预测模型管理 +
+
+ {expandedSections.predictions ? ( + + ) : ( + + )} +
+
+
+ + +
+ {aiData.predictiveModels.map((model, index) => ( +
+
+
+
+

{model.model}

+ {model.status} +
+

{model.description}

+
+ 最后训练: {model.lastTrained} + 预测数量: {model.predictions.toLocaleString()} +
+
+
+
{model.accuracy}%
+
准确率
+
+
+
+
+ 模型准确率 + {model.accuracy}% +
+ +
+
+ ))} +
+
+
+
+
+
+ ) +} diff --git a/app/components/BottomNav.tsx b/app/components/BottomNav.tsx index 7139222..11b1994 100644 --- a/app/components/BottomNav.tsx +++ b/app/components/BottomNav.tsx @@ -2,13 +2,14 @@ import Link from "next/link" import { usePathname } from "next/navigation" -import { Home, Users, Target, Database } from "lucide-react" +import { Home, Database, Search, Target, Brain } from "lucide-react" const navItems = [ { href: "/", icon: Home, label: "概览" }, - { href: "/data-integration", icon: Database, label: "数据集成" }, - { href: "/user-portrait", icon: Users, label: "用户画像" }, - { href: "/user-value", icon: Target, label: "价值评估" }, + { href: "/data-platform", icon: Database, label: "数据中台" }, + { href: "/user-discovery", icon: Search, label: "用户发现" }, + { href: "/user-valuation", icon: Target, label: "用户估值" }, + { href: "/ai-analysis", icon: Brain, label: "AI分析" }, ] export default function BottomNav() { @@ -24,7 +25,7 @@ export default function BottomNav() { diff --git a/app/components/MobileSidebar.tsx b/app/components/MobileSidebar.tsx index 6a6e162..b2ed6fa 100644 --- a/app/components/MobileSidebar.tsx +++ b/app/components/MobileSidebar.tsx @@ -12,9 +12,11 @@ import { X, ChevronDown, ChevronRight, - Tag, + Search, BarChart3, TrendingUp, + Brain, + HelpCircle, } from "lucide-react" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" @@ -27,8 +29,9 @@ interface MobileSidebarProps { export default function MobileSidebar({ isOpen, onClose }: MobileSidebarProps) { const pathname = usePathname() const [expandedSections, setExpandedSections] = useState({ - "user-portrait": false, - "user-value": false, + "user-discovery": false, + "user-valuation": false, + "ai-analysis": false, }) const toggleSection = (section: string) => { @@ -59,56 +62,83 @@ export default function MobileSidebar({ isOpen, onClose }: MobileSidebarProps) { description: "平台整体数据分析", }, { - title: "数据集成", - href: "/data-integration", + title: "数据中台", + href: "/data-platform", icon: , primary: true, tag: "核心", - description: "多源数据整合平台", + description: "多源数据整合中心", }, { - title: "用户画像", - href: "/user-portrait", - icon: , + title: "用户发现", + href: "/user-discovery", + icon: , primary: true, expandable: true, - section: "user-portrait", - description: "用户标签与分群分析", + section: "user-discovery", + description: "用户行为洞察分析", children: [ { - title: "流量关键词", - href: "/user-portrait/keywords", - icon: , - description: "关键词价值评估", + title: "行为分析", + href: "/user-discovery/behavior", + icon: , + description: "用户行为模式分析", }, { - title: "标签管理", - href: "/user-portrait/tags", - icon: , - description: "用户标签分类", + title: "用户分群", + href: "/user-discovery/segmentation", + icon: , + description: "智能用户分群", }, ], }, { - title: "价值评估", - href: "/user-value", + title: "用户估值", + href: "/user-valuation", icon: , primary: true, expandable: true, - section: "user-value", - description: "用户价值分析模型", + section: "user-valuation", + description: "用户价值评估模型", + hasHelp: true, children: [ { title: "估值模型", - href: "/user-value/model", + href: "/user-valuation/model", icon: , - description: "RFM价值模型", + description: "RFM价值评估", + hasHelp: true, }, { title: "升级路径", - href: "/user-value/upgrade-paths", + href: "/user-valuation/upgrade-paths", icon: , - description: "用户价值提升", + description: "用户价值提升策略", + hasHelp: true, + }, + ], + }, + { + title: "AI分析", + href: "/ai-analysis", + icon: , + primary: true, + expandable: true, + section: "ai-analysis", + description: "智能数据洞察", + tag: "AI", + children: [ + { + title: "趋势识别", + href: "/ai-analysis/trends", + icon: , + description: "AI趋势预测", + }, + { + title: "异常检测", + href: "/ai-analysis/anomaly", + icon: , + description: "智能异常监控", }, ], }, @@ -118,6 +148,8 @@ export default function MobileSidebar({ isOpen, onClose }: MobileSidebarProps) { switch (tag) { case "核心": return "bg-blue-100 text-blue-700 border-blue-200" + case "AI": + return "bg-purple-100 text-purple-700 border-purple-200" default: return "bg-gray-100 text-gray-700 border-gray-200" } @@ -137,7 +169,7 @@ export default function MobileSidebar({ isOpen, onClose }: MobileSidebarProps) { {/* 侧边栏 */}
@@ -173,7 +205,10 @@ export default function MobileSidebar({ isOpen, onClose }: MobileSidebarProps) {
{item.icon}
- {item.title} +
+ {item.title} + {item.hasHelp && } +
{item.tag && (
-

{subItem.title}

+
+

{subItem.title}

+ {subItem.hasHelp && } +

{subItem.description}

@@ -234,15 +272,15 @@ export default function MobileSidebar({ isOpen, onClose }: MobileSidebarProps) {
- 数据同步 + AI引擎状态
- 正常 + 运行中
- 最后更新 - 2分钟前 + 数据同步 + 实时
diff --git a/app/data-platform/loading.tsx b/app/data-platform/loading.tsx index f15322a..b674d1f 100644 --- a/app/data-platform/loading.tsx +++ b/app/data-platform/loading.tsx @@ -1,3 +1,61 @@ -export default function Loading() { - return null +export default function DataPlatformLoading() { + return ( +
+ {/* 页面标题骨架 */} +
+
+
+
+
+
+
+
+
+
+
+ + {/* 概览卡片骨架 */} +
+
+
+ {Array.from({ length: 4 }).map((_, i) => ( +
+
+
+
+ ))} +
+
+ + {/* 数据源卡片骨架 */} +
+
+
+ {Array.from({ length: 3 }).map((_, i) => ( +
+
+
+
+
+ ))} +
+
+ + {/* 其他内容骨架 */} + {Array.from({ length: 2 }).map((_, i) => ( +
+
+
+ {Array.from({ length: 3 }).map((_, j) => ( +
+
+
+
+
+ ))} +
+
+ ))} +
+ ) } diff --git a/app/data-platform/page.tsx b/app/data-platform/page.tsx index 701385f..96acb57 100644 --- a/app/data-platform/page.tsx +++ b/app/data-platform/page.tsx @@ -1,433 +1,490 @@ "use client" import { useState } from "react" -import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card" +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" -import { Input } from "@/components/ui/input" -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" -import { Database, Server, Link, RefreshCw, Download, Mail, FileText } from "lucide-react" -import { Textarea } from "@/components/ui/textarea" +import { Badge } from "@/components/ui/badge" +import { Progress } from "@/components/ui/progress" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { - Dialog, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, - DialogTrigger, -} from "@/components/ui/dialog" -import { Badge } from "@/components/ui/badge" -import { Checkbox } from "@/components/ui/checkbox" -import { Label } from "@/components/ui/label" -import { DataSourceList } from "@/components/data-integration/data-source-list" -import { DataFieldMapping } from "@/components/data-integration/data-field-mapping" -import { DataCollectionSettings } from "@/components/data-integration/data-collection-settings" -import { ApiDocumentation } from "@/components/data-integration/api-documentation" - -interface DataSource { - id: string - name: string - type: "mysql" | "postgresql" | "mongodb" | "oracle" | "sqlserver" | "api" | "file" - status: "connected" | "disconnected" | "error" - lastSync: string - tables: number - records: number -} + Database, + Upload, + Download, + RefreshCw, + CheckCircle, + AlertCircle, + Clock, + FileText, + Settings, + ChevronRight, + ChevronDown, +} from "lucide-react" +import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible" export default function DataPlatformPage() { - const [activeTab, setActiveTab] = useState("data-integration") - const [selectedUserSegment, setSelectedUserSegment] = useState("") - const [analysisPrompt, setAnalysisPrompt] = useState("") - const [selectedEmail, setSelectedEmail] = useState("") - const [isAddingDataSource, setIsAddingDataSource] = useState(false) + const [timeRange, setTimeRange] = useState("today") + const [expandedSections, setExpandedSections] = useState({ + overview: true, + sources: true, + integration: false, + quality: false, + }) - // 数据源列表 - const dataSources: DataSource[] = [ - { - id: "1", - name: "用户数据库", - type: "mysql", - status: "connected", - lastSync: "2023-07-21 15:30", - tables: 12, - records: 1250000, + // 数据中台数据 + const platformData = { + overview: { + totalRecords: 1245678, + dataSources: 8, + syncStatus: "正常", + lastUpdate: "2分钟前", + dataQuality: 94.6, + storageUsed: 2.3, + storageTotal: 10.0, }, - { - id: "2", - name: "交易系统", - type: "postgresql", - status: "connected", - lastSync: "2023-07-21 14:45", - tables: 8, - records: 3450000, + dataSources: [ + { + name: "用户行为数据库", + type: "MySQL", + status: "connected", + records: 456789, + lastSync: "1分钟前", + quality: 96.8, + description: "用户行为轨迹数据", + }, + { + name: "CRM系统", + type: "API", + status: "connected", + records: 125678, + lastSync: "3分钟前", + quality: 94.2, + description: "客户关系管理数据", + }, + { + name: "内容平台数据", + type: "API", + status: "syncing", + records: 234567, + lastSync: "正在同步", + quality: 92.5, + description: "抖音、小红书等平台数据", + }, + { + name: "触客宝后台", + type: "API", + status: "connected", + records: 89234, + lastSync: "5分钟前", + quality: 95.1, + description: "呼入电话信息数据", + }, + { + name: "飞书妙记", + type: "API", + status: "connected", + records: 12345, + lastSync: "10分钟前", + quality: 91.3, + description: "会议记录和内容摘要", + }, + { + name: "表单提交数据", + type: "Webhook", + status: "connected", + records: 67890, + lastSync: "2分钟前", + quality: 97.2, + description: "在线表单提交数据", + }, + ], + integrationStats: { + totalIntegrations: 8, + activeIntegrations: 7, + failedIntegrations: 0, + pendingIntegrations: 1, + avgSyncTime: "2.3分钟", + successRate: 98.7, }, - { - id: "3", - name: "用户行为数据", - type: "mongodb", - status: "connected", - lastSync: "2023-07-21 13:20", - tables: 5, - records: 7800000, + dataQuality: { + completeness: 94.6, + accuracy: 96.2, + consistency: 92.8, + timeliness: 95.4, + validity: 93.7, + uniqueness: 97.1, }, - { - id: "4", - name: "CRM系统", - type: "oracle", - status: "error", - lastSync: "2023-07-20 09:15", - tables: 15, - records: 2100000, - }, - ] - - // 用户画像分群列表 - const userSegments = [ - { id: "high-value", name: "高价值用户", count: 12500 }, - { id: "new-users", name: "新注册用户", count: 45600 }, - { id: "inactive", name: "非活跃用户", count: 28900 }, - { id: "potential", name: "潜在高转化用户", count: 18700 }, - { id: "loyal", name: "忠诚用户", count: 9800 }, - { id: "risk", name: "流失风险用户", count: 15400 }, - ] - - // 邮箱列表 - const emailList = [ - { id: "1", email: "marketing@company.com", name: "营销团队" }, - { id: "2", email: "sales@company.com", name: "销售团队" }, - { id: "3", email: "product@company.com", name: "产品团队" }, - { id: "4", email: "executive@company.com", name: "管理层" }, - ] - - const getDataSourceIcon = (type: DataSource["type"]) => { - switch (type) { - case "mysql": - case "postgresql": - case "oracle": - case "sqlserver": - return - case "mongodb": - return - case "api": - case "file": - return - } } - const getDataSourceTypeName = (type: DataSource["type"]) => { - switch (type) { - case "mysql": - return "MySQL" - case "postgresql": - return "PostgreSQL" - case "mongodb": - return "MongoDB" - case "oracle": - return "Oracle" - case "sqlserver": - return "SQL Server" - case "api": - return "API" - case "file": - return "文件" - } + const toggleSection = (section: string) => { + setExpandedSections((prev) => ({ + ...prev, + [section]: !prev[section], + })) } - const getStatusBadge = (status: DataSource["status"]) => { + const getStatusColor = (status: string) => { switch (status) { case "connected": - return 已连接 - case "disconnected": - return 未连接 + return "bg-green-100 text-green-800" + case "syncing": + return "bg-yellow-100 text-yellow-800" case "error": - return 错误 + return "bg-red-100 text-red-800" + case "disconnected": + return "bg-gray-100 text-gray-800" + default: + return "bg-gray-100 text-gray-800" + } + } + + const getStatusIcon = (status: string) => { + switch (status) { + case "connected": + return + case "syncing": + return + case "error": + return + default: + return } } return ( -
+
+ {/* 页面标题和工具栏 */}
-

数据中台

-

数据集成、API管理与数据采集

+

数据中台

+

多源数据整合与管理中心

-
- + -
- - - 数据集成 - 数据采集 - 数据映射 - API管理 - - - {/* 数据集成标签页 */} - - - - 数据源管理 - 管理和查看已连接的数据源 + {/* 数据中台概览 */} + setExpandedSections((prev) => ({ ...prev, overview: open }))} + > + + + +
+
+ +
+ 平台概览 + 数据中台整体运行状况 +
+
+ {expandedSections.overview ? ( + + ) : ( + + )} +
- - +
+ + +
+
+
+ {platformData.overview.totalRecords.toLocaleString()} +
+
总数据量
+
+
+
+ {platformData.overview.dataSources} +
+
数据源
+
+
+
+ {platformData.overview.dataQuality}% +
+
数据质量
+
+
+
+ {platformData.overview.storageUsed}GB +
+
存储使用
+
+
+
+
+
+ 存储使用率 + + {platformData.overview.storageUsed}GB / {platformData.overview.storageTotal}GB + +
+ +
+
+
+ 数据质量 + {platformData.overview.dataQuality}% +
+ +
+
-
+ +
+ - - - 数据整合概览 - 基于ID、手机号、身份证号和IMEI设备号的数据整合 + {/* 数据源管理 */} + setExpandedSections((prev) => ({ ...prev, sources: open }))} + > + + + +
+
+ +
+ 数据源管理 + + 数据源连接状态 ({platformData.dataSources.length}) + +
+
+ {expandedSections.sources ? ( + + ) : ( + + )} +
- -
-
- - -
- + + + +
+ {platformData.dataSources.map((source, index) => ( +
+
+
+
+ {getStatusIcon(source.status)} +

{source.name}

+ {source.status} + + {source.type} + +
+

{source.description}

+
+ 数据量: {source.records.toLocaleString()} + 最后同步: {source.lastSync} + 质量评分: {source.quality}% +
-

用户ID

-

1,245,678 条记录

- - - - -
- +
+
+
{source.quality}%
+
数据质量
+
+
-

手机号

-

987,543 条记录

- - - - -
- -
-

身份证号

-

654,321 条记录

-
-
- - -
- -
-

IMEI设备号

-

789,456 条记录

-
-
-
- -
-
-

数据整合状态

-

最后更新: 2023-07-21 16:30

+
+
+ +
- -
+ ))} +
+ + + + -
-
- 用户数据整合率 - 87% + {/* 数据集成统计 */} + setExpandedSections((prev) => ({ ...prev, integration: open }))} + > + + + +
+
+ +
+ 集成统计 + 数据集成性能指标
-
-
+
+ {expandedSections.integration ? ( + + ) : ( + + )} +
+ + + + +
+
+
+ + 集成概况 +
+
+
+ 总集成数 + {platformData.integrationStats.totalIntegrations} +
+
+ 活跃集成 + {platformData.integrationStats.activeIntegrations} +
+
+ 待处理 + {platformData.integrationStats.pendingIntegrations} +
-
-
- 数据质量评分 - 92/100 +
+
+ + 性能指标
-
-
+
+
+ 成功率 + {platformData.integrationStats.successRate}% +
+
+ 平均同步时间 + {platformData.integrationStats.avgSyncTime} +
+
+ 失败集成 + {platformData.integrationStats.failedIntegrations} +
-
-
- 数据重复率 - 5.2% +
+
+ + 实时状态
-
-
+
+
+ 最后更新 + {platformData.overview.lastUpdate} +
+
+ 同步状态 + {platformData.overview.syncStatus} +
+
+ 系统负载 + 正常 +
- - + + + - {/* 数据采集标签页 */} - - - + {/* 数据质量监控 */} + setExpandedSections((prev) => ({ ...prev, quality: open }))} + > + + + +
+
+ +
+ 数据质量监控 + 数据质量多维度评估 +
+
+ {expandedSections.quality ? ( + + ) : ( + + )} +
+
+
+ + +
+ {Object.entries(platformData.dataQuality).map(([key, value], index) => { + const labels = { + completeness: "完整性", + accuracy: "准确性", + consistency: "一致性", + timeliness: "及时性", + validity: "有效性", + uniqueness: "唯一性", + } - {/* 数据映射标签页 */} - - - + const colors = [ + "bg-blue-50 text-blue-600", + "bg-green-50 text-green-600", + "bg-purple-50 text-purple-600", + "bg-orange-50 text-orange-600", + "bg-pink-50 text-pink-600", + "bg-indigo-50 text-indigo-600", + ] - {/* API管理标签页 */} - - - - - - {/* 添加数据源对话框 */} - - - - 添加新数据源 - 选择数据源类型并填写连接信息 - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - - - - -
-
- - {/* AI数据分析对话框 */} - - - - - - - AI数据分析 - 选择用户分群并输入分析需求 - -
-
- - -
-
- -