feat(web): 调整节点入参形式

This commit is contained in:
v-zhangjc9
2025-06-26 14:38:09 +08:00
parent 873c1a1d20
commit a2aba82b6e
8 changed files with 54 additions and 196 deletions

View File

@@ -3,7 +3,7 @@ import {Handle, type NodeProps, Position} from '@xyflow/react'
import type {Schema} from 'amis'
import {Card, Dropdown} from 'antd'
import {isEmpty, isEqual} from 'licia'
import type {JSX} from 'react'
import {type JSX} from 'react'
import {horizontalFormOptions} from '../../../../util/amis.tsx'
export type AmisNodeType = 'normal' | 'start' | 'end'
@@ -55,15 +55,24 @@ export function outputsFormColumns(editable: boolean = false, required: boolean
]
}
const AmisNode = (
props: NodeProps,
interface AmisNodeProps {
nodeProps: NodeProps,
type: AmisNodeType,
defaultNodeName: String,
defaultNodeDescription?: String,
extraNodeDescription?: (nodeData: any) => JSX.Element,
columnSchema?: Schema[],
) => {
const {id, data} = props
}
const AmisNode: (props: AmisNodeProps) => JSX.Element = ({
nodeProps,
type,
defaultNodeName,
defaultNodeDescription,
extraNodeDescription,
columnSchema,
}) => {
const {id, data} = nodeProps
const {getDataById, removeNode, editNode} = data
// @ts-ignore
const nodeData = getDataById(id)