mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 09:41:57 +00:00
fix: VC-Filter组件的适配问题
This commit is contained in:
parent
20fcfe6b29
commit
1f581b81f6
@ -132,6 +132,7 @@ export class NodeChildren {
|
||||
}
|
||||
|
||||
this.emitter.emit('change');
|
||||
this.reportModified(node, this.owner, { type: 'insert' });
|
||||
|
||||
// check condition group
|
||||
if (node.conditionGroup) {
|
||||
@ -288,24 +289,48 @@ export class NodeChildren {
|
||||
return;
|
||||
}
|
||||
this.purged = true;
|
||||
this.children.forEach(child => child.purge());
|
||||
this.children.forEach((child) => child.purge());
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
// 保证向前兼容性
|
||||
return "Array";
|
||||
return 'Array';
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* 为了兼容vision体系存量api
|
||||
*/
|
||||
getChildrenArray() {
|
||||
return this.children;
|
||||
}
|
||||
|
||||
private reportModified(node: Node, owner: Node, options = {}) {
|
||||
if (!node) { return; }
|
||||
if (node.isRoot()) { return; }
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
if (node.isRoot()) {
|
||||
return;
|
||||
}
|
||||
const callbacks = owner.componentMeta.getMetadata().experimental?.callbacks;
|
||||
if (callbacks?.onSubtreeModified) {
|
||||
callbacks?.onSubtreeModified.call(node, owner, options);
|
||||
try {
|
||||
callbacks?.onSubtreeModified.call(node, owner, options);
|
||||
} catch (e) {
|
||||
console.error('error when excute experimental.callbacks.onNodeAdd', e);
|
||||
}
|
||||
}
|
||||
|
||||
if (callbacks?.onNodeAdd && options?.type === 'insert') {
|
||||
try {
|
||||
callbacks?.onNodeAdd.call(owner, node, owner);
|
||||
} catch (e) {
|
||||
console.error('error when excute experimental.callbacks.onNodeAdd', e);
|
||||
}
|
||||
}
|
||||
|
||||
if (owner.parent && !owner.parent.isRoot()) {
|
||||
this.reportModified(node, owner.parent, options);
|
||||
this.reportModified(node, owner.parent, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -329,4 +329,16 @@ export class Props implements IPropParent {
|
||||
setPropValue(path: string, value: any) {
|
||||
this.getProp(path, true)!.setValue(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* 兼容vision体系
|
||||
*/
|
||||
getNode() {
|
||||
const nodeForVision = this.owner;
|
||||
nodeForVision.getChildren = () => {
|
||||
return this.owner?.getChildren()?.getChildrenArray() || [];
|
||||
};
|
||||
return nodeForVision;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user