mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-01 03:18:16 +08:00
modal 渲染 form 的逻辑调整
This commit is contained in:
parent
e51559d849
commit
02ed711b1f
@ -306,7 +306,10 @@ export default class Dialog extends React.Component<DialogProps, DialogState> {
|
||||
disabled: (body && (body as any).disabled) || store.loading,
|
||||
onAction: this.handleAction,
|
||||
onFinished: this.handleChildFinished,
|
||||
affixOffsetTop: 0
|
||||
affixOffsetTop: 0,
|
||||
onChange: this.handleFormChange,
|
||||
onInit: this.handleFormInit,
|
||||
onSaved: this.handleFormSaved
|
||||
};
|
||||
|
||||
if (!(body as Schema).type) {
|
||||
@ -322,10 +325,6 @@ export default class Dialog extends React.Component<DialogProps, DialogState> {
|
||||
submitText: null,
|
||||
...schema
|
||||
};
|
||||
|
||||
subProps.onChange = this.handleFormChange;
|
||||
subProps.onInit = this.handleFormInit;
|
||||
subProps.onSaved = this.handleFormSaved;
|
||||
}
|
||||
|
||||
return render(`body${key ? `/${key}` : ''}`, schema, subProps);
|
||||
|
@ -276,7 +276,10 @@ export default class Drawer extends React.Component<DrawerProps, object> {
|
||||
disabled: store.loading,
|
||||
onAction: this.handleAction,
|
||||
onFinished: this.handleChildFinished,
|
||||
popOverContainer: this.getPopOverContainer
|
||||
popOverContainer: this.getPopOverContainer,
|
||||
onChange: this.handleFormChange,
|
||||
onInit: this.handleFormInit,
|
||||
onSaved: this.handleFormSaved
|
||||
};
|
||||
|
||||
if (schema.type === 'form') {
|
||||
@ -286,11 +289,6 @@ export default class Drawer extends React.Component<DrawerProps, object> {
|
||||
submitText: null,
|
||||
...schema
|
||||
};
|
||||
|
||||
// 同步数据到 Dialog 层,方便 actions 根据表单数据联动。
|
||||
subProps.onChange = this.handleFormChange;
|
||||
subProps.onInit = this.handleFormInit;
|
||||
subProps.onSaved = this.handleFormSaved;
|
||||
}
|
||||
|
||||
return render(`body${key ? `/${key}` : ''}`, schema, subProps);
|
||||
|
@ -158,6 +158,7 @@ export default class Form extends React.Component<FormProps, object> {
|
||||
'onChange',
|
||||
'onFailed',
|
||||
'onFinished',
|
||||
'onSaved',
|
||||
'canAccessSuperData',
|
||||
'lazyChange',
|
||||
'formLazyChange',
|
||||
|
Loading…
Reference in New Issue
Block a user