mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 17:08:14 +00:00
Merge branch 'release/1.0.63' of gitlab.alibaba-inc.com:ali-lowcode/ali-lowcode-engine into release/1.0.63
This commit is contained in:
commit
14fc9c3dcc
@ -156,7 +156,11 @@ hotkey.bind(['command+v', 'ctrl+v'], (e) => {
|
||||
if (!target) {
|
||||
return;
|
||||
}
|
||||
const nodes = insertChildren(target, componentsTree, index);
|
||||
let canAddComponentsTree = componentsTree.filter((i) => {
|
||||
return doc.checkNestingUp(target, i);
|
||||
});
|
||||
if (canAddComponentsTree.length === 0) return;
|
||||
const nodes = insertChildren(target, canAddComponentsTree, index);
|
||||
if (nodes) {
|
||||
doc.selection.selectAll(nodes.map((o) => o.id));
|
||||
setTimeout(() => designer.activeTracker.track(nodes[0]), 10);
|
||||
|
||||
@ -122,6 +122,7 @@ export class NodeChildren {
|
||||
* 删除一个节点
|
||||
*/
|
||||
delete(node: Node, purge = false, useMutator = true, options: NodeRemoveOptions = {}): boolean {
|
||||
node.internalPurgeStart();
|
||||
if (node.isParental()) {
|
||||
foreachReverse(node.children, (subNode: Node) => {
|
||||
subNode.remove(useMutator, purge, options);
|
||||
@ -150,7 +151,7 @@ export class NodeChildren {
|
||||
document.destroyNode(node);
|
||||
this.emitter.emit('change');
|
||||
if (useMutator) {
|
||||
this.reportModified(node, this.owner, { type: 'remove', removeIndex: i, removeNode: node });
|
||||
this.reportModified(node, this.owner, { type: 'remove', propagated: false, isSubDeleting: this.owner.isPurging, removeIndex: i, removeNode: node });
|
||||
}
|
||||
// purge 为 true 时,已在 internalSetParent 中删除了子节点
|
||||
if (i > -1 && !purge) {
|
||||
@ -200,7 +201,9 @@ export class NodeChildren {
|
||||
if (globalContext.has('editor')) {
|
||||
globalContext.get('editor').emit('node.add', { node });
|
||||
}
|
||||
// this.reportModified(node, this.owner, { type: 'insert' });
|
||||
if (useMutator) {
|
||||
this.reportModified(node, this.owner, { type: 'insert' });
|
||||
}
|
||||
|
||||
// check condition group
|
||||
if (node.conditionGroup) {
|
||||
@ -367,14 +370,6 @@ export class NodeChildren {
|
||||
return 'Array';
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @deprecated
|
||||
// * 为了兼容vision体系存量api
|
||||
// */
|
||||
// getChildrenArray() {
|
||||
// return this.children;
|
||||
// }
|
||||
|
||||
private reportModified(node: Node, owner: Node, options = {}) {
|
||||
if (!node) {
|
||||
return;
|
||||
@ -392,7 +387,7 @@ export class NodeChildren {
|
||||
}
|
||||
|
||||
if (owner.parent && !owner.parent.isRoot()) {
|
||||
this.reportModified(node, owner.parent, options);
|
||||
this.reportModified(node, owner.parent, { ...options, propagated: true, });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -834,6 +834,18 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
// this.document.destroyNode(this);
|
||||
}
|
||||
|
||||
private purging: boolean = false;
|
||||
internalPurgeStart() {
|
||||
this.purging = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否正在销毁
|
||||
*/
|
||||
get isPurging() {
|
||||
return this.purging;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否可执行某action
|
||||
*/
|
||||
|
||||
@ -25,7 +25,11 @@ class Contents extends Component<{ area: Area }> {
|
||||
const { area } = this.props;
|
||||
const top: any[] = [];
|
||||
const bottom: any[] = [];
|
||||
area.container.items.forEach((item) => {
|
||||
area.container.items.sort((a, b) => {
|
||||
const index1 = a.config?.index || 0;
|
||||
const index2 = b.config?.index || 0;
|
||||
return index1 === index2 ? 0 : (index1 > index2 ? 1 : -1);
|
||||
}).forEach((item) => {
|
||||
const content = <div key={`left-area-${item.name}`}>{item.content}</div>;
|
||||
if (item.align === 'bottom') {
|
||||
bottom.push(content);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user