mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-12 17:08:14 +00:00
fix: 修复指定了 focusNodeSelector 后, 模态节点在大纲树没有展示
This commit is contained in:
parent
dc207aef72
commit
f9895ccbe2
@ -78,7 +78,7 @@ export default class Panel implements IWidget {
|
||||
|
||||
private container?: WidgetContainer<Panel, PanelConfig>;
|
||||
|
||||
private parent?: WidgetContainer;
|
||||
@obx.ref private parent?: WidgetContainer;
|
||||
|
||||
constructor(readonly skeleton: Skeleton, readonly config: PanelConfig) {
|
||||
makeObservable(this);
|
||||
|
||||
@ -28,8 +28,8 @@ export default class TreeNode {
|
||||
return this.node.zLevel;
|
||||
}
|
||||
|
||||
isRoot() {
|
||||
return this.tree.root === this;
|
||||
isRoot(includeOriginalRoot = false) {
|
||||
return this.tree.root === this || (includeOriginalRoot && this.tree.document.rootNode === this.node);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -60,7 +60,7 @@ export default class TreeNode {
|
||||
@obx.ref private _expanded = false;
|
||||
|
||||
get expanded(): boolean {
|
||||
return this.isRoot() || (this.expandable && this._expanded);
|
||||
return this.isRoot(true) || (this.expandable && this._expanded);
|
||||
}
|
||||
|
||||
setExpanded(value: boolean) {
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { Component } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { observer } from '@ali/lowcode-editor-core';
|
||||
import { ModalNodesManager } from '@ali/lowcode-designer';
|
||||
import TreeNode from '../tree-node';
|
||||
import TreeTitle from './tree-title';
|
||||
import TreeBranches from './tree-branches';
|
||||
import { ModalNodesManager } from '@ali/lowcode-designer';
|
||||
import { IconEyeClose } from '../icons/eye-close';
|
||||
|
||||
@observer
|
||||
@ -24,7 +24,9 @@ class ModalTreeNodeView extends Component<{ treeNode: TreeNode }> {
|
||||
|
||||
render() {
|
||||
const { treeNode } = this.props;
|
||||
const modalNodes = treeNode.children?.filter((item) => {
|
||||
// 当指定了新的根节点时,要从原始的根节点去获取模态节点
|
||||
const rootTreeNode = treeNode.tree.getTreeNode(treeNode.document.rootNode!);
|
||||
const modalNodes = rootTreeNode.children?.filter((item) => {
|
||||
return item.node.componentMeta.isModal;
|
||||
});
|
||||
if (!modalNodes || modalNodes.length === 0) {
|
||||
@ -44,7 +46,7 @@ class ModalTreeNodeView extends Component<{ treeNode: TreeNode }> {
|
||||
</div>
|
||||
</div>
|
||||
<div className="tree-pane-modal-content">
|
||||
<TreeBranches treeNode={treeNode} isModal />
|
||||
<TreeBranches treeNode={rootTreeNode} isModal />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user