mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-01 03:28:20 +08:00
修复 Drawer actions 数据不同步问题
This commit is contained in:
parent
b490008113
commit
7f34931cf9
@ -241,6 +241,10 @@ export default class Drawer extends React.Component<DrawerProps, object> {
|
||||
renderBody(body: SchemaNode, key?: any): React.ReactNode {
|
||||
let {render, store} = this.props;
|
||||
|
||||
if (Array.isArray(body)) {
|
||||
return body.map((body, key) => this.renderBody(body, key));
|
||||
}
|
||||
|
||||
let schema: Schema = body as Schema;
|
||||
let subProps: any = {
|
||||
key,
|
||||
|
@ -368,18 +368,24 @@ export default class FormControl extends React.Component<FormControlProps, any>
|
||||
}
|
||||
|
||||
handleBulkChange(values:any, submitOnChange:boolean = this.props.control.submitOnChange) {
|
||||
if (!isObject(values) || !this.model) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {
|
||||
formStore: form,
|
||||
onChange,
|
||||
control: {
|
||||
validateOnChange
|
||||
}
|
||||
validateOnChange,
|
||||
type
|
||||
},
|
||||
onBulkChange
|
||||
} = this.props;
|
||||
|
||||
|
||||
if (!isObject(values)) {
|
||||
return;
|
||||
} else if (!this.model || ~['service'].indexOf(type)) {
|
||||
onBulkChange && onBulkChange(values);
|
||||
return;
|
||||
}
|
||||
|
||||
let lastKey:string = '', lastValue:any;
|
||||
Object.keys(values).forEach(key => {
|
||||
const value = values[key];
|
||||
|
Loading…
Reference in New Issue
Block a user