chore: 清理macOS同步产生的重复文件
详细说明: - 删除了352个带数字后缀的重复文件 - 更新.gitignore防止未来产生此类文件 - 这些文件是由iCloud或其他同步服务冲突产生的 - 不影响项目功能,仅清理冗余文件
This commit is contained in:
170
web_frontend/exhibition-demo/src/components/RequirementModal.tsx
Normal file
170
web_frontend/exhibition-demo/src/components/RequirementModal.tsx
Normal file
@@ -0,0 +1,170 @@
|
||||
import React, { useState } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { X, Sparkles, FileText, Zap, Building2 } from 'lucide-react';
|
||||
|
||||
interface RequirementModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
onSubmit: (requirement: string) => void;
|
||||
}
|
||||
|
||||
const requirementTemplates = [
|
||||
{
|
||||
id: 1,
|
||||
title: '新能源汽车展',
|
||||
icon: <Zap className="w-5 h-5" />,
|
||||
content: `展会名称:2024长三角国际新能源汽车与智能交通产业博览会
|
||||
地点:上海国家会展中心
|
||||
时间:2024年10月18日-20日
|
||||
规模:50,000平方米,预计350家展商,50,000人次观众
|
||||
主题:双碳目标下的新能源汽车产业创新与发展
|
||||
特色:整车展示、核心零部件、充电设施、智能交通解决方案`
|
||||
}
|
||||
];
|
||||
|
||||
const RequirementModal: React.FC<RequirementModalProps> = ({ isOpen, onClose, onSubmit }) => {
|
||||
const [requirement, setRequirement] = useState('');
|
||||
const [selectedTemplate, setSelectedTemplate] = useState<number | null>(null);
|
||||
|
||||
const handleTemplateSelect = (template: typeof requirementTemplates[0]) => {
|
||||
setRequirement(template.content);
|
||||
setSelectedTemplate(template.id);
|
||||
};
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (requirement.trim()) {
|
||||
onSubmit(requirement);
|
||||
setRequirement('');
|
||||
setSelectedTemplate(null);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<AnimatePresence>
|
||||
{isOpen && (
|
||||
<>
|
||||
{/* 背景遮罩 */}
|
||||
<motion.div
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={{ opacity: 0 }}
|
||||
className="fixed inset-0 bg-black/60 backdrop-blur-sm z-50"
|
||||
onClick={onClose}
|
||||
/>
|
||||
|
||||
{/* 弹窗内容 */}
|
||||
<motion.div
|
||||
initial={{ opacity: 0, scale: 0.9, y: 20 }}
|
||||
animate={{ opacity: 1, scale: 1, y: 0 }}
|
||||
exit={{ opacity: 0, scale: 0.9, y: 20 }}
|
||||
transition={{ type: 'spring', damping: 25, stiffness: 300 }}
|
||||
className="fixed inset-0 flex items-center justify-center z-50 p-4"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<div className="bg-white rounded-2xl shadow-2xl max-w-4xl w-full max-h-[90vh] overflow-hidden">
|
||||
{/* 头部 */}
|
||||
<div className="bg-gradient-to-r from-blue-600 to-purple-600 p-6 text-white">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold mb-2">输入展会策划需求</h2>
|
||||
<p className="text-blue-100">请详细描述您的展会策划需求,AI将为您生成完整方案</p>
|
||||
</div>
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="p-2 hover:bg-white/20 rounded-lg transition-colors"
|
||||
>
|
||||
<X className="w-6 h-6" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="p-6">
|
||||
{/* 需求模板 */}
|
||||
<div className="mb-6">
|
||||
<h3 className="text-sm font-semibold text-gray-700 mb-3 flex items-center gap-2">
|
||||
<FileText className="w-4 h-4" />
|
||||
快速选择需求模板
|
||||
</h3>
|
||||
<div className="grid grid-cols-1 gap-3">
|
||||
{requirementTemplates.map((template) => (
|
||||
<button
|
||||
key={template.id}
|
||||
onClick={() => handleTemplateSelect(template)}
|
||||
className={`p-4 rounded-xl border-2 transition-all hover:shadow-lg ${
|
||||
selectedTemplate === template.id
|
||||
? 'border-blue-500 bg-blue-50'
|
||||
: 'border-gray-200 hover:border-gray-300'
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-center gap-3 mb-2">
|
||||
<div className={`p-2 rounded-lg ${
|
||||
selectedTemplate === template.id
|
||||
? 'bg-blue-500 text-white'
|
||||
: 'bg-gray-100 text-gray-600'
|
||||
}`}>
|
||||
{template.icon}
|
||||
</div>
|
||||
<span className="font-medium text-gray-900">{template.title}</span>
|
||||
</div>
|
||||
<p className="text-xs text-gray-500 text-left">点击快速填充模板内容</p>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 输入区域 */}
|
||||
<div className="mb-6">
|
||||
<label className="block text-sm font-semibold text-gray-700 mb-2">
|
||||
需求描述
|
||||
</label>
|
||||
<textarea
|
||||
value={requirement}
|
||||
onChange={(e) => setRequirement(e.target.value)}
|
||||
placeholder="请输入展会的名称、规模、时间、地点、主题等信息..."
|
||||
className="w-full h-48 px-4 py-3 border border-gray-300 rounded-xl text-gray-900 placeholder-gray-400 focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-none transition-all"
|
||||
style={{ fontFamily: 'system-ui, -apple-system, sans-serif' }}
|
||||
/>
|
||||
<div className="mt-2 text-right">
|
||||
<span className="text-xs text-gray-500">{requirement.length} 字符</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 底部按钮 */}
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="text-sm text-gray-500">
|
||||
<span className="inline-flex items-center gap-1">
|
||||
<Sparkles className="w-4 h-4 text-yellow-500" />
|
||||
AI将基于您的需求生成专业的展会策划方案
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex gap-3">
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="px-6 py-2.5 text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-lg transition-colors font-medium"
|
||||
>
|
||||
取消
|
||||
</button>
|
||||
<button
|
||||
onClick={handleSubmit}
|
||||
disabled={!requirement.trim()}
|
||||
className={`px-6 py-2.5 rounded-lg font-medium transition-all flex items-center gap-2 ${
|
||||
requirement.trim()
|
||||
? 'bg-gradient-to-r from-blue-600 to-purple-600 text-white hover:shadow-lg transform hover:scale-105'
|
||||
: 'bg-gray-300 text-gray-500 cursor-not-allowed'
|
||||
}`}
|
||||
>
|
||||
<Zap className="w-4 h-4" />
|
||||
开始生成方案
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
</>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
);
|
||||
};
|
||||
|
||||
export default RequirementModal;
|
||||
167
web_frontend/exhibition-demo/src/components/ResultModal.tsx
Normal file
167
web_frontend/exhibition-demo/src/components/ResultModal.tsx
Normal file
@@ -0,0 +1,167 @@
|
||||
import React from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
import { X, Download, Eye, CheckCircle, FileText, TrendingUp, Calendar } from 'lucide-react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
interface ResultModalProps {
|
||||
isOpen: boolean;
|
||||
onClose: () => void;
|
||||
onViewDetails: () => void;
|
||||
}
|
||||
|
||||
const ResultModal: React.FC<ResultModalProps> = ({ isOpen, onClose, onViewDetails }) => {
|
||||
const stats = [
|
||||
{ label: '生成时间', value: '3分钟', icon: <Calendar className="w-5 h-5" /> },
|
||||
{ label: '文档页数', value: '68页', icon: <FileText className="w-5 h-5" /> },
|
||||
{ label: '预期ROI', value: '30%', icon: <TrendingUp className="w-5 h-5" /> },
|
||||
];
|
||||
|
||||
const sections = [
|
||||
{ name: '策划案概述', status: 'completed', pages: 8 },
|
||||
{ name: '展会介绍', status: 'completed', pages: 12 },
|
||||
{ name: '营销方案', status: 'completed', pages: 15 },
|
||||
{ name: '现场运营', status: 'completed', pages: 10 },
|
||||
{ name: '预算分析', status: 'completed', pages: 13 },
|
||||
{ name: '风险评估', status: 'completed', pages: 10 },
|
||||
];
|
||||
|
||||
return (
|
||||
<AnimatePresence>
|
||||
{isOpen && (
|
||||
<>
|
||||
{/* 背景遮罩 */}
|
||||
<motion.div
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={{ opacity: 0 }}
|
||||
className="fixed inset-0 bg-black/60 backdrop-blur-sm z-50"
|
||||
onClick={onClose}
|
||||
/>
|
||||
|
||||
{/* 弹窗内容 */}
|
||||
<motion.div
|
||||
initial={{ opacity: 0, scale: 0.9, y: 20 }}
|
||||
animate={{ opacity: 1, scale: 1, y: 0 }}
|
||||
exit={{ opacity: 0, scale: 0.9, y: 20 }}
|
||||
transition={{ type: 'spring', damping: 25, stiffness: 300 }}
|
||||
className="fixed inset-0 flex items-center justify-center z-50 p-4"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<div className="bg-white rounded-2xl shadow-2xl max-w-2xl w-full max-h-[90vh] overflow-hidden">
|
||||
{/* 头部 */}
|
||||
<div className="relative bg-gradient-to-br from-green-500 to-emerald-600 p-8 text-white">
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="absolute top-4 right-4 p-2 hover:bg-white/20 rounded-lg transition-colors"
|
||||
>
|
||||
<X className="w-6 h-6" />
|
||||
</button>
|
||||
|
||||
<div className="flex items-center justify-center mb-4">
|
||||
<motion.div
|
||||
initial={{ scale: 0 }}
|
||||
animate={{ scale: 1 }}
|
||||
transition={{ delay: 0.2, type: 'spring', stiffness: 200 }}
|
||||
className="p-4 bg-white/20 rounded-full"
|
||||
>
|
||||
<CheckCircle className="w-12 h-12" />
|
||||
</motion.div>
|
||||
</div>
|
||||
|
||||
<h2 className="text-3xl font-bold text-center mb-2">方案生成完成!</h2>
|
||||
<p className="text-center text-green-100">
|
||||
AI已成功为您生成完整的展会策划方案
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="p-6">
|
||||
{/* 统计信息 */}
|
||||
<div className="grid grid-cols-3 gap-4 mb-6">
|
||||
{stats.map((stat, index) => (
|
||||
<motion.div
|
||||
key={stat.label}
|
||||
initial={{ opacity: 0, y: 20 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ delay: 0.3 + index * 0.1 }}
|
||||
className="bg-gray-50 rounded-xl p-4"
|
||||
>
|
||||
<div className="flex items-center gap-3 mb-2">
|
||||
<div className="p-2 bg-white rounded-lg text-gray-600">
|
||||
{stat.icon}
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-2xl font-bold text-gray-900">{stat.value}</p>
|
||||
<p className="text-xs text-gray-500">{stat.label}</p>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* 内容章节 */}
|
||||
<div className="mb-6">
|
||||
<h3 className="text-sm font-semibold text-gray-700 mb-3">生成内容</h3>
|
||||
<div className="space-y-2">
|
||||
{sections.map((section, index) => (
|
||||
<motion.div
|
||||
key={section.name}
|
||||
initial={{ opacity: 0, x: -20 }}
|
||||
animate={{ opacity: 1, x: 0 }}
|
||||
transition={{ delay: 0.4 + index * 0.05 }}
|
||||
className="flex items-center justify-between p-3 bg-gray-50 rounded-lg"
|
||||
>
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-8 h-8 bg-green-100 text-green-600 rounded-full flex items-center justify-center">
|
||||
<CheckCircle className="w-5 h-5" />
|
||||
</div>
|
||||
<span className="font-medium text-gray-900">{section.name}</span>
|
||||
</div>
|
||||
<span className="text-sm text-gray-500">{section.pages}页</span>
|
||||
</motion.div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 生成信息 */}
|
||||
<div className="p-4 bg-blue-50 rounded-xl mb-6">
|
||||
<div className="flex items-start gap-3">
|
||||
<div className="p-2 bg-blue-100 rounded-lg">
|
||||
<FileText className="w-5 h-5 text-blue-600" />
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
<h4 className="font-semibold text-gray-900 mb-1">
|
||||
2024长三角新能源汽车展策划方案
|
||||
</h4>
|
||||
<p className="text-sm text-gray-600">
|
||||
包含完整的市场分析、设计方案、预算规划、执行计划、营销策略等内容
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 操作按钮 */}
|
||||
<div className="flex gap-3">
|
||||
<button
|
||||
onClick={onViewDetails}
|
||||
className="flex-1 px-6 py-3 bg-gradient-to-r from-blue-600 to-purple-600 text-white rounded-xl font-medium hover:shadow-lg transform hover:scale-105 transition-all flex items-center justify-center gap-2"
|
||||
>
|
||||
<Eye className="w-5 h-5" />
|
||||
查看详细方案
|
||||
</button>
|
||||
<button
|
||||
className="flex-1 px-6 py-3 bg-gray-100 text-gray-700 rounded-xl font-medium hover:bg-gray-200 transition-colors flex items-center justify-center gap-2"
|
||||
>
|
||||
<Download className="w-5 h-5" />
|
||||
下载PDF
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
</>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
);
|
||||
};
|
||||
|
||||
export default ResultModal;
|
||||
Reference in New Issue
Block a user