Browse Source

Pull request #8679: REPORT-67417 运营产品v1.0 补充一些内容

Merge in DESIGN/design from ~HADES/design:feature/x to feature/x

* commit '6b3f2f46f58a2fb0360f0569f72e3200025da2b8':
  REPORT-67417 运营产品v1.0 补充一些内容
feature/x
Hades 3 years ago
parent
commit
34c5592826
  1. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java
  2. 30
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
  3. 19
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java
  4. 30
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java

@ -140,6 +140,8 @@ public class AlphaFineConstants {
public static final String ALPHA_CID = CloudCenter.getInstance().acquireUrlByKind("af.cid"); public static final String ALPHA_CID = CloudCenter.getInstance().acquireUrlByKind("af.cid");
public static final String ALPHA_HELP_RECOMMEND = CloudCenter.getInstance().acquireUrlByKind("af.recommend");
public static final String JAVASCRIPT_PREFIX = "javascript:SendJava"; public static final String JAVASCRIPT_PREFIX = "javascript:SendJava";
public static final String CHINESE_CHARACTERS = "[\\u4e00-\\u9fa5]"; public static final String CHINESE_CHARACTERS = "[\\u4e00-\\u9fa5]";

30
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java

@ -30,6 +30,10 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.ProductNewsSearchMa
import com.fr.design.mainframe.alphafine.search.manager.impl.SegmentationManager; import com.fr.design.mainframe.alphafine.search.manager.impl.SegmentationManager;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.json.JSON;
import com.fr.json.JSONArray;
import com.fr.json.JSONFactory;
import com.fr.json.JSONObject;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
@ -319,11 +323,7 @@ public class AlphaFineFrame extends JFrame {
readLabel.addMouseListener(new MouseAdapter() { readLabel.addMouseListener(new MouseAdapter() {
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
List<ProductNews> productNewsList = ProductNewsSearchManager.getInstance().getCachedProductNewsList(); fireOneClickRead();
Set<Long> readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet();
for (ProductNews productNews : productNewsList) {
readSet.add(productNews.getId());
}
showPane.repaint(); showPane.repaint();
} }
}); });
@ -403,15 +403,21 @@ public class AlphaFineFrame extends JFrame {
return showPane; return showPane;
} }
// todo 暂无 先做测试 private void fireOneClickRead() {
List<ProductNews> productNewsList = ProductNewsSearchManager.getInstance().getCachedProductNewsList();
Set<Long> readSet = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().getReadSet();
for (ProductNews productNews : productNewsList) {
readSet.add(productNews.getId());
}
}
private Map<String, String> generateMap() { private Map<String, String> generateMap() {
JSONArray jsonArray = JSONFactory.createJSON(JSON.ARRAY, AlphaFineConstants.ALPHA_HELP_RECOMMEND);
Map<String, String> linkMap = new LinkedHashMap<>(); Map<String, String> linkMap = new LinkedHashMap<>();
linkMap.put("test", "https://www.baidu.com"); for (int i = 0, len = jsonArray.size(); i < len; i++) {
linkMap.put("test1", "https://www.baidu.com"); JSONObject json = jsonArray.getJSONObject(i);
linkMap.put("test2", "https://www.baidu.com"); linkMap.put(json.getString("name"), json.getString("link"));
linkMap.put("test3", "https://www.baidu.com"); }
linkMap.put("test4", "https://www.baidu.com");
linkMap.put("test5", "https://www.baidu.com");
return linkMap; return linkMap;
} }

19
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/HelpDocumentNoResultPane.java

@ -3,17 +3,14 @@ package com.fr.design.mainframe.alphafine.preview;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.BrowseUtils;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import com.fr.log.FineLoggerFactory;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Desktop;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.GridLayout; import java.awt.GridLayout;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.io.IOException;
import java.net.URI;
import java.util.Map; import java.util.Map;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
@ -69,11 +66,7 @@ public class HelpDocumentNoResultPane extends JPanel {
listLabel.addMouseListener(new MouseAdapter() { listLabel.addMouseListener(new MouseAdapter() {
@Override @Override
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
try { responseClick(link);
Desktop.getDesktop().browse(URI.create(link));
} catch (IOException exception) {
FineLoggerFactory.getLogger().error(exception.getMessage(), exception);
}
} }
}); });
@ -90,5 +83,13 @@ public class HelpDocumentNoResultPane extends JPanel {
return listPane; return listPane;
} }
/**
* 方便记录埋点
*
* @param link
*/
private void responseClick(String link) {
BrowseUtils.browser(link);
}
} }

30
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/NoResultWithLinkPane.java

@ -2,11 +2,14 @@ package com.fr.design.mainframe.alphafine.preview;
import com.fr.design.dialog.link.MessageWithLink; import com.fr.design.dialog.link.MessageWithLink;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.utils.BrowseUtils;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
/** /**
* 带跳转链接的无结果面板 * 带跳转链接的无结果面板
@ -28,8 +31,33 @@ public class NoResultWithLinkPane extends NoResultPane {
protected Component generateDescription(String title) { protected Component generateDescription(String title) {
String[] para1 = title.split(TAG_A_START); String[] para1 = title.split(TAG_A_START);
String[] para2 = para1[1].split(TAG_A_END); String[] para2 = para1[1].split(TAG_A_END);
MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineConstants.ALPHA_GO_TO_FORUM, para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont().applySize(14), AlphaFineConstants.MEDIUM_GRAY);
MessageWithLink messageWithLink = new MessageWithLink(para1[0], para2[0], AlphaFineConstants.ALPHA_GO_TO_FORUM, para2[1], Color.WHITE, DesignUtils.getDefaultGUIFont().applySize(14), AlphaFineConstants.MEDIUM_GRAY) {
@Override
protected void initListener(String link) {
addHyperlinkListener(new HyperlinkListener() {
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
jumpToForum(link);
}
}
});
}
};
messageWithLink.setBorder(BorderFactory.createEmptyBorder(0, AlphaFineConstants.LEFT_WIDTH - 30, 135, 0)); messageWithLink.setBorder(BorderFactory.createEmptyBorder(0, AlphaFineConstants.LEFT_WIDTH - 30, 135, 0));
return messageWithLink; return messageWithLink;
} }
/**
* 方便记录埋点
*
* @param link
*/
private void jumpToForum(String link) {
BrowseUtils.browser(link);
}
} }

Loading…
Cancel
Save