mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 12:58:38 +08:00
combo 数据格式调整
This commit is contained in:
parent
5d2d5094ce
commit
e8ee62152a
@ -15,7 +15,8 @@ import {
|
||||
guid,
|
||||
anyChanged,
|
||||
isObject,
|
||||
createObject} from '../../utils/helper';
|
||||
createObject,
|
||||
extendObject} from '../../utils/helper';
|
||||
import Sortable = require('sortablejs');
|
||||
import { evalExpression, filter } from '../../utils/tpl';
|
||||
import find = require('lodash/find');
|
||||
@ -423,7 +424,7 @@ export default class ComboControl extends React.Component<ComboProps> {
|
||||
}
|
||||
|
||||
value = value || this.defaultValue;
|
||||
return createObject(createObject(data, {index, __index: index}), value);
|
||||
return createObject(extendObject(data, {index, __index: index, ...data}), value);
|
||||
}
|
||||
|
||||
pickCondition(value:any):Condition {
|
||||
@ -713,7 +714,8 @@ export default class ComboControl extends React.Component<ComboProps> {
|
||||
|
||||
@FormItem({
|
||||
type: 'combo',
|
||||
storeType: ComboStore.name
|
||||
storeType: ComboStore.name,
|
||||
extendsData: false
|
||||
})
|
||||
export class ComboControlRenderer extends ComboControl {};
|
||||
|
||||
|
@ -42,6 +42,7 @@ export interface FormItemBasicConfig extends Partial<RendererConfig> {
|
||||
storeExtendsData?: boolean;
|
||||
sizeMutable?: boolean;
|
||||
weight?: number;
|
||||
extendsData?: boolean;
|
||||
|
||||
// 兼容老用法,新用法直接在 Component 里面定义 validate 方法即可。
|
||||
validate?: (values: any, value: any) => string | boolean;
|
||||
@ -528,7 +529,8 @@ export function registerFormItem(config: FormItemConfig): RendererConfig {
|
||||
|
||||
if (config.storeType) {
|
||||
Control = HocStoreFactory({
|
||||
storeType: config.storeType
|
||||
storeType: config.storeType,
|
||||
extendsData: config.extendsData
|
||||
})(Control);
|
||||
delete config.storeType;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user