[amis-saas-7686]:跳转和打开页面动作配置后提交报forEach错误

Change-Id: I9643aca9f9dabeaf40ebf2b448f93b2478beb99a
This commit is contained in:
hsm-lv 2022-10-25 15:27:28 +08:00
parent 52bfa124bf
commit 4c93c869b6

View File

@ -1008,7 +1008,7 @@ const objectToComboArray = (obj: PlainObject) =>
*/
const comboArrayToObject = (arr: any[]) => {
let obj: PlainObject = {};
arr.forEach(item => {
arr?.forEach(item => {
obj[item.key] = item.val;
});
@ -1344,10 +1344,13 @@ export const getEventControlConfig = (
// 转换下格式
if (['link', 'url'].includes(action.actionType)) {
action.args = {
...action.args,
params: comboArrayToObject(config.args?.params)
};
const params = config.args?.params;
if (params && params.length) {
action.args = {
...action.args,
params: comboArrayToObject(params)
};
}
}
// 转换下格式