(data)
| 591 | } |
| 592 | |
| 593 | function updateExecutionFlow(data) { |
| 594 | currentFlowData = data; |
| 595 | |
| 596 | if (!data || data.length === 0) { |
| 597 | elements.executionFlow.innerHTML = '<p class="text-muted">无执行流程数据</p>'; |
| 598 | updateNavigationList([]); |
| 599 | return; |
| 600 | } |
| 601 | |
| 602 | // 确保每个步骤都是独立的顶级元素 |
| 603 | const stepsContainer = document.createElement('div'); |
| 604 | stepsContainer.className = 'execution-steps-container'; |
| 605 | |
| 606 | data.forEach((step, index) => { |
| 607 | const stepElement = document.createElement('div'); |
| 608 | stepElement.innerHTML = createStepHTML(step, index); |
| 609 | stepsContainer.appendChild(stepElement.firstElementChild); |
| 610 | }); |
| 611 | |
| 612 | elements.executionFlow.innerHTML = ''; |
| 613 | elements.executionFlow.appendChild(stepsContainer); |
| 614 | |
| 615 | // 更新导航列表 |
| 616 | updateNavigationList(data); |
| 617 | |
| 618 | // 绑定事件监听器 |
| 619 | bindStepEventListeners(); |
| 620 | } |
| 621 | |
| 622 | function createStepHTML(step, index) { |
| 623 | const roleClass = step.role === 'user' ? 'user-message' : |
no test coverage detected