feat(web): 增加数组的判断
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -45,7 +45,7 @@ const CodeNode = (props: NodeProps) => {
|
||||
{
|
||||
type: 'divider',
|
||||
},
|
||||
...outputsFormColumns(true, true),
|
||||
...outputsFormColumns(true, false),
|
||||
], [props.id])
|
||||
|
||||
const extraNodeDescription = useMemo(() => {
|
||||
|
||||
Reference in New Issue
Block a user