refactor(ai-web): 使用输入节点代替inputSchema

将输入表单放在流程图中一起定义,方便统一参数的处理,不需要单独为输入表单的变量进行合并和操作
This commit is contained in:
2025-07-20 19:27:09 +08:00
parent a5282762ed
commit 267eecbf45
26 changed files with 114 additions and 205 deletions

View File

@@ -1,7 +1,6 @@
import type {NodeProps} from '@xyflow/react'
import {Tag} from 'antd'
import React, {useCallback, useMemo} from 'react'
import {useContextStore} from '../store/ContextStore.ts'
import {useDataStore} from '../store/DataStore.ts'
import {useFlowStore} from '../store/FlowStore.ts'
import AmisNode, {inputsFormColumns, nodeClassName, NormalNodeHandler, outputsFormColumns} from './AmisNode.tsx'
@@ -16,13 +15,12 @@ const languageMap: Record<string, string> = {
const CodeNode = (props: NodeProps) => {
const {getNodes, getEdges} = useFlowStore()
const {getData, getDataById} = useDataStore()
const {getInputSchema} = useContextStore()
const nodeData = getDataById(props.id)
const formSchema: () => FormSchema = useCallback(() => ({
columns: [
...inputsFormColumns(props.id, getInputSchema(), getNodes(), getEdges(), getData()),
...inputsFormColumns(props.id, getNodes(), getEdges(), getData()),
{
type: 'divider',
},