Browse Source

Merge pull request #7514 in DESIGN/design from feature/10.0 to feature/big-screen

* commit '3cbc7775503c1025f094d1e702584b83aaf68171':
  REPORT-65475 AlphaFine搜索慢
feature/big-screen
superman 3 years ago
parent
commit
4ea95448dd
  1. 18
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java

18
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java

@ -11,10 +11,14 @@ import com.fr.design.mainframe.alphafine.cell.model.MoreModel;
import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.model.SearchResult;
import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.file.filetree.FileNodes;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
/** /**
@ -74,7 +78,12 @@ public class FileSearchManager implements AlphaFineSearchProvider {
return lessModelList; return lessModelList;
} }
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
fileNodes = FRContext.getFileNodes().list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true); fileNodes = WorkContext.getCurrent().get(FileNodes.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
return FRContext.getFileNodes().list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true);
}
}).list(ProjectConstants.REPORTLETS_NAME, AlphaFineConstants.FILE_EXTENSIONS, true, false);
isContainCpt = true; isContainCpt = true;
isContainFrm = true; isContainFrm = true;
doSearch(this.searchText); doSearch(this.searchText);
@ -128,7 +137,12 @@ public class FileSearchManager implements AlphaFineSearchProvider {
*/ */
private void doFileContentSearch(String searchText) { private void doFileContentSearch(String searchText) {
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent()) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainFileContent()) {
FileNode[] fileNodes = FRContext.getFileNodes().filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true); FileNode[] fileNodes = WorkContext.getCurrent().get(FileNodes.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
return FRContext.getFileNodes().filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true);
}
}).filterFiles(searchText, ProjectConstants.REPORTLETS_NAME, new FileExtension[]{FileExtension.CPT, FileExtension.FRM}, true, false);
for (FileNode node : fileNodes) { for (FileNode node : fileNodes) {
FileModel model = new FileModel(node.getName(), node.getEnvPath()); FileModel model = new FileModel(node.getName(), node.getEnvPath());
if (!AlphaFineHelper.getFilterResult().contains(model) && !filterModelList.contains(model)) { if (!AlphaFineHelper.getFilterResult().contains(model) && !filterModelList.contains(model)) {

Loading…
Cancel
Save