feat:用户修改步骤后重新执行实现
This commit is contained in:
@@ -201,7 +201,23 @@ const saveEditing = () => {
|
||||
if (editingTaskId.value && editingContent.value.trim()) {
|
||||
const taskToUpdate = collaborationProcess.value.find(item => item.Id === editingTaskId.value)
|
||||
if (taskToUpdate) {
|
||||
taskToUpdate.TaskContent = editingContent.value.trim()
|
||||
// 保存旧值用于比较
|
||||
const oldValue = taskToUpdate.TaskContent
|
||||
const newValue = editingContent.value.trim()
|
||||
|
||||
// 只有内容真正变化时才更新和记录修改
|
||||
if (newValue !== oldValue) {
|
||||
taskToUpdate.TaskContent = newValue
|
||||
|
||||
// 记录修改过的步骤索引到 store(用于重新执行)
|
||||
const stepIndex = collaborationProcess.value.findIndex(item => item.Id === editingTaskId.value)
|
||||
if (stepIndex >= 0) {
|
||||
agentsStore.addModifiedStep(stepIndex)
|
||||
console.log(`📝 步骤 ${stepIndex + 1} (${taskToUpdate.StepName}) 的 TaskContent 已被修改,将从该步骤重新执行`)
|
||||
}
|
||||
} else {
|
||||
console.log(`ℹ️ 步骤 ${taskToUpdate.StepName} 的 TaskContent 未发生变化,不记录修改`)
|
||||
}
|
||||
}
|
||||
}
|
||||
editingTaskId.value = null
|
||||
|
||||
Reference in New Issue
Block a user