diff --git a/app/ai-assistant/page.tsx b/app/ai-assistant/page.tsx index 4247770..932c9d6 100644 --- a/app/ai-assistant/page.tsx +++ b/app/ai-assistant/page.tsx @@ -1,794 +1,516 @@ "use client" import { useState } from "react" -import { Card, CardContent, CardDescription, CardHeader, CardTitle, CardFooter } from "@/components/ui/card" -import { Button } from "@/components/ui/button" +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" -import { Textarea } from "@/components/ui/textarea" +import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" +import { Badge } from "@/components/ui/badge" +import { Textarea } from "@/components/ui/textarea" import { Label } from "@/components/ui/label" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Switch } from "@/components/ui/switch" -import { Badge } from "@/components/ui/badge" -import { Separator } from "@/components/ui/separator" +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" +import { + BarChart3, + Send, + FileText, + Mail, + MessageSquare, + Download, + Database, + Target, + Zap, + Eye, + Share, +} from "lucide-react" +import { TooltipHelp, TooltipProvider } from "@/components/ui/tooltip-help" import { Dialog, DialogContent, DialogDescription, - DialogFooter, DialogHeader, DialogTitle, + DialogFooter, } from "@/components/ui/dialog" -import { Sparkles, BarChart, TrendingUp, Users, Mail, Clock, Download, ChevronRight } from "lucide-react" export default function AIAssistantPage() { - const [activeTab, setActiveTab] = useState("data-analysis") - const [selectedUserGroup, setSelectedUserGroup] = useState("") - const [isUserGroupDialogOpen, setIsUserGroupDialogOpen] = useState(false) - const [emailAddress, setEmailAddress] = useState("") - const [scheduleReport, setScheduleReport] = useState(false) + const [selectedDatabase, setSelectedDatabase] = useState("all") + const [reportTitle, setReportTitle] = useState("") + const [isGeneratingReport, setIsGeneratingReport] = useState(false) + const [isSendingReport, setIsSendingReport] = useState(false) + const [selectedReport, setSelectedReport] = useState(null) - // 分析流程步骤 - const [analysisStep, setAnalysisStep] = useState(1) - const [analysisType, setAnalysisType] = useState("") + // 数据库列表 + const databases = [ + { id: "user_behavior", name: "用户行为数据库", records: "1.2M", description: "用户行为轨迹和交互数据" }, + { id: "user_profile", name: "用户画像数据库", records: "856K", description: "用户基本信息和标签数据" }, + { id: "transaction", name: "交易数据库", records: "324K", description: "用户交易和消费记录" }, + { id: "content", name: "内容数据库", records: "567K", description: "内容互动和偏好数据" }, + { id: "traffic", name: "流量数据库", records: "2.3M", description: "流量关键词和来源数据" }, + ] - // 营销策略步骤 - const [strategyStep, setStrategyStep] = useState(1) - const [strategyType, setStrategyType] = useState("") - - return ( -
-
-
-

AI 智能助手

-

利用AI技术分析数据并提供营销策略

-
-
- - - - 数据分析 - 营销策略 - - - - - - AI 数据分析 - 使用AI分析用户数据并生成洞察报告 - - - {/* 第1步:选择用户分群 */} -
-
-

-
- 1 -
- 选择用户分群 -

- {analysisStep > 1 ? ( - - ) : ( - - )} -
- - {selectedUserGroup && ( -
-
-
- - 已选择用户分群: - {selectedUserGroup} -
- {analysisStep === 1 && ( - - )} -
-
- )} -
- - - - {/* 第2步:选择分析类型 */} -
2 ? "opacity-60" : "opacity-40") : ""}`} - > -
-

-
- 2 -
- 选择分析类型 -

- {analysisStep > 2 && ( - - )} -
- - {analysisStep >= 2 && ( -
- setAnalysisType("behavior")} - > - - 用户行为分析 - - - 分析用户的行为模式、偏好和习惯 - - - {analysisType === "behavior" && 已选择} - - - setAnalysisType("value")} - > - - 用户估值分析 - - 分析用户的价值分布和潜在价值 - - {analysisType === "value" && 已选择} - - - setAnalysisType("churn")} - > - - 用户流失预警 - - - 预测可能流失的用户并提供挽留建议 - - - {analysisType === "churn" && 已选择} - - -
- )} - - {analysisStep === 2 && analysisType && ( -
- -
- )} -
- - - - {/* 第3步:分析参数设置 */} -
3 ? "opacity-60" : "opacity-40") : ""}`} - > -
-

-
- 3 -
- 分析参数设置 -

- {analysisStep > 3 && ( - - )} -
- - {analysisStep >= 3 && ( -
-
- - -
-
- - -
-
- )} - - {analysisStep === 3 && ( -
- -
- )} -
- - - - {/* 第4步:报告设置 */} -
-
-

-
- 4 -
- 报告设置 -

-
- - {analysisStep >= 4 && ( -
-
- - setEmailAddress(e.target.value)} - /> -
-
- - -
- {scheduleReport && ( -
-
- - -
-
- - -
-
- )} -
- )} -
-
- - - - -
- - - - 分析结果预览 - AI生成的数据分析结果 - - - {selectedUserGroup && analysisStep === 4 ? ( -
- -

分析结果将在这里显示

-

点击"开始分析"按钮生成分析报告

-
- - -
-
- ) : ( -
- -

请完成所有分析步骤

- -
- )} -
-
-
- - - - - AI 营销策略 - 使用AI生成针对性的营销策略和建议 - - - {/* 第1步:选择目标用户分群 */} -
-
-

-
- 1 -
- 选择目标用户分群 -

- {strategyStep > 1 ? ( - - ) : ( - - )} -
- - {selectedUserGroup && ( -
-
-
- - 已选择用户分群: - {selectedUserGroup} -
- {strategyStep === 1 && ( - - )} -
-
- )} -
- - - - {/* 第2步:选择策略类型 */} -
2 ? "opacity-60" : "opacity-40") : ""}`} - > -
-

-
- 2 -
- 选择策略类型 -

- {strategyStep > 2 && ( - - )} -
- - {strategyStep >= 2 && ( -
- setStrategyType("sales")} - > - - 销售预测 - - - 预测未来销售趋势并提供增长建议 - - - {strategyType === "sales" && 已选择} - - - setStrategyType("reach")} - > - - 用户触达策略 - - - 生成针对性的用户触达和转化策略 - - - {strategyType === "reach" && 已选择} - - - setStrategyType("content")} - > - - 内容营销策略 - - - 生成针对目标用户的内容营销策略 - - - {strategyType === "content" && 已选择} - - -
- )} - - {strategyStep === 2 && strategyType && ( -
- -
- )} -
- - - - {/* 第3步:策略参数设置 */} -
-
-

-
- 3 -
- 策略参数设置 -

-
- - {strategyStep >= 3 && ( - <> -
-
- - -
-
- - -
-
-
- -