mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-04-20 12:28:08 +00:00
fix listsetter bugs
This commit is contained in:
parent
6a6dd2ee24
commit
703c9fa6d4
@ -93,6 +93,14 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
|
|||||||
private hotValue: any;
|
private hotValue: any;
|
||||||
|
|
||||||
// ======= compatibles for vision ======
|
// ======= compatibles for vision ======
|
||||||
|
setValue(val: any, isHotValue?: boolean, force?: boolean, extraOptions?: any) {
|
||||||
|
if (isHotValue) {
|
||||||
|
this.setHotValue(val, extraOptions);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.setValue(val, false, false, extraOptions);
|
||||||
|
}
|
||||||
|
|
||||||
getHotValue(): any {
|
getHotValue(): any {
|
||||||
if (this.hotValue) {
|
if (this.hotValue) {
|
||||||
return this.hotValue;
|
return this.hotValue;
|
||||||
@ -105,7 +113,7 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
|
|||||||
return this.transducer.toHot(v);
|
return this.transducer.toHot(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
setHotValue(data: any) {
|
setHotValue(data: any, options?: any) {
|
||||||
this.hotValue = data;
|
this.hotValue = data;
|
||||||
const v = this.transducer.toNative(data);
|
const v = this.transducer.toNative(data);
|
||||||
if (this.isUseVariable()) {
|
if (this.isUseVariable()) {
|
||||||
@ -114,10 +122,16 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
|
|||||||
type: 'JSExpression',
|
type: 'JSExpression',
|
||||||
value: ov.value,
|
value: ov.value,
|
||||||
mock: v,
|
mock: v,
|
||||||
});
|
}, false, false, options);
|
||||||
} else {
|
} else {
|
||||||
this.setValue(v);
|
this.setValue(v, false, false, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dirty fix list setter
|
||||||
|
if (Array.isArray(data) && data[0] && data[0].__sid__) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.valueChange();
|
this.valueChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -144,12 +144,15 @@ export class SettingPropEntry implements SettingEntry {
|
|||||||
/**
|
/**
|
||||||
* 设置当前属性值
|
* 设置当前属性值
|
||||||
*/
|
*/
|
||||||
setValue(val: any) {
|
setValue(val: any, isHotValue?: boolean, force?: boolean, extraOptions?: any) {
|
||||||
if (this.type === 'field') {
|
if (this.type === 'field') {
|
||||||
this.parent.setPropValue(this.name, val);
|
this.parent.setPropValue(this.name, val);
|
||||||
}
|
}
|
||||||
|
if (!extraOptions) {
|
||||||
|
extraOptions = {};
|
||||||
|
}
|
||||||
const { setValue } = this.extraProps;
|
const { setValue } = this.extraProps;
|
||||||
if (setValue) {
|
if (setValue && !extraOptions.disableMutator) {
|
||||||
setValue(this, val);
|
setValue(this, val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user