refactor: 优化RequirementModal UI设计和代码清理

主要更新:
- 🎨 UI改进:
  - 将头部背景改为苹果风格设计
  - 添加背景图片 /image/bg.png
  - 将图标替换为动态视频logo
  - 统一配色为蓝色系,移除紫色元素
  - 优化标题和副标题布局

- 🧹 代码清理:
  - 删除5个临时测试文件 (test-*.html)
  - 删除4个旧版本页面组件 (WorkflowPage V1-V3, ResultPage V1)
  - 保留当前使用的 WorkflowPageV4 和 ResultPageV2

- 🔧 细节调整:
  - 视频logo尺寸调整为 80x80px
  - 移除视频容器的圆角和阴影效果
  - 按钮颜色从紫色渐变改为蓝色渐变

项目结构更加清晰,界面设计更加现代化
This commit is contained in:
Yep_Q
2025-09-29 16:07:19 +08:00
parent 67f5dfbe50
commit a884afc494
89 changed files with 1580 additions and 2009 deletions

View File

@@ -0,0 +1,102 @@
/**
* 终端模拟数据管理器
* 为12个订单班提供统一的终端模拟数据
*/
import { Agent } from '@/store/demoStore';
import { wenluSimulation } from './wenlu';
import { foodSimulation } from './food';
// 终端行类型定义
export interface TerminalLine {
type: 'info' | 'success' | 'warning' | 'error' | 'system' | 'output' | 'progress' | 'install' | 'file' | 'image';
content: string;
agent?: string;
// 进度条相关
target?: number;
stutters?: number[];
duration?: number; // 添加duration字段
// 图片相关
imageSrc?: string;
imageAlt?: string;
}
// Agent输出定义
export interface AgentOutput {
agent: () => Agent; // 修改为函数类型
outputs: TerminalLine[];
}
// 完整的模拟数据结构
export interface SimulationData {
orderClassId: string;
orderClassName: string;
projectTitle: string;
startupSequence: TerminalLine[];
agentSequence: AgentOutput[];
completionSequence: TerminalLine[];
}
// 生成函数类型
export type SimulationGenerator = (agents: Agent[]) => SimulationData;
// 订单班模拟数据映射表 - 目前只有文旅和食品
export const simulationMap: Record<string, SimulationGenerator> = {
wenlu: wenluSimulation, // 文旅
food: foodSimulation, // 食品
// 其他订单班暂未实现缺少agent prompt和头像数据
};
// 获取指定订单班的模拟数据
export const getSimulationData = (orderClassId: string, agents: Agent[]): SimulationData | null => {
console.log('[getSimulationData] Called with:', {
orderClassId,
agentsCount: agents.length,
agentsNames: agents.map(a => a.name)
});
const generator = simulationMap[orderClassId];
console.log('[getSimulationData] Available keys:', Object.keys(simulationMap));
console.log('[getSimulationData] Generator found:', !!generator);
if (!generator) {
console.warn(`No simulation data found for order class: ${orderClassId}`);
return null;
}
const data = generator(agents);
console.log('[getSimulationData] Data generated:', {
hasData: !!data,
orderClassName: data?.orderClassName,
projectTitle: data?.projectTitle,
startupSequenceLength: data?.startupSequence?.length,
agentSequenceLength: data?.agentSequence?.length,
completionSequenceLength: data?.completionSequence?.length
});
return data;
};
// 通用工具函数
export const utils = {
// 生成随机延迟
getRandomDelay: (min: number, max: number) => {
return Math.floor(Math.random() * (max - min + 1)) + min;
},
// 生成进度条字符串
generateProgressBar: (progress: number, width: number = 40) => {
const filled = Math.floor((progress / 100) * width);
const empty = width - filled;
return `[${'█'.repeat(filled)}${'░'.repeat(empty)}] ${progress.toString().padStart(3, ' ')}%`;
},
// 生成文件大小
generateFileSize: () => {
const sizes = ['12.3KB', '456KB', '1.2MB', '3.4MB', '15.7MB', '48.2MB', '126MB'];
return sizes[Math.floor(Math.random() * sizes.length)];
},
// 重复字符
repeat: (char: string, times: number) => char.repeat(times)
};