mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-14 21:12:53 +00:00
fix prop getValue
This commit is contained in:
commit
99d1962748
@ -74,7 +74,7 @@ export default class Prop implements IPropParent {
|
||||
|
||||
if (type === 'list') {
|
||||
if (!this._items) {
|
||||
return this._items;
|
||||
return this._value;
|
||||
}
|
||||
return this.items!.map(prop => {
|
||||
const v = prop.export(serialize);
|
||||
@ -172,8 +172,12 @@ export default class Prop implements IPropParent {
|
||||
this.dispose();
|
||||
}
|
||||
|
||||
getValue(serialize = true) {
|
||||
// todo:
|
||||
@computed getValue(): CompositeValue {
|
||||
const v = this.export(true);
|
||||
if (v === UNSET) {
|
||||
return null;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
private dispose() {
|
||||
|
||||
@ -31,12 +31,14 @@ export default class EventsSetter extends Component<{
|
||||
selectType: null,
|
||||
nativeEventList: [],
|
||||
lifeCycleEventList: [],
|
||||
eventDataList: [],
|
||||
eventDataList: this.props.value || [],
|
||||
isShowEventDialog: false,
|
||||
bindEventName: '',
|
||||
relatedEventName: '',
|
||||
};
|
||||
|
||||
// TODO: getDerivedStateFromProps recieve eventDataList from prop.value
|
||||
|
||||
componentWillMount() {
|
||||
this.initEventBtns();
|
||||
this.initEventList();
|
||||
@ -239,10 +241,7 @@ export default class EventsSetter extends Component<{
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.props.onChange(eventDataList);
|
||||
// field.setValue(eventDataList);
|
||||
|
||||
|
||||
this.closeDialog();
|
||||
};
|
||||
|
||||
@ -455,7 +455,7 @@ export class SettingsMain implements SettingTarget {
|
||||
if (this.nodes.length < 1) {
|
||||
return null;
|
||||
}
|
||||
return this.nodes[0].getProp(propName, false)?.value;
|
||||
return this.nodes[0].getProp(propName, true)?.getValue();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -471,7 +471,7 @@ export class SettingsMain implements SettingTarget {
|
||||
if (this.nodes.length < 1) {
|
||||
return null;
|
||||
}
|
||||
return this.nodes[0].getExtraProp(propName, false)?.value;
|
||||
return this.nodes[0].getExtraProp(propName, false)?.getValue();
|
||||
}
|
||||
|
||||
setExtraPropValue(propName: string, value: any) {
|
||||
|
||||
@ -417,17 +417,14 @@ registerMetadataTransducer(metadata => {
|
||||
},
|
||||
},
|
||||
|
||||
getValue(field: SettingField, val?: any[]) {
|
||||
getValue(field: SettingField, val?:any[]) {
|
||||
return val;
|
||||
|
||||
let data = field.parent.getPropValue('eventDataList');
|
||||
return data;
|
||||
},
|
||||
|
||||
setValue(field: SettingField, eventDataList: any[]) {
|
||||
return;
|
||||
|
||||
console.info(eventDataList);
|
||||
field.parent.setPropValue('eventDataList', eventDataList);
|
||||
// console.info(eventDataList);
|
||||
// field.parent.setPropValue('eventDataList', eventDataList);
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user