Merge pull request #435 from SuanmoSuanyangTechnology/feature/workflow_import_zy
fix(web): agent's variables init update
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 16:29:21
|
* @Date: 2026-02-03 16:29:21
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-02-25 18:11:49
|
* @Last Modified time: 2026-03-03 11:14:30
|
||||||
*/
|
*/
|
||||||
import { type FC, type ReactNode, useEffect, useRef, useState, forwardRef, useImperativeHandle } from 'react';
|
import { type FC, type ReactNode, useEffect, useRef, useState, forwardRef, useImperativeHandle } from 'react';
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
@@ -175,6 +175,10 @@ const Agent = forwardRef<AgentRef>((_props, ref) => {
|
|||||||
const parsedMemoryContent = memoryContent === null || memoryContent === ''
|
const parsedMemoryContent = memoryContent === null || memoryContent === ''
|
||||||
? undefined
|
? undefined
|
||||||
: !isNaN(Number(memoryContent)) ? Number(memoryContent) : memoryContent
|
: !isNaN(Number(memoryContent)) ? Number(memoryContent) : memoryContent
|
||||||
|
const variableList = variables?.map((item, index) => ({
|
||||||
|
...item,
|
||||||
|
index
|
||||||
|
})) || []
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
...response,
|
...response,
|
||||||
tools: allTools,
|
tools: allTools,
|
||||||
@@ -185,9 +189,10 @@ const Agent = forwardRef<AgentRef>((_props, ref) => {
|
|||||||
skills: {
|
skills: {
|
||||||
...skills,
|
...skills,
|
||||||
skill_ids: allSkills
|
skill_ids: allSkills
|
||||||
}
|
},
|
||||||
|
variables: [...variableList]
|
||||||
})
|
})
|
||||||
updateVariableList([...variables])
|
updateVariableList([...variableList])
|
||||||
setData({
|
setData({
|
||||||
...response,
|
...response,
|
||||||
tools: allTools
|
tools: allTools
|
||||||
|
|||||||
Reference in New Issue
Block a user