import React, { useState } from 'react'; import { ArrowLeft, Bot, Users, Settings, FileText, Upload, Play, Save, Search, CheckCircle, MessageSquare, Lightbulb, Target, AlertCircle, Sparkles, } from 'lucide-react'; import { useTheme } from '@/contexts/ThemeContext'; import { PageType } from '@/components/Sidebar'; interface TaskConsultCreateProps { onNavigate: (page: PageType) => void; } // 可选智能体列表 const availableAgents = [ { id: 'goal', name: 'GoalAgent', role: '目标分析专家', description: '分析业务目标,提取核心KPI和成功标准', color: 'blue', tags: ['目标分解', 'KPI提取'], recommended: true, }, { id: 'audience', name: 'AudienceAgent', role: '受众分析专家', description: '定义目标受众画像,分析用户特征和需求', color: 'cyan', tags: ['用户画像', '行为分析'], recommended: true, }, { id: 'behavior', name: 'BehaviorAgent', role: '行为设计专家', description: '设计用户行为路径和转化漏斗', color: 'green', tags: ['行为设计', '转化路径'], recommended: true, }, { id: 'driver', name: 'DriverAgent', role: '驱动因素专家', description: '分析影响用户决策的核心驱动因素', color: 'yellow', tags: ['驱动分析', '动机挖掘'], recommended: false, }, { id: 'narrative', name: 'NarrativeAgent', role: '叙事策略专家', description: '设计品牌叙事框架和内容策略', color: 'purple', tags: ['故事设计', '内容策略'], recommended: true, }, { id: 'risk', name: 'RiskAgent', role: '风险评估专家', description: '识别项目风险,制定应对策略', color: 'red', tags: ['风险识别', '应对策略'], recommended: true, }, ]; const TaskConsultCreate: React.FC = ({ onNavigate }) => { const { theme } = useTheme(); const isDark = theme === 'dark'; // 主题颜色类 const cardBg = isDark ? 'bg-slate-800/30' : 'bg-white'; const cardBorder = isDark ? 'border-blue-800/30' : 'border-red-200'; const textPrimary = isDark ? 'text-white' : 'text-gray-900'; const textSecondary = isDark ? 'text-slate-400' : 'text-gray-600'; const textMuted = isDark ? 'text-slate-500' : 'text-gray-500'; const btnSecondary = isDark ? 'bg-slate-700/50 hover:bg-slate-600/50 border-blue-800/30 text-slate-300' : 'bg-gray-100 hover:bg-gray-200 border-gray-300 text-gray-700'; const btnPrimary = isDark ? 'bg-blue-600 hover:bg-blue-500' : 'bg-red-600 hover:bg-red-500'; const inputBg = isDark ? 'bg-slate-900/50' : 'bg-gray-50'; const inputBorder = isDark ? 'border-blue-800/30' : 'border-gray-300'; const [taskName, setTaskName] = useState(''); const [taskTheme, setTaskTheme] = useState(''); const [taskDescription, setTaskDescription] = useState(''); const [selectedAgents, setSelectedAgents] = useState(['goal', 'audience', 'narrative', 'risk']); const [consultMode, setConsultMode] = useState<'parallel' | 'cross' | 'human'>('parallel'); const [maxRounds, setMaxRounds] = useState(3); const [allowAgentQuestion, setAllowAgentQuestion] = useState(true); const [allowHumanIntervene, setAllowHumanIntervene] = useState(true); const [autoSummary, setAutoSummary] = useState(true); const [allowConvertToScene, setAllowConvertToScene] = useState(true); const [searchQuery, setSearchQuery] = useState(''); const toggleAgent = (agentId: string) => { if (selectedAgents.includes(agentId)) { if (selectedAgents.length > 2) { setSelectedAgents(selectedAgents.filter((id) => id !== agentId)); } } else { if (selectedAgents.length < 8) { setSelectedAgents([...selectedAgents, agentId]); } } }; const selectRecommended = () => { const recommendedIds = availableAgents.filter((a) => a.recommended).map((a) => a.id); setSelectedAgents(recommendedIds); }; const handleStartConsult = () => { if (taskName && selectedAgents.length >= 2) { onNavigate('task-consult'); } }; const filteredAgents = availableAgents.filter( (agent) => agent.name.toLowerCase().includes(searchQuery.toLowerCase()) || agent.role.toLowerCase().includes(searchQuery.toLowerCase()) ); const getColorClasses = (color: string) => { const colors: Record = { blue: { bg: 'bg-blue-500/20', border: 'border-blue-500/50', text: 'text-blue-400', ring: 'ring-blue-500/50' }, cyan: { bg: 'bg-cyan-500/20', border: 'border-cyan-500/50', text: 'text-cyan-400', ring: 'ring-cyan-500/50' }, green: { bg: 'bg-green-500/20', border: 'border-green-500/50', text: 'text-green-400', ring: 'ring-green-500/50' }, yellow: { bg: 'bg-yellow-500/20', border: 'border-yellow-500/50', text: 'text-yellow-400', ring: 'ring-yellow-500/50' }, purple: { bg: 'bg-purple-500/20', border: 'border-purple-500/50', text: 'text-purple-400', ring: 'ring-purple-500/50' }, red: { bg: 'bg-red-500/20', border: 'border-red-500/50', text: 'text-red-400', ring: 'ring-red-500/50' }, }; return colors[color] || colors.blue; }; return (
{/* 顶部操作栏 */}

新建多智能体会商任务

多视角分析 + 人机共判 + 会商整合

会商研判模式
{/* 左侧:基础信息和智能体选择 */}
{/* 基础信息区 */}

基础信息

setTaskName(e.target.value)} placeholder="例如:五四青年节宣传策略会商" className={`w-full px-4 py-2.5 ${inputBg} ${inputBorder} rounded-lg ${textPrimary} text-sm ${textMuted} focus:outline-none focus:border-blue-500/50 transition-colors`} />
setTaskTheme(e.target.value)} placeholder="例如:宣传策略前期研判" className={`w-full px-4 py-2.5 ${inputBg} ${inputBorder} rounded-lg ${textPrimary} text-sm ${textMuted} focus:outline-none focus:border-blue-500/50 transition-colors`} />