amis-saas-5770 [Feature] 「input-sub-form」子表单项配置成员渲染器,控制台报错,无法成功配置

Change-Id: If09d3b094a65c9cbe7f98bd274b55c8ce84f9ee4
This commit is contained in:
jiatianqi 2022-08-22 10:59:51 +08:00
parent 2fc979f0b9
commit 60016505cc

View File

@ -165,6 +165,7 @@ export class SubFormControlPlugin extends BasePlugin {
type: 'dialog',
body: {
type: 'form',
className: 'h-full pl-4 pr-4',
...rest
}
};
@ -174,10 +175,29 @@ export class SubFormControlPlugin extends BasePlugin {
value: schema,
memberImmutable: ['body'],
onChange: newValue => {
const form = newValue.body[0];
const {
title,
actions,
name,
size,
closeOnEsc,
showCloseButton,
bodyClassName,
body
} = newValue;
newValue = {
...value,
form
form: {
title,
actions,
name,
size,
closeOnEsc,
showCloseButton,
bodyClassName,
...body[0]
}
};
// delete newValue.form.body;
delete newValue.form.type;