消除一些语法错误提示
This commit is contained in:
parent
bc413e5f0a
commit
e1665109ff
@ -93,8 +93,7 @@ const handleSave = async () => {
|
||||
|
||||
if (agentId.value) {
|
||||
// 保存到智能体
|
||||
const prettyJson = JSON.stringify(flowData, null, 2)
|
||||
await agentStore.updateAgent(agentId.value, { agent_flow: prettyJson })
|
||||
await agentStore.updateAgent(agentId.value, { agent_flow: flowData })
|
||||
message.success('流程保存成功')
|
||||
} else {
|
||||
// 作为独立流程保存
|
||||
|
||||
@ -2,6 +2,9 @@ import axios from 'axios'
|
||||
|
||||
import type { AIAgent, AgentExecutionResult } from '../types'
|
||||
|
||||
// 重新导出类型,供其他模块使用
|
||||
export type { AIAgent, AgentExecutionResult }
|
||||
|
||||
// 使用相对路径,通过Vite代理转发到后端
|
||||
const BACKEND_SERVER_URL = ''
|
||||
|
||||
|
||||
@ -9,9 +9,9 @@ export const useAgentStore = defineStore('agent', () => {
|
||||
const error = ref<string | null>(null)
|
||||
|
||||
// 计算属性
|
||||
const enabledAgents = computed(() => agents.value.filter(agent => agent.enabled))
|
||||
const activeAgents = computed(() => agents.value.filter(agent => agent.status === '进行中'))
|
||||
const completedAgents = computed(() => agents.value.filter(agent => agent.status === '已完成'))
|
||||
const enabledAgents = computed(() => agents.value.filter((agent: any) => agent.enabled))
|
||||
const activeAgents = computed(() => agents.value.filter((agent: any) => agent.status === '进行中'))
|
||||
const completedAgents = computed(() => agents.value.filter((agent: any) => agent.status === '已完成'))
|
||||
|
||||
// 获取AI Agent列表
|
||||
const fetchAgents = async () => {
|
||||
@ -65,12 +65,12 @@ export const useAgentStore = defineStore('agent', () => {
|
||||
|
||||
// 根据状态获取Agent数量
|
||||
const getAgentCountByStatus = (status: string) => {
|
||||
return agents.value.filter(agent => agent.status === status).length
|
||||
return agents.value.filter((agent: any) => agent.status === status).length
|
||||
}
|
||||
|
||||
// 根据触发模式获取Agent数量
|
||||
const getAgentCountByTriggerMode = (triggerMode: string) => {
|
||||
return agents.value.filter(agent => agent.trigger_mode === triggerMode).length
|
||||
return agents.value.filter((agent: any) => agent.trigger_mode === triggerMode).length
|
||||
}
|
||||
|
||||
// 更新AI Agent
|
||||
@ -84,7 +84,7 @@ export const useAgentStore = defineStore('agent', () => {
|
||||
currentAgent.value = { ...currentAgent.value, ...data }
|
||||
}
|
||||
// 更新列表中的agent
|
||||
const index = agents.value.findIndex(agent => agent.name === name)
|
||||
const index = agents.value.findIndex((agent: any) => agent.name === name)
|
||||
if (index !== -1) {
|
||||
agents.value[index] = { ...agents.value[index], ...data }
|
||||
}
|
||||
|
||||
@ -58,8 +58,7 @@ const handleSave = async (flowData: any) => {
|
||||
try {
|
||||
if (agentId.value) {
|
||||
// 保存到智能体
|
||||
const prettyJson = JSON.stringify(flowData, null, 2)
|
||||
await agentStore.updateAgent(agentId.value, { agent_flow: prettyJson })
|
||||
await agentStore.updateAgent(agentId.value, { agent_flow: flowData })
|
||||
message.success('智能体流程保存成功')
|
||||
} else {
|
||||
// 作为独立流程保存
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user