|
|
@ -90,12 +90,9 @@ export function useSwitch( |
|
|
|
|
|
|
|
|
|
|
|
return [ |
|
|
|
return [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: 'multi-condition', |
|
|
|
type: 'custom-parameters', |
|
|
|
field: 'dependTaskList', |
|
|
|
field: 'dependTaskList', |
|
|
|
name: t('project.node.switch_condition'), |
|
|
|
name: t('project.node.switch_condition'), |
|
|
|
validate: { |
|
|
|
|
|
|
|
required: true |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
type: 'input', |
|
|
|
type: 'input', |
|
|
@ -105,23 +102,22 @@ export function useSwitch( |
|
|
|
loading: loading, |
|
|
|
loading: loading, |
|
|
|
type: 'textarea', |
|
|
|
type: 'textarea', |
|
|
|
autosize: { minRows: 2 } |
|
|
|
autosize: { minRows: 2 } |
|
|
|
}, |
|
|
|
|
|
|
|
validate: { |
|
|
|
|
|
|
|
trigger: ['input', 'blur'], |
|
|
|
|
|
|
|
required: true |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
(i = 0) => ({ |
|
|
|
type: 'select', |
|
|
|
type: 'select', |
|
|
|
field: 'nextNode', |
|
|
|
field: 'nextNode', |
|
|
|
span: 18, |
|
|
|
span: 22, |
|
|
|
name: t('project.node.switch_branch_flow'), |
|
|
|
name: t('project.node.switch_branch_flow'), |
|
|
|
options: branchFlowOptions, |
|
|
|
options: branchFlowOptions, |
|
|
|
validate: { |
|
|
|
validate: { |
|
|
|
trigger: ['input', 'blur'], |
|
|
|
trigger: ['input', 'blur'], |
|
|
|
required: true |
|
|
|
validator: (unuse: any, value: string) => { |
|
|
|
|
|
|
|
if (model.dependTaskList[i].condition && !value) |
|
|
|
|
|
|
|
return new Error(t('project.node.switch_branch_flow_tips')) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
] |
|
|
|
] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
@ -132,7 +128,12 @@ export function useSwitch( |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
loading: loading |
|
|
|
loading: loading |
|
|
|
}, |
|
|
|
}, |
|
|
|
options: branchFlowOptions |
|
|
|
options: branchFlowOptions, |
|
|
|
|
|
|
|
validate: { |
|
|
|
|
|
|
|
trigger: ['input', 'blur'], |
|
|
|
|
|
|
|
required: true, |
|
|
|
|
|
|
|
message: t('project.node.switch_branch_flow_tips') |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|