4.8.13 test (#3102)

* fix: loop index;edge parent check

* perf: reference invalid check

* fix: ts
This commit is contained in:
Archer
2024-11-08 20:53:58 +08:00
committed by archer
parent 49aaf9b77e
commit 8bd0749afe
17 changed files with 117 additions and 62 deletions

View File

@@ -201,6 +201,7 @@ export enum NodeInputKeyEnum {
nodeHeight = 'nodeHeight',
// loop start
loopStartInput = 'loopStartInput',
loopStartIndex = 'loopStartIndex',
// loop end
loopEndInput = 'loopEndInput',
@@ -258,7 +259,7 @@ export enum NodeOutputKeyEnum {
loopArray = 'loopArray',
// loop start
loopStartInput = 'loopStartInput',
loopArrayIndex = 'loopArrayIndex',
loopStartIndex = 'loopStartIndex',
// form input
formInputResult = 'formInputResult'

View File

@@ -239,7 +239,7 @@ export const getReferenceVariableValue = ({
nodes: RuntimeNodeItemType[];
variables: Record<string, any>;
}) => {
if (!value) return undefined;
if (!value) return value;
// handle single reference value
if (isValidReferenceValueFormat(value)) {
@@ -253,7 +253,7 @@ export const getReferenceVariableValue = ({
const node = nodes.find((node) => node.nodeId === sourceNodeId);
if (!node) {
return undefined;
return value;
}
return node.outputs.find((output) => output.id === outputId)?.value;

View File

@@ -33,12 +33,18 @@ export const LoopStartNode: FlowNodeTemplateType = {
label: '',
required: true,
value: ''
},
{
key: NodeInputKeyEnum.loopStartIndex,
renderTypeList: [FlowNodeInputTypeEnum.hidden],
valueType: WorkflowIOValueTypeEnum.number,
label: i18nT('workflow:Array_element_index')
}
],
outputs: [
{
id: NodeOutputKeyEnum.loopArrayIndex,
key: NodeOutputKeyEnum.loopArrayIndex,
id: NodeOutputKeyEnum.loopStartIndex,
key: NodeOutputKeyEnum.loopStartIndex,
label: i18nT('workflow:Array_element_index'),
type: FlowNodeOutputTypeEnum.static,
valueType: WorkflowIOValueTypeEnum.number