refractor(web): 优化选择节点的选择器
This commit is contained in:
@@ -109,6 +109,7 @@ function FlowEditor(props: FlowEditorProps) {
|
||||
onNodeDrag={onNodeDrag}
|
||||
onNodeDragStop={onNodeDragEnd}
|
||||
onEdgesDelete={() => console.info('delete')}
|
||||
fitView
|
||||
>
|
||||
<Panel position="top-right">
|
||||
<Space className="toolbar">
|
||||
|
||||
@@ -103,11 +103,8 @@ export const generateAllIncomerOutputVariablesFormOptions: (id: string, inputSch
|
||||
type ConditionOperator = string | { label: string, value: string }
|
||||
const textOperators: ConditionOperator[] = ['equal', 'not_equal', 'is_empty', 'is_not_empty', 'like', 'not_like', 'starts_with', 'ends_with']
|
||||
const textDefaultOperator: string = 'equal'
|
||||
const booleanOperators: ConditionOperator[] = [
|
||||
{label: '为真', value: 'is_true'},
|
||||
{label: '为假', value: 'is_false'},
|
||||
]
|
||||
const booleanDefaultOperator: string = 'is_true'
|
||||
const booleanOperators: ConditionOperator[] = ['equal', 'not_equal']
|
||||
const booleanDefaultOperator: string = 'equal'
|
||||
const numberOperators: ConditionOperator[] = [
|
||||
'equal',
|
||||
'not_equal',
|
||||
@@ -139,8 +136,13 @@ export const generateAllIncomerOutputVariablesConditions: (id: string, inputSche
|
||||
} : {}),
|
||||
...(item.type === 'boolean' ? {
|
||||
value: {
|
||||
type: 'wrapper',
|
||||
size: 'none',
|
||||
type: 'select',
|
||||
required: true,
|
||||
selectFirst: true,
|
||||
options: [
|
||||
{label: '真', value: true},
|
||||
{label: '假', value: false},
|
||||
]
|
||||
},
|
||||
defaultOp: booleanDefaultOperator,
|
||||
operators: booleanOperators,
|
||||
|
||||
@@ -31,6 +31,8 @@ const SwitchNode = (props: NodeProps) => {
|
||||
name: 'condition',
|
||||
label: '条件',
|
||||
required: true,
|
||||
builderMode: 'simple',
|
||||
showANDOR: true,
|
||||
fields: generateAllIncomerOutputVariablesConditions(
|
||||
props.id,
|
||||
getInputSchema(),
|
||||
|
||||
Reference in New Issue
Block a user