feat(web): 节点描述和名称直接放在节点数据中

This commit is contained in:
v-zhangjc9
2025-07-10 16:34:29 +08:00
parent 333da7ef88
commit fad190567b
7 changed files with 58 additions and 36 deletions

View File

@@ -1,15 +1,22 @@
import type {NodeProps} from '@xyflow/react'
import React, {useCallback} from 'react'
import AmisNode, {EndNodeHandler, outputsFormColumns} from './AmisNode.tsx'
import {useContextStore} from '../store/ContextStore.ts'
import {useDataStore} from '../store/DataStore.ts'
import {useFlowStore} from '../store/FlowStore.ts'
import AmisNode, {EndNodeHandler, inputsFormColumns} from './AmisNode.tsx'
const OutputNode = (props: NodeProps) => {
const columnsSchema = useCallback(() => outputsFormColumns(true), [props.id])
const {getNodes, getEdges} = useFlowStore()
const {getData} = useDataStore()
const {getInputSchema} = useContextStore()
const columnsSchema = useCallback(
() => inputsFormColumns(props.id, getInputSchema(), getNodes(), getEdges(), getData()),
[props.id],
)
return (
<AmisNode
nodeProps={props}
defaultNodeName="输出节点"
defaultNodeDescription="定义输出变量"
columnSchema={columnsSchema}
handler={<EndNodeHandler/>}
/>