mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
fix listsetter bugs
This commit is contained in:
parent
6a6dd2ee24
commit
703c9fa6d4
@ -91,8 +91,16 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
|
||||
}
|
||||
|
||||
private hotValue: any;
|
||||
|
||||
|
||||
// ======= 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 {
|
||||
if (this.hotValue) {
|
||||
return this.hotValue;
|
||||
@ -105,7 +113,7 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
|
||||
return this.transducer.toHot(v);
|
||||
}
|
||||
|
||||
setHotValue(data: any) {
|
||||
setHotValue(data: any, options?: any) {
|
||||
this.hotValue = data;
|
||||
const v = this.transducer.toNative(data);
|
||||
if (this.isUseVariable()) {
|
||||
@ -114,10 +122,16 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
|
||||
type: 'JSExpression',
|
||||
value: ov.value,
|
||||
mock: v,
|
||||
});
|
||||
}, false, false, options);
|
||||
} 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();
|
||||
}
|
||||
|
||||
|
||||
@ -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') {
|
||||
this.parent.setPropValue(this.name, val);
|
||||
}
|
||||
if (!extraOptions) {
|
||||
extraOptions = {};
|
||||
}
|
||||
const { setValue } = this.extraProps;
|
||||
if (setValue) {
|
||||
if (setValue && !extraOptions.disableMutator) {
|
||||
setValue(this, val);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user