处理agent答非所问的问题
This commit is contained in:
@@ -114,9 +114,10 @@
|
||||
:pan-on-drag="true"
|
||||
:pan-on-scroll="true"
|
||||
:zoom-on-scroll="true"
|
||||
:zoom-on-double-click="true"
|
||||
:zoom-on-double-click="false"
|
||||
:fit-view-on-init="false"
|
||||
@node-click="onNodeClick"
|
||||
@node-double-click="onNodeDoubleClick"
|
||||
@edge-click="onEdgeClick"
|
||||
@pane-click="onPaneClick"
|
||||
@nodes-change="onNodesChange"
|
||||
@@ -1233,6 +1234,15 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 节点执行详情面板 -->
|
||||
<NodeExecutionDetail
|
||||
v-model:visible="nodeDetailVisible"
|
||||
:node-id="selectedNode?.id"
|
||||
:node-label="selectedNode?.data?.label || selectedNode?.id"
|
||||
:node-type="selectedNode?.type"
|
||||
:execution-id="currentExecutionId"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1251,6 +1261,7 @@ import api from '@/api'
|
||||
import type { WorkflowNode, WorkflowEdge } from '@/types'
|
||||
import { StartNode, LLMNode, ConditionNode, EndNode, DefaultNode } from './NodeTypes'
|
||||
import { useCollaboration } from '@/composables/useCollaboration'
|
||||
import NodeExecutionDetail from './NodeExecutionDetail.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
workflowId?: string
|
||||
@@ -1271,6 +1282,8 @@ const selectedNode = ref<Node | null>(null)
|
||||
const selectedEdge = ref<Edge | null>(null)
|
||||
const draggedNodeType = ref<any>(null)
|
||||
const testingNode = ref(false)
|
||||
const nodeDetailVisible = ref(false)
|
||||
const currentExecutionId = ref<string | null>(null)
|
||||
|
||||
// 节点复制相关
|
||||
const copiedNode = ref<Node | null>(null)
|
||||
@@ -1640,6 +1653,20 @@ const onNodeClick = (event: NodeClickEvent) => {
|
||||
nodeTestResult.value = null
|
||||
}
|
||||
|
||||
// 节点双击 - 显示执行详情
|
||||
const onNodeDoubleClick = (event: NodeClickEvent) => {
|
||||
// 阻止双击时的默认行为(如缩放)
|
||||
event.event?.preventDefault?.()
|
||||
|
||||
if (currentExecutionId.value) {
|
||||
// 确保选中节点
|
||||
selectedNode.value = event.node
|
||||
nodeDetailVisible.value = true
|
||||
} else {
|
||||
ElMessage.info('暂无执行记录,请先执行工作流')
|
||||
}
|
||||
}
|
||||
|
||||
// 判断是否为定时任务节点类型(计算属性)
|
||||
const isScheduleNodeSelected = computed(() => {
|
||||
return selectedNode.value && (selectedNode.value.type === 'schedule' || selectedNode.value.type === 'delay' || selectedNode.value.type === 'timer')
|
||||
@@ -2699,6 +2726,11 @@ watch(() => props.executionStatus, (newStatus, oldStatus) => {
|
||||
console.log('[rjb] Current nodes:', nodes.value.map(n => ({ id: n.id, type: n.type, class: n.class })))
|
||||
console.log('[rjb] All node IDs:', nodes.value.map(n => n.id))
|
||||
|
||||
// 提取execution_id
|
||||
if (newStatus && newStatus.execution_id) {
|
||||
currentExecutionId.value = newStatus.execution_id
|
||||
}
|
||||
|
||||
// 使用 nextTick 确保 DOM 更新
|
||||
nextTick(() => {
|
||||
// 清除所有节点的执行状态
|
||||
|
||||
Reference in New Issue
Block a user