feat:修复分支数据动态存储数据库bug

This commit is contained in:
liailing1026
2026-03-13 11:10:42 +08:00
parent fe7cbb81ad
commit a9ae017504
3 changed files with 79 additions and 2 deletions

View File

@@ -555,6 +555,26 @@ onMounted(() => {
isMounted.value = true
initializeFlow()
// 如果没有选中任何节点,根据当前显示的任务步骤来高亮
if (selectedNodeIds.value.size === 0) {
const currentTasks = agentsStore.agentRawPlan.data?.['Collaboration Process'] || []
if (currentTasks.length > 0) {
// 找到当前任务对应的节点 ID
const currentTaskIds = currentTasks.map((task: any) => task.Id)
const nodesToHighlight = nodes.value
.filter(node => {
const nodeTaskId = node.data?.task?.Id || ''
return currentTaskIds.includes(nodeTaskId)
})
.map(node => node.id)
if (nodesToHighlight.length > 0) {
selectedNodeIds.value = new Set(nodesToHighlight)
}
}
}
// 同步 currentTask 数据
if (agentsStore.currentTask && agentsStore.currentTask.StepName) {
const matchedNodes = nodes.value.filter(node => {
@@ -1199,7 +1219,8 @@ const handleAddBranch = async (taskId: string, branchContent: string) => {
try {
const filledTask = await api.fillStepTask({
goal: generalGoal,
stepTask: task
stepTask: task,
TaskID: (window as any).__CURRENT_TASK_ID__ || ''
})
// 更新任务的 AgentSelection 和 TaskProcess
@@ -1466,7 +1487,8 @@ const handleAddBranch = async (taskId: string, branchContent: string) => {
try {
const filledTask = await api.fillStepTask({
goal: generalGoal,
stepTask: task
stepTask: task,
TaskID: (window as any).__CURRENT_TASK_ID__ || ''
})
// 更新任务的 AgentSelection 和 TaskProcess