feat(web): 增加循环节点的基本参数

This commit is contained in:
v-zhangjc9
2025-07-15 11:11:36 +08:00
parent b0e4f5853e
commit df8270676a
2 changed files with 26 additions and 10 deletions

View File

@@ -1,20 +1,21 @@
import {PlusCircleFilled} from '@ant-design/icons'
import {Button, Dropdown} from 'antd'
import type {ButtonProps} from 'antd/lib'
import {isEqual, randomId, unique} from 'licia'
import {NodeRegistry, NodeRegistryMap} from '../NodeRegistry.tsx'
import {commonInfo} from '../../../util/amis.tsx'
import {checkAddNode} from '../FlowChecker.tsx'
import {Button, Dropdown} from 'antd'
import {PlusCircleFilled} from '@ant-design/icons'
import {NodeRegistry, NodeRegistryMap} from '../NodeRegistry.tsx'
import {useDataStore} from '../store/DataStore.ts'
import {useFlowStore} from '../store/FlowStore.ts'
import type {ButtonProps} from 'antd/lib'
export type AddNodeButtonProps = {
export type AddNodeButtonProps = ButtonProps & {
parent?: string
} & ButtonProps
onlyIcon?: boolean
}
const AddNodeButton = (props: AddNodeButtonProps) => {
const {data, setDataById} = useDataStore()
const {nodes, addNode, edges,} = useFlowStore()
const {nodes, addNode, edges} = useFlowStore()
return (
<Dropdown
menu={{
@@ -57,7 +58,7 @@ const AddNodeButton = (props: AddNodeButtonProps) => {
...(props.parent ? {
parentId: props.parent,
extent: 'parent',
} : {})
} : {}),
})
} catch (e) {
// @ts-ignore
@@ -68,7 +69,7 @@ const AddNodeButton = (props: AddNodeButtonProps) => {
>
<Button {...props}>
<PlusCircleFilled/>
{props.onlyIcon ? undefined : '新增节点'}
</Button>
</Dropdown>
)