mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-18 13:28:24 +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.emitter.emit('change');
|
||||||
|
this.reportModified(node, this.owner, { type: 'insert' });
|
||||||
|
|
||||||
// check condition group
|
// check condition group
|
||||||
if (node.conditionGroup) {
|
if (node.conditionGroup) {
|
||||||
@ -288,20 +289,44 @@ export class NodeChildren {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.purged = true;
|
this.purged = true;
|
||||||
this.children.forEach(child => child.purge());
|
this.children.forEach((child) => child.purge());
|
||||||
}
|
}
|
||||||
|
|
||||||
get [Symbol.toStringTag]() {
|
get [Symbol.toStringTag]() {
|
||||||
// 保证向前兼容性
|
// 保证向前兼容性
|
||||||
return "Array";
|
return 'Array';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
* 为了兼容vision体系存量api
|
||||||
|
*/
|
||||||
|
getChildrenArray() {
|
||||||
|
return this.children;
|
||||||
}
|
}
|
||||||
|
|
||||||
private reportModified(node: Node, owner: Node, options = {}) {
|
private reportModified(node: Node, owner: Node, options = {}) {
|
||||||
if (!node) { return; }
|
if (!node) {
|
||||||
if (node.isRoot()) { return; }
|
return;
|
||||||
|
}
|
||||||
|
if (node.isRoot()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const callbacks = owner.componentMeta.getMetadata().experimental?.callbacks;
|
const callbacks = owner.componentMeta.getMetadata().experimental?.callbacks;
|
||||||
if (callbacks?.onSubtreeModified) {
|
if (callbacks?.onSubtreeModified) {
|
||||||
|
try {
|
||||||
callbacks?.onSubtreeModified.call(node, owner, options);
|
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()) {
|
if (owner.parent && !owner.parent.isRoot()) {
|
||||||
|
|||||||
@ -329,4 +329,16 @@ export class Props implements IPropParent {
|
|||||||
setPropValue(path: string, value: any) {
|
setPropValue(path: string, value: any) {
|
||||||
this.getProp(path, true)!.setValue(value);
|
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