mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:08:55 +08:00
parent
5cb15800f5
commit
150accdfac
@ -648,7 +648,7 @@ export function wrapControl<
|
||||
|
||||
if (pipeOut) {
|
||||
const oldValue = this.model.value;
|
||||
value = pipeOut(value, oldValue, data);
|
||||
value = pipeOut.call(this, value, oldValue, data);
|
||||
}
|
||||
|
||||
this.model.changeTmpValue(value, 'input');
|
||||
@ -767,7 +767,7 @@ export function wrapControl<
|
||||
} = this.props;
|
||||
|
||||
if (pipeOut) {
|
||||
value = pipeOut(value, oldValue, data);
|
||||
value = pipeOut.call(this, value, oldValue, data);
|
||||
}
|
||||
|
||||
if (model.extraName) {
|
||||
@ -784,7 +784,7 @@ export function wrapControl<
|
||||
let value: any = this.model ? this.model.tmpValue : control.value;
|
||||
|
||||
if (control.pipeIn) {
|
||||
value = control.pipeIn(value, data);
|
||||
value = control.pipeIn.call(this, value, data);
|
||||
}
|
||||
|
||||
return value;
|
||||
|
@ -14,10 +14,13 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) {
|
||||
draggable: true,
|
||||
...schema,
|
||||
multiple: true,
|
||||
pipeIn: (value: any) => {
|
||||
pipeIn: function (this: any, value: any) {
|
||||
if (!isObject(value)) {
|
||||
return [];
|
||||
}
|
||||
if (isEqual(value, this.cachedValue)) {
|
||||
return this.cachedValueArray;
|
||||
}
|
||||
const arr: Array<any> = [];
|
||||
Object.keys(value).forEach(key => {
|
||||
const valueType = typeof value[key];
|
||||
@ -33,7 +36,7 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) {
|
||||
});
|
||||
return arr;
|
||||
},
|
||||
pipeOut: (value: any) => {
|
||||
pipeOut: function (this: any, value: any) {
|
||||
if (!Array.isArray(value)) {
|
||||
return value;
|
||||
}
|
||||
@ -53,6 +56,8 @@ addSchemaFilter(function (schema: Schema, renderer, props?: any) {
|
||||
|
||||
obj[key] = value;
|
||||
});
|
||||
this.cachedValue = obj;
|
||||
this.cachedValueArray = value;
|
||||
return obj;
|
||||
},
|
||||
items: [
|
||||
|
Loading…
Reference in New Issue
Block a user