feat(web): 增加数组的判断

This commit is contained in:
v-zhangjc9
2025-07-18 11:07:48 +08:00
parent ad9dade6a1
commit 4cfa110f2f
2 changed files with 7 additions and 1 deletions

View File

@@ -117,6 +117,8 @@ const numberOperators: ConditionOperator[] = [
{label: '小于或等于', value: 'less_equal'},
]
const numberDefaultOperator: string = 'equal'
const arrayOperators: ConditionOperator[] = ['is_empty', 'is_not_empty']
const arrayDefaultOperator: string = 'is_empty'
export const generateAllIncomerOutputVariablesConditions: (id: string, inputSchema: Record<string, Record<string, any>>, nodes: Node[], edges: Edge[], data: any) => Option[] = (id, inputSchema, nodes, edges, data) => {
let optionMap: Record<string, Option[]> = {}
@@ -159,6 +161,10 @@ export const generateAllIncomerOutputVariablesConditions: (id: string, inputSche
defaultOp: numberDefaultOperator,
operators: numberOperators,
} : {}),
...((item.type === 'array-text' || item.type === 'array-object') ? {
defaultOp: arrayDefaultOperator,
operators: arrayOperators,
} : {}),
})
}
return Object.keys(optionMap)

View File

@@ -45,7 +45,7 @@ const CodeNode = (props: NodeProps) => {
{
type: 'divider',
},
...outputsFormColumns(true, true),
...outputsFormColumns(true, false),
], [props.id])
const extraNodeDescription = useMemo(() => {