feat(web): 节点描述和名称直接放在节点数据中
This commit is contained in:
@@ -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/>}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user