feat:1.数据库存储功能添加(初版)2.后端REST API版本代码清理

This commit is contained in:
liailing1026
2026-02-25 10:55:51 +08:00
parent f736cd104a
commit 2140cfaf92
35 changed files with 3912 additions and 2981 deletions

View File

@@ -3,6 +3,7 @@ import SvgIcon from '@/components/SvgIcon/index.vue'
import { getAgentMapIcon } from '@/layout/components/config.ts'
import { type ConnectArg, Jsplumb } from '@/layout/components/Main/TaskTemplate/utils.ts'
import { type IRawStepTask, useAgentsStore } from '@/stores'
// import api from '@/api'
import { computed, nextTick, watch, onMounted } from 'vue'
import { AnchorLocations } from '@jsplumb/browser-ui'
import { Loading } from '@element-plus/icons-vue'
@@ -109,7 +110,7 @@ watch(
)
// 保存编辑内容
const handleContentSave = (taskId: string, content: string) => {
const handleContentSave = async (taskId: string, content: string) => {
const taskToUpdate = collaborationProcess.value.find(item => item.Id === taskId)
if (taskToUpdate && content !== taskToUpdate.TaskContent) {
taskToUpdate.TaskContent = content
@@ -118,6 +119,18 @@ const handleContentSave = (taskId: string, content: string) => {
if (stepIndex >= 0) {
agentsStore.addModifiedStep(stepIndex)
}
//暂时注释掉直接保存 task_outline 的操作,避免覆盖整个主流程
// 如果需要持久化,应该只更新变化的字段或使用专门的 API
// const dbTaskId = (window as any).__CURRENT_TASK_ID__
// if (dbTaskId && agentsStore.agentRawPlan.data) {
// try {
// await api.updateTaskOutline(dbTaskId, agentsStore.agentRawPlan.data)
// console.log('[handleContentSave] 主流程已保存到数据库')
// } catch (error) {
// console.error('[handleContentSave] 保存主流程失败:', error)
// }
// }
}
}