fix: 修复WorkflowPageV3组件TypeScript错误和清理副本文件

详细说明:
- 修复WorkflowPageV3.tsx中的TypeScript类型错误
- 移除未使用的executionTimeoutRef变量
- 修复style标签的jsx属性问题
- 将deprecated的substr()改为substring()
- 清理n8n目录下的副本文件
- 添加server.js和start脚本用于静态文件服务

影响的文件:
- web_frontend/exhibition-demo/src/pages/WorkflowPageV3.tsx
- web_frontend/exhibition-demo/src/components/ResultModal.tsx
- web_frontend/web_result/server.js (新增)
- web_frontend/web_result/start.bat (新增)
- web_frontend/web_result/start.sh (新增)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Yep_Q
2025-09-08 16:34:51 +08:00
parent d0d256f8ef
commit 83dc9270c8
19 changed files with 8962 additions and 99 deletions

View File

@@ -141,15 +141,13 @@ const ResultModal: React.FC<ResultModalProps> = ({ isOpen, onClose, onViewDetail
{/* 操作按钮 */}
<div className="flex gap-3">
<a
href="../web_result/index.html"
target="_blank"
rel="noopener noreferrer"
<button
onClick={() => window.open('http://localhost:4155', '_blank')}
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" />
</a>
</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"
>

View File

@@ -14,6 +14,8 @@ interface TerminalLine {
progress?: number;
}
type TerminalLineType = TerminalLine['type'];
// 生成随机延迟
const getRandomDelay = (min: number, max: number) => {
return Math.floor(Math.random() * (max - min + 1)) + min;
@@ -34,7 +36,6 @@ const WorkflowPageV3 = () => {
const [isExecuting, setIsExecuting] = useState(false);
const terminalRef = useRef<HTMLDivElement>(null);
const intervalRef = useRef<number | null>(null);
const executionTimeoutRef = useRef<number | null>(null);
// 启动序列
const startupSequence = [
@@ -58,7 +59,10 @@ const WorkflowPageV3 = () => {
];
// Agent执行序列 - 更丰富的输出
const agentSequence = [
const agentSequence: Array<{
agent: typeof agents[0];
outputs: Array<{ type: TerminalLineType; content: string; progress?: number }>
}> = [
{
agent: agents[0], // 信息检索
outputs: [
@@ -329,7 +333,7 @@ const WorkflowPageV3 = () => {
setTerminalLines(prev => [...prev, {
...line,
id: Math.random().toString(36).substr(2, 9),
id: Math.random().toString(36).substring(2, 11),
timestamp
}]);
@@ -561,7 +565,7 @@ const WorkflowPageV3 = () => {
maxHeight: 'calc(100vh - 200px)'
}}
>
<style jsx>{`
<style>{`
.custom-scrollbar::-webkit-scrollbar {
width: 8px;
}