mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 09:41:57 +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
|
||||
*/
|
||||
readonly rootNode: RootNode;
|
||||
rootNode: RootNode | null;
|
||||
/**
|
||||
* 文档编号
|
||||
*/
|
||||
@ -461,12 +461,16 @@ export class DocumentModel {
|
||||
* 从项目中移除
|
||||
*/
|
||||
remove() {
|
||||
this.purge();
|
||||
this.project.removeDocument(this);
|
||||
// todo: ...
|
||||
this.designer.postEvent('document.remove', { id: this.id });
|
||||
}
|
||||
|
||||
purge() {
|
||||
// todo:
|
||||
this.rootNode?.purge();
|
||||
this.nodes.clear();
|
||||
this._nodesMap.clear();
|
||||
this.rootNode = null;
|
||||
}
|
||||
|
||||
checkNesting(dropTarget: ParentalNode, dragObject: DragNodeObject | DragNodeDataObject): boolean {
|
||||
|
||||
@ -679,7 +679,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
|
||||
/**
|
||||
* 删除一个节点
|
||||
* @param node
|
||||
* @param node
|
||||
*/
|
||||
removeChild(node: Node) {
|
||||
this.children?.delete(node);
|
||||
@ -699,11 +699,11 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
if (this.purged) {
|
||||
return;
|
||||
}
|
||||
if (this._parent) {
|
||||
// should remove thisNode before purge
|
||||
this.remove(useMutator);
|
||||
return;
|
||||
}
|
||||
// if (this._parent) {
|
||||
// // should remove thisNode before purge
|
||||
// this.remove(useMutator);
|
||||
// return;
|
||||
// }
|
||||
this.purged = true;
|
||||
if (this.isParental()) {
|
||||
this.children.purge(useMutator);
|
||||
@ -711,8 +711,8 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
this.autoruns?.forEach((dispose) => dispose());
|
||||
this.props.purge();
|
||||
this.document.internalRemoveAndPurgeNode(this);
|
||||
|
||||
this.document.destroyNode(this);
|
||||
this.remove(useMutator);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -862,7 +862,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
if (this.parent) {
|
||||
return this.parent.getSuitablePlace(node, ref);
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
|
||||
@ -65,6 +65,11 @@ export class Prop implements IPropParent {
|
||||
export(stage: TransformStage = TransformStage.Save): CompositeValue | UNSET {
|
||||
const type = this._type;
|
||||
|
||||
// 在设计器里,所有组件都需要展示
|
||||
if (stage === TransformStage.Render && this.key === '___condition___') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (type === 'unset') {
|
||||
// return UNSET; @康为 之后 review 下这块改造
|
||||
return undefined;
|
||||
|
||||
@ -54,6 +54,9 @@ export class TreeMaster {
|
||||
time: (endTime - startTime).toFixed(2),
|
||||
});
|
||||
});
|
||||
designer.editor.on('designer.document.remove', ({ id }) => {
|
||||
this.treeMap.delete(id);
|
||||
});
|
||||
}
|
||||
|
||||
private toVision() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user