mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-23 09:58:12 +00:00
Merge branch 'fix/lihao-bugs-200824' into 'release/0.9.12'
Fix/lihao bugs 200824 See merge request !946640
This commit is contained in:
commit
bff76191e1
@ -33,7 +33,7 @@ export class DocumentModel {
|
|||||||
/**
|
/**
|
||||||
* 根节点 类型有:Page/Component/Block
|
* 根节点 类型有:Page/Component/Block
|
||||||
*/
|
*/
|
||||||
readonly rootNode: RootNode;
|
rootNode: RootNode | null;
|
||||||
/**
|
/**
|
||||||
* 文档编号
|
* 文档编号
|
||||||
*/
|
*/
|
||||||
@ -461,12 +461,16 @@ export class DocumentModel {
|
|||||||
* 从项目中移除
|
* 从项目中移除
|
||||||
*/
|
*/
|
||||||
remove() {
|
remove() {
|
||||||
|
this.purge();
|
||||||
this.project.removeDocument(this);
|
this.project.removeDocument(this);
|
||||||
// todo: ...
|
this.designer.postEvent('document.remove', { id: this.id });
|
||||||
}
|
}
|
||||||
|
|
||||||
purge() {
|
purge() {
|
||||||
// todo:
|
this.rootNode?.purge();
|
||||||
|
this.nodes.clear();
|
||||||
|
this._nodesMap.clear();
|
||||||
|
this.rootNode = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkNesting(dropTarget: ParentalNode, dragObject: DragNodeObject | DragNodeDataObject): boolean {
|
checkNesting(dropTarget: ParentalNode, dragObject: DragNodeObject | DragNodeDataObject): boolean {
|
||||||
|
|||||||
@ -699,11 +699,11 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
|||||||
if (this.purged) {
|
if (this.purged) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this._parent) {
|
// if (this._parent) {
|
||||||
// should remove thisNode before purge
|
// // should remove thisNode before purge
|
||||||
this.remove(useMutator);
|
// this.remove(useMutator);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
this.purged = true;
|
this.purged = true;
|
||||||
if (this.isParental()) {
|
if (this.isParental()) {
|
||||||
this.children.purge(useMutator);
|
this.children.purge(useMutator);
|
||||||
@ -711,8 +711,8 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
|||||||
this.autoruns?.forEach((dispose) => dispose());
|
this.autoruns?.forEach((dispose) => dispose());
|
||||||
this.props.purge();
|
this.props.purge();
|
||||||
this.document.internalRemoveAndPurgeNode(this);
|
this.document.internalRemoveAndPurgeNode(this);
|
||||||
|
|
||||||
this.document.destroyNode(this);
|
this.document.destroyNode(this);
|
||||||
|
this.remove(useMutator);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -65,6 +65,11 @@ export class Prop implements IPropParent {
|
|||||||
export(stage: TransformStage = TransformStage.Save): CompositeValue | UNSET {
|
export(stage: TransformStage = TransformStage.Save): CompositeValue | UNSET {
|
||||||
const type = this._type;
|
const type = this._type;
|
||||||
|
|
||||||
|
// 在设计器里,所有组件都需要展示
|
||||||
|
if (stage === TransformStage.Render && this.key === '___condition___') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (type === 'unset') {
|
if (type === 'unset') {
|
||||||
// return UNSET; @康为 之后 review 下这块改造
|
// return UNSET; @康为 之后 review 下这块改造
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|||||||
@ -54,6 +54,9 @@ export class TreeMaster {
|
|||||||
time: (endTime - startTime).toFixed(2),
|
time: (endTime - startTime).toFixed(2),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
designer.editor.on('designer.document.remove', ({ id }) => {
|
||||||
|
this.treeMap.delete(id);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private toVision() {
|
private toVision() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user