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