Browse Source

REPORT-75093 运营产品化二期

pr修改
feature/x
Link.Zhao 2 years ago
parent
commit
4931a23c40
  1. 11
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchPane.java
  2. 28
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/TemplateResourcePanel.java
  3. 37
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/TemplateResourceSearchWorkerManager.java

11
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchPane.java

@ -18,12 +18,12 @@ public class RecommendSearchPane extends TemplateResourcePanel {
public RecommendSearchPane(TemplateResource templateResource) { public RecommendSearchPane(TemplateResource templateResource) {
super(); super();
this.templateResource = templateResource; setTemplateResource(templateResource);
initComponent(); initComponent();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createLineBorder(new Color(0xe8e8e9), 1)); this.setBorder(BorderFactory.createLineBorder(new Color(0xe8e8e9), 1));
this.add(northPane, BorderLayout.NORTH); this.add(getNorthPane(), BorderLayout.NORTH);
this.add(southPane, BorderLayout.SOUTH); this.add(getSouthPane(), BorderLayout.SOUTH);
} }
private void initComponent() { private void initComponent() {
@ -33,12 +33,13 @@ public class RecommendSearchPane extends TemplateResourcePanel {
private void createSouthPane() { private void createSouthPane() {
southPane = new JPanel(new FlowLayout(FlowLayout.LEFT)); setSouthPane(new JPanel(new FlowLayout(FlowLayout.LEFT)));
JPanel southPane = getSouthPane();
southPane.setBackground(Color.WHITE); southPane.setBackground(Color.WHITE);
JLabel recommend = new JLabel(Toolkit.i18nText("Fine-Design_Report_AlphaFine_Template_Resource_Recommend_For_You")); JLabel recommend = new JLabel(Toolkit.i18nText("Fine-Design_Report_AlphaFine_Template_Resource_Recommend_For_You"));
southPane.add(recommend); southPane.add(recommend);
List<String> searchKeys = templateResource.getRecommendSearchKey(); List<String> searchKeys = getTemplateResource().getRecommendSearchKey();
for (String key : searchKeys) { for (String key : searchKeys) {
JLabel keyLabel = new SearchKeyLabel(key); JLabel keyLabel = new SearchKeyLabel(key);

28
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/TemplateResourcePanel.java

@ -18,9 +18,9 @@ import java.awt.event.MouseEvent;
public class TemplateResourcePanel extends JPanel { public class TemplateResourcePanel extends JPanel {
protected JPanel northPane; private JPanel northPane;
protected JPanel southPane; private JPanel southPane;
protected TemplateResource templateResource; private TemplateResource templateResource;
protected TemplateResourcePanel() { protected TemplateResourcePanel() {
@ -54,6 +54,28 @@ public class TemplateResourcePanel extends JPanel {
} }
} }
public JPanel getNorthPane() {
return northPane;
}
public JPanel getSouthPane() {
return southPane;
}
public TemplateResource getTemplateResource() {
return templateResource;
}
public void setNorthPane(JPanel northPane) {
this.northPane = northPane;
}
public void setSouthPane(JPanel southPane) {
this.southPane = southPane;
}
public void setTemplateResource(TemplateResource templateResource) {
this.templateResource = templateResource;
}
private void initComponent() { private void initComponent() {
createNorthPane(); createNorthPane();
createSouthPane(); createSouthPane();

37
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/TemplateResourceSearchWorkerManager.java

@ -22,7 +22,7 @@ public class TemplateResourceSearchWorkerManager implements SearchManager {
private AlphaFineFrame alphaFineFrame; private AlphaFineFrame alphaFineFrame;
private volatile boolean hasSearchResult = true; private volatile boolean searchResult = true;
private volatile boolean searchOver = false; private volatile boolean searchOver = false;
@ -58,37 +58,36 @@ public class TemplateResourceSearchWorkerManager implements SearchManager {
if (!isCancelled()) { if (!isCancelled()) {
try { try {
List<TemplateResource> list = get(); List<TemplateResource> list = get();
hasSearchResult = !list.isEmpty(); searchResult = !list.isEmpty();
showResult(list); showResult(list);
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
} }
};
this.searchWorker.execute();
}
void showResult(List<TemplateResource> list) { void showResult(List<TemplateResource> list) {
if (networkError && !hasSearchResult) { if (networkError && !searchResult) {
alphaFineFrame.showResult(AlphaFineConstants.NETWORK_ERROR); alphaFineFrame.showResult(AlphaFineConstants.NETWORK_ERROR);
return; return;
} }
if (alphaFineFrame.getSelectedType() == cellType) { if (alphaFineFrame.getSelectedType() == cellType) {
if (!hasSearchResult) { if (!searchResult) {
alphaFineFrame.showResult(CellType.NO_RESULT.getFlagStr4None()); alphaFineFrame.showResult(CellType.NO_RESULT.getFlagStr4None());
} else { } else {
TemplateShopPane.getInstance().refreshPagePane(list); TemplateShopPane.getInstance().refreshPagePane(list);
AlphaFineHelper.getAlphaFineDialog().showResult(cellType.getFlagStr4None()); AlphaFineHelper.getAlphaFineDialog().showResult(cellType.getFlagStr4None());
}
}
} }
}
};
this.searchWorker.execute();
} }
@Override @Override
public boolean hasSearchResult() { public boolean hasSearchResult() {
return hasSearchResult; return searchResult;
} }
@Override @Override

Loading…
Cancel
Save