修复 Drawer actions 数据不同步问题

This commit is contained in:
liaoxuezhi 2019-08-21 15:57:18 +08:00
parent b490008113
commit 7f34931cf9
2 changed files with 16 additions and 6 deletions

View File

@ -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,

View File

@ -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];