diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java index 5dfedc2662..cb3de24929 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java @@ -397,7 +397,11 @@ public class TemplateTreePane extends JPanel implements FileOperations { if (paths == null) { reportletsTree.refresh(); } else { - for (TreePath path : Objects.requireNonNull(reportletsTree.getSelectionPaths())) { + // 删除一个节点的情况下,默认选中为该节点的上一级节点 + if (paths.length == 1 && paths[0].getParentPath() != null) { + reportletsTree.setSelectionPath(paths[0].getParentPath()); + } + for (TreePath path : Objects.requireNonNull(paths)) { reportletsTree.refreshParent(path); } }