mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 17:08:14 +00:00
feat: change reducer stage
This commit is contained in:
parent
17c6ed3e31
commit
c2e83c7cdc
@ -108,6 +108,8 @@ hotkey.bind(['command+c', 'ctrl+c', 'command+x', 'ctrl+x'], (e, action) => {
|
||||
const componentsMap = {};
|
||||
const componentsTree = selected.map((item) => item.export(TransformStage.Save));
|
||||
|
||||
// FIXME: clear node.id
|
||||
|
||||
const data = { type: 'nodeSchema', componentsMap, componentsTree };
|
||||
|
||||
clipboard.setData(data);
|
||||
|
||||
@ -483,7 +483,7 @@ export class DocumentModel {
|
||||
|
||||
// add toData
|
||||
toData() {
|
||||
const node = this.project?.currentDocument?.export(TransformStage.Serilize);
|
||||
const node = this.project?.currentDocument?.export(TransformStage.Save);
|
||||
return { componentsTree: [node] };
|
||||
}
|
||||
|
||||
|
||||
@ -486,9 +486,9 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
componentName: this.componentName,
|
||||
};
|
||||
|
||||
if (stage !== TransformStage.Save) {
|
||||
// if (stage !== TransformStage.Save) {
|
||||
baseSchema.id = this.id;
|
||||
}
|
||||
// }
|
||||
|
||||
if (this.isLeaf()) {
|
||||
baseSchema.children = this.props.get('children')?.export(stage);
|
||||
|
||||
@ -261,19 +261,6 @@ export function upgradePropConfig(config: OldPropConfig, collector: ConfigCollec
|
||||
} else if (hidden != null || disabled != null) {
|
||||
extraProps.condition = (field: Field) => !(isHidden(field) || isDisabled(field));
|
||||
}
|
||||
if (ignore != null || disabled != null) {
|
||||
// FIXME! addFilter
|
||||
extraProps.virtual = (field: Field) => {
|
||||
if (isDisabled(field)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (typeof ignore === 'function') {
|
||||
return ignore.call(field, field.getValue()) === true;
|
||||
}
|
||||
return ignore === true;
|
||||
};
|
||||
}
|
||||
|
||||
if (type === 'group') {
|
||||
newConfig.items = items ? upgradeConfigure(items, collector) : [];
|
||||
|
||||
@ -58,7 +58,7 @@ function filterReducer(props: any, node: Node): any {
|
||||
}
|
||||
return props;
|
||||
}
|
||||
designer.addPropsReducer(filterReducer, TransformStage.Serilize);
|
||||
designer.addPropsReducer(filterReducer, TransformStage.Save);
|
||||
designer.addPropsReducer(filterReducer, TransformStage.Render);
|
||||
|
||||
function upgradePropsReducer(props: any) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user