Browse Source

REPORT-9652 优化一下,减少RPC和数据库访问次数

【10.0二轮回归】部署集成-集群-大数据量模板加载时文件夹显示异常
research/10.0
ju 6 years ago
parent
commit
2ae7e2a073
  1. 7
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java

7
designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java

@ -179,6 +179,7 @@ public class TemplateFileTree extends EnvFileTree {
@Override
protected ExpandMutableTreeNode[] loadChildTreeNodes(ExpandMutableTreeNode treeNode) {
FileNode[] fnArray = listFileNodes(treeNode);
return fileNodeArray2TreeNodeArray(fnArray);
@ -189,13 +190,14 @@ public class TemplateFileTree extends EnvFileTree {
*/
private ExpandMutableTreeNode[] fileNodeArray2TreeNodeArray(FileNode[] fileNodes) {
boolean isLocal = WorkContext.getCurrent().isLocal();
boolean isRoot = WorkContext.getCurrent().isRoot();
ExpandMutableTreeNode[] res = new ExpandMutableTreeNode[fileNodes.length];
for (int i = 0; i < res.length; i++) {
FileNode fn = fileNodes[i];
res[i] = new ExpandMutableTreeNode(fn);
if (fn.isDirectory()) {
res[i].add(new ExpandMutableTreeNode());
if (isLocal || WorkContext.getCurrent().isRoot()) {
if (isLocal || isRoot) {
res[i].setFullAuthority(true);
} else {
boolean hasFullAuthority = isContained(fn);
@ -203,7 +205,6 @@ public class TemplateFileTree extends EnvFileTree {
}
}
}
return res;
}
@ -269,6 +270,7 @@ public class TemplateFileTree extends EnvFileTree {
* 求当前TreeNode下所有的FileNode.
*/
private FileNode[] listFileNodes(ExpandMutableTreeNode currentTreeNode) {
if (currentTreeNode == null) {
return new FileNode[0];
}
@ -276,6 +278,7 @@ public class TemplateFileTree extends EnvFileTree {
Object object = currentTreeNode.getUserObject();
if (object instanceof FileNode) {
return this.listFileNodes(((FileNode) object).getEnvPath());
}

Loading…
Cancel
Save