Skip to content

Commit

Permalink
fix: 修复事件流传参问题
Browse files Browse the repository at this point in the history
  • Loading branch information
JackySoft committed Sep 2, 2024
1 parent 55af774 commit 7b3fc07
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ const SelectVariableModal = ({ onSelect }: { onSelect: (record: any) => void },
} else if (type === 'function') {
form.setFieldValue(
'expression',
`function run(eventParams) {
return '';
`function run() {
return context.eventParams;
}`,
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/packages/utils/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export const handleArrayVariable = (list: any = [], data: any = {}) => {
}
} else {
// 变量不支持模板字符串语法
const result = renderFormula(next.value.value);
const result = renderFormula(next.value.value, data);
prev[next.key] = isNotEmpty(result) ? result : undefined;
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/materials/utils/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export const handleArrayVariable = (list: any = [], data: any = {}) => {
}
} else {
// 变量不支持模板字符串语法
const result = renderFormula(next.value.value);
const result = renderFormula(next.value.value, data);
prev[next.key] = isNotEmpty(result) ? result : undefined;
}
}
Expand Down

0 comments on commit 7b3fc07

Please sign in to comment.