feat(web): 节点增加入参变量

This commit is contained in:
v-zhangjc9
2025-06-27 10:04:48 +08:00
parent 635c6537ed
commit 6e667c45e1
6 changed files with 78 additions and 69 deletions

View File

@@ -8,6 +8,34 @@ import {horizontalFormOptions} from '../../../../util/amis.tsx'
export type AmisNodeType = 'normal' | 'start' | 'end'
export function inputsFormColumns(required: boolean = false, preload?: any): Schema[] {
return [
{
type: 'input-kvs',
name: 'inputs',
label: '输入变量',
value: preload,
addButtonText: '新增输入',
draggable: false,
keyItem: {
...horizontalFormOptions(),
label: '参数名称',
},
required: required,
valueItems: [
{
...horizontalFormOptions(),
type: 'select',
name: 'type',
label: '变量',
required: true,
options: [],
},
],
},
]
}
export function outputsFormColumns(editable: boolean = false, required: boolean = false, preload?: any): Schema[] {
return [
{
@@ -159,7 +187,7 @@ const AmisNode: (props: AmisNodeProps) => JSX.Element = ({
{isNil(handlers)
? <>
{isEqual(type, 'start') || isEqual(type, 'normal')
? <LimitHandler type="source" position={Position.Right} limit={1}/> : undefined}
? <Handle type="source" position={Position.Right}/> : undefined}
{isEqual(type, 'end') || isEqual(type, 'normal')
? <Handle type="target" position={Position.Left}/> : undefined}
</>