Browse Source

Merge pull request #286 in DESIGN/design from ~JU/design:release/10.0 to release/10.0

* commit '2ae7e2a073619cca9fce3df9eea8eed5c85bd408':
  REPORT-9652 优化一下,减少RPC和数据库访问次数 【10.0二轮回归】部署集成-集群-大数据量模板加载时文件夹显示异常
final/10.0
ju 7 years ago
parent
commit
473ee99e45
  1. 9
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java

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

@ -179,8 +179,9 @@ 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