feat(web): 增加分支节点,增加流程检查的测试

This commit is contained in:
2025-06-29 19:02:19 +08:00
parent 8884495a89
commit 779fd0eb18
11 changed files with 648 additions and 110 deletions

View File

@@ -1,7 +1,7 @@
import type {NodeProps} from '@xyflow/react'
import {Tag} from 'antd'
import {each} from 'licia'
import type {JSX} from 'react'
import React, {type JSX} from 'react'
import {horizontalFormOptions} from '../../../../util/amis.tsx'
import AmisNode from './AmisNode.tsx'
@@ -18,7 +18,7 @@ const StartNode = (props: NodeProps) => AmisNode({
defaultNodeDescription: '定义输入变量',
extraNodeDescription: nodeData => {
const variables: JSX.Element[] = []
const inputs = (nodeData['inputs'] ?? {}) as Record<string, { type: string, description: string }>
const inputs = (nodeData?.inputs ?? {}) as Record<string, { type: string, description: string }>
each(inputs, (value, key) => {
variables.push(
<div className="mt-1 flex justify-between" key={key}>
@@ -65,4 +65,4 @@ const StartNode = (props: NodeProps) => AmisNode({
],
})
export default StartNode
export default React.memo(StartNode)