Browse Source

Pull request #9832: REPORT-78617【运营产品化二期】方案分为模板和场景方案,写在显示的是解决方案 REPORT-78612 【运营产品化二期】模板资源默认展示的场景方案以及关键词和运营提供的不符 REPORT-78618 【运营产品化二期】模板商城里搜索页面对应的模板商城应该是蓝色,非灰色 REPORT-78619 【运营产品化二期】二级页面展示缺少导向&支持点击模板商城返回一级页面 REPORT-78621 【运营产品化二期】二级页面所属模板包显示都是null

Merge in DESIGN/design from ~LINK.ZHAO/design:feature/x to feature/x

* commit '6169293529d5bc05dd1a172018f8ef335d5b677b':
  REPORT-78647 【运营产品化二期】单模板目前点击立即使用未下载 1、更换url
  REPORT-75093 运营产品化二期 1、给新接口换个id,不能影响老版本使用
  REPORT-78617【运营产品化二期】方案分为模板和场景方案,写在显示的是解决方案
feature/x
Link.Zhao 2 years ago
parent
commit
aa5a1da743
  1. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java
  2. 11
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/action/StartUseAction.java
  3. 53
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java
  4. 7
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/model/TemplateResourceDetail.java
  5. 9
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/TemplateResourceDetailPane.java
  6. 38
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/TemplateShopPane.java
  7. 20
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java
  8. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/TemplateResourceSearchManager.java

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

@ -81,6 +81,8 @@ public class AlphaFineConstants {
public static final Color WHITE = new Color(0xf9f9f9); public static final Color WHITE = new Color(0xf9f9f9);
public static final Color LABEL_SELECTED = new Color(0x419bf9);
public static final Color GRAY = new Color(0xd2d2d2); public static final Color GRAY = new Color(0xd2d2d2);
public static final Color LIGHT_GRAY = new Color(0xcccccc); public static final Color LIGHT_GRAY = new Color(0xcccccc);
@ -154,7 +156,7 @@ public class AlphaFineConstants {
public static final String ALPHA_PREVIEW = CloudCenter.getInstance().acquireUrlByKind("af.preview"); public static final String ALPHA_PREVIEW = CloudCenter.getInstance().acquireUrlByKind("af.preview");
public static final String ALPHA_CID = CloudCenter.getInstance().acquireUrlByKind("af.cid"); public static final String ALPHA_CID = CloudCenter.getInstance().acquireUrlByKind("af.cid.new");
public static final String ALPHA_CID_USER_GROUP_INFO = CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info"); public static final String ALPHA_CID_USER_GROUP_INFO = CloudCenter.getInstance().acquireUrlByKind("af.cid.user.group.info");

11
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/action/StartUseAction.java

@ -2,7 +2,7 @@ package com.fr.design.mainframe.alphafine.action;
import com.fr.design.mainframe.alphafine.model.TemplateResourceDetail; import com.fr.design.mainframe.alphafine.model.TemplateResourceDetail;
import com.fr.design.mainframe.alphafine.search.helper.FineMarketClientHelper; import com.fr.design.mainframe.alphafine.search.helper.FineMarketClientHelper;
import com.fr.design.utils.BrowseUtils;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -11,6 +11,8 @@ import java.awt.event.ActionListener;
* alphaFine - 模板资源 - 二级界面 - 开始使用按钮的绑定事件 * alphaFine - 模板资源 - 二级界面 - 开始使用按钮的绑定事件
* *
* 点击后跳转至帆软市场下载对应模板资源 * 点击后跳转至帆软市场下载对应模板资源
*
* TODO:可以参考mini组件商城的下载@ComponentsPackageInstallation#install
* */ * */
public class StartUseAction implements ActionListener { public class StartUseAction implements ActionListener {
@ -22,11 +24,6 @@ public class StartUseAction implements ActionListener {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
String url = FineMarketClientHelper.getInstance().getResourceDownloadUrl(resourceDetail.getRoot()); FineMarketClientHelper.getInstance().openBrowserAndDownload(resourceDetail.getRoot());
if (url == null) {
// 如果获取失败,跳转到所有模板页面
url = FineMarketClientHelper.getInstance().getFineMarketTemplateUrl();
}
BrowseUtils.browser(url);
} }
} }

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

@ -156,6 +156,18 @@ public class AlphaFineFrame extends JFrame {
private JPanel tabPane; private JPanel tabPane;
private JPanel labelPane;
private JPanel labelContentPane;
private JPanel labelEastPane;
private JPanel labelWestPane;
private UILabel tabLabel;
private UILabel readLabel;
private SelectedLabel selectedTab; private SelectedLabel selectedTab;
private String beforeSearchStr = StringUtils.EMPTY; private String beforeSearchStr = StringUtils.EMPTY;
@ -422,20 +434,21 @@ public class AlphaFineFrame extends JFrame {
// label区,border layout // label区,border layout
JPanel labelPane = new JPanel(new BorderLayout()); labelPane = new JPanel(new BorderLayout());
labelPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20)); labelPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
labelPane.setBackground(Color.WHITE); labelPane.setBackground(Color.WHITE);
JPanel labelContentPane = new JPanel(new BorderLayout()); labelContentPane = new JPanel(new BorderLayout());
UILabel tabLabel = new UILabel(PRODUCT_NEWS); tabLabel = new UILabel(PRODUCT_NEWS);
tabLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6); tabLabel.setForeground(AlphaFineConstants.FOREGROUND_COLOR_6);
tabLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); tabLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
tabLabel.setPreferredSize(new Dimension(100, 30)); tabLabel.setPreferredSize(new Dimension(60, 30));
JPanel westPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); tabLabel.setForeground(AlphaFineConstants.LABEL_SELECTED);
westPane.add(tabLabel); labelWestPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
labelContentPane.add(westPane, BorderLayout.WEST); labelWestPane.add(tabLabel);
JPanel eastPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0)); labelContentPane.add(labelWestPane, BorderLayout.WEST);
labelEastPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
// 一键已读 // 一键已读
UILabel readLabel = new UILabel(ONE_CLICK_READ); readLabel = new UILabel(ONE_CLICK_READ);
readLabel.setHorizontalAlignment(SwingConstants.RIGHT); readLabel.setHorizontalAlignment(SwingConstants.RIGHT);
readLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));; readLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));;
readLabel.setPreferredSize(new Dimension(100, 30)); readLabel.setPreferredSize(new Dimension(100, 30));
@ -447,8 +460,8 @@ public class AlphaFineFrame extends JFrame {
showPane.repaint(); showPane.repaint();
} }
}); });
eastPane.add(readLabel); labelEastPane.add(readLabel);
labelContentPane.add(eastPane, BorderLayout.EAST); labelContentPane.add(labelEastPane, BorderLayout.EAST);
labelContentPane.setBackground(new Color(245, 245, 247)); labelContentPane.setBackground(new Color(245, 245, 247));
labelPane.add(labelContentPane); labelPane.add(labelContentPane);
labelPane.setPreferredSize(new Dimension(AlphaFineConstants.FULL_SIZE.width, 30)); labelPane.setPreferredSize(new Dimension(AlphaFineConstants.FULL_SIZE.width, 30));
@ -478,6 +491,14 @@ public class AlphaFineFrame extends JFrame {
return showPane; return showPane;
} }
public JPanel getLabelWestPane() {
return labelWestPane;
}
public UILabel getTabLabel() {
return tabLabel;
}
private MouseAdapter createMouseListener(List<SelectedLabel> selectedLabelList, SelectedLabel selectedLabel, private MouseAdapter createMouseListener(List<SelectedLabel> selectedLabelList, SelectedLabel selectedLabel,
JPanel tabPane, UILabel tabLabel, UILabel readLabel) { JPanel tabPane, UILabel tabLabel, UILabel readLabel) {
return new MouseAdapter() { return new MouseAdapter() {
@ -499,6 +520,9 @@ public class AlphaFineFrame extends JFrame {
tabLabel.setText(selectedLabel.getText()); tabLabel.setText(selectedLabel.getText());
} }
// 刷新westlabelpane
refreshLabelPane();
// 将已读设置不可见 // 将已读设置不可见
readLabel.setVisible(false); readLabel.setVisible(false);
@ -562,6 +586,11 @@ public class AlphaFineFrame extends JFrame {
} }
} }
private void refreshLabelPane() {
labelWestPane.removeAll();
labelWestPane.add(tabLabel);
}
private List<SelectedLabel> createSelectedLabelList() { private List<SelectedLabel> createSelectedLabelList() {
List<SelectedLabel> selectedLabelList = new ArrayList<>(); List<SelectedLabel> selectedLabelList = new ArrayList<>();
AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager(); AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager();
@ -832,6 +861,7 @@ public class AlphaFineFrame extends JFrame {
} }
private void doSearch(String text) { private void doSearch(String text) {
refreshLabelPane();
initSearchLoadingPane(); initSearchLoadingPane();
SearchTextBean searchTextBean = generateSearchTextBean(text); SearchTextBean searchTextBean = generateSearchTextBean(text);
this.productNewsSearchWorkerManager.doSearch(searchTextBean); this.productNewsSearchWorkerManager.doSearch(searchTextBean);
@ -954,6 +984,7 @@ public class AlphaFineFrame extends JFrame {
@Override @Override
public void setVisible(boolean b) { public void setVisible(boolean b) {
super.setVisible(b); super.setVisible(b);
switchTab(selectedTab.getCellType(), readLabel);
QuestionWindow.getInstance().setVisible(!b); QuestionWindow.getInstance().setVisible(!b);
if (!b) { if (!b) {
AlphaFineHelper.resetAlphaFineDialog(); AlphaFineHelper.resetAlphaFineDialog();

7
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/model/TemplateResourceDetail.java

@ -6,6 +6,7 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.TemplateResourceSea
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -104,7 +105,11 @@ public class TemplateResourceDetail {
} }
public void setParentPkgName(String parentPkgName) { public void setParentPkgName(String parentPkgName) {
this.parentPkgName = parentPkgName; if (StringUtils.isEmpty(parentPkgName)) {
this.parentPkgName = "";
} else {
this.parentPkgName = parentPkgName;
}
} }
public String getResourceUrl() { public String getResourceUrl() {

9
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/TemplateResourceDetailPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.alphafine.preview; package com.fr.design.mainframe.alphafine.preview;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.alphafine.action.StartUseAction; import com.fr.design.mainframe.alphafine.action.StartUseAction;
@ -8,7 +9,6 @@ import com.fr.design.mainframe.alphafine.model.TemplateResourceDetail;
import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.BrowseUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
@ -93,8 +93,9 @@ public class TemplateResourceDetailPane extends JPanel {
operatePane = new JPanel(new FlowLayout(FlowLayout.LEFT)); operatePane = new JPanel(new FlowLayout(FlowLayout.LEFT));
JLabel emptyLabel = new JLabel(); JLabel emptyLabel = new JLabel();
emptyLabel.setPreferredSize(new Dimension(115, 25)); emptyLabel.setPreferredSize(new Dimension(140, 25));
JLabel priceLabel = new JLabel(); JLabel priceLabel = new JLabel();
priceLabel.setForeground(Color.RED);
if (data.getPrice() == 0) { if (data.getPrice() == 0) {
priceLabel.setText(FREE); priceLabel.setText(FREE);
} else { } else {
@ -128,8 +129,8 @@ public class TemplateResourceDetailPane extends JPanel {
BrowseUtils.browser(url); BrowseUtils.browser(url);
} }
JButton createStartUseButton() { UIButton createStartUseButton() {
JButton starUseButton = new JButton(START_USE); UIButton starUseButton = new UIButton(START_USE);
starUseButton.addActionListener(new StartUseAction(data)); starUseButton.addActionListener(new StartUseAction(data));
return starUseButton; return starUseButton;
} }

38
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/TemplateShopPane.java

@ -1,6 +1,8 @@
package com.fr.design.mainframe.alphafine.preview; package com.fr.design.mainframe.alphafine.preview;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.component.TemplateResourcePageGridPane; import com.fr.design.mainframe.alphafine.component.TemplateResourcePageGridPane;
import com.fr.design.mainframe.alphafine.model.TemplateResource; import com.fr.design.mainframe.alphafine.model.TemplateResource;
import com.fr.design.mainframe.alphafine.model.TemplateResourceDetail; import com.fr.design.mainframe.alphafine.model.TemplateResourceDetail;
@ -11,6 +13,8 @@ import com.fr.third.apache.logging.log4j.util.Strings;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import java.awt.CardLayout; import java.awt.CardLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.List; import java.util.List;
public class TemplateShopPane extends JPanel { public class TemplateShopPane extends JPanel {
@ -26,7 +30,7 @@ public class TemplateShopPane extends JPanel {
public static final String DETAIL_PANEL = "detailPane"; public static final String DETAIL_PANEL = "detailPane";
public static final String LOADING_PANEL = "loadingPane"; public static final String LOADING_PANEL = "loadingPane";
private String currentCard = Strings.EMPTY; private String currentCard = Strings.EMPTY;
private static final String SLASH = "/";
private CardLayout cardLayout = new CardLayout(); private CardLayout cardLayout = new CardLayout();
private JPanel defaultPagePane; private JPanel defaultPagePane;
@ -71,6 +75,9 @@ public class TemplateShopPane extends JPanel {
// 打开二级页面,显示详细信息 // 打开二级页面,显示详细信息
public void searchAndShowDetailPane(TemplateResource resource) { public void searchAndShowDetailPane(TemplateResource resource) {
changeLabel(resource.getName());
switchCard(LOADING_PANEL); switchCard(LOADING_PANEL);
new SwingWorker<TemplateResourceDetail, Void>() { new SwingWorker<TemplateResourceDetail, Void>() {
@ -99,6 +106,35 @@ public class TemplateShopPane extends JPanel {
} }
private void changeLabel(String resourceName) {
JPanel labelNamePane = AlphaFineHelper.getAlphaFineDialog().getLabelWestPane();
UILabel tabLabel = AlphaFineHelper.getAlphaFineDialog().getTabLabel();
tabLabel.setForeground(AlphaFineConstants.DARK_GRAY);
UILabel slash = new UILabel(SLASH);
slash.setForeground(AlphaFineConstants.DARK_GRAY);
UILabel resourceLabel = new UILabel(resourceName);
resourceLabel.setForeground(AlphaFineConstants.LABEL_SELECTED);
labelNamePane.add(slash);
labelNamePane.add(resourceLabel);
tabLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
switchCard(PAGE_PANEL);
tabLabel.setForeground(AlphaFineConstants.LABEL_SELECTED);
labelNamePane.remove(slash);
labelNamePane.remove(resourceLabel);
}
});
}
// 方便埋点,勿删 // 方便埋点,勿删
public String getCurrentCard() { public String getCurrentCard() {
return currentCard; return currentCard;

20
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/helper/FineMarketClientHelper.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.alphafine.search.helper; package com.fr.design.mainframe.alphafine.search.helper;
import com.fr.design.mainframe.alphafine.model.TemplateResource; import com.fr.design.mainframe.alphafine.model.TemplateResource;
import com.fr.design.utils.BrowseUtils;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.http.HttpToolbox; import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
@ -19,8 +20,9 @@ public class FineMarketClientHelper {
return INSTANCE; return INSTANCE;
} }
public static final String FINE_MARKET_TEMPLATE_INFO = CloudCenter.getInstance().acquireUrlByKind("market.template.info", "https://market.fanruan.com/templates/"); public static final String FINE_MARKET_TEMPLATE_INFO = CloudCenter.getInstance().acquireUrlByKind("market.template.info");
public static final String FINE_MARKET_TEMPLATE_URL = CloudCenter.getInstance().acquireUrlByKind("market.template.url", "https://market.fanruan.com/template/"); public static final String FINE_MARKET_TEMPLATE_URL = CloudCenter.getInstance().acquireUrlByKind("market.template.url");
public static final String LOGIN_FINE_CLUB_AND_REDIRECT_SHOP = CloudCenter.getInstance().acquireUrlByKind("af.login.redirect.market");
public static final String FILE_DOWNLOAD = "file/"; public static final String FILE_DOWNLOAD = "file/";
public static final String PACKAGE_DOWNLOAD = "package/download/"; public static final String PACKAGE_DOWNLOAD = "package/download/";
public static final String TEMPLATES_PARENT_PACKAGE = "parent/"; public static final String TEMPLATES_PARENT_PACKAGE = "parent/";
@ -51,11 +53,21 @@ public class FineMarketClientHelper {
} }
public void openBrowserAndDownload(TemplateResource templateResource) {
String url = LOGIN_FINE_CLUB_AND_REDIRECT_SHOP;
if (TemplateResource.Type.SCENARIO_SOLUTION.equals(templateResource.getType())) {
url += getPackageDownloadUrl(templateResource.getId());
} else {
url += getFileDownLoadUrl(templateResource.getId());
}
BrowseUtils.browser(url);
}
/** /**
* 打开浏览器打包并下载模板资源包可能会很慢 * 暂时没有package的下载接口需要用户在浏览器点击下载
* */ * */
private String getPackageDownloadUrl(String id) { private String getPackageDownloadUrl(String id) {
return FINE_MARKET_TEMPLATE_INFO + PACKAGE_DOWNLOAD + id; return getTemplateUrlById(id);
} }
/** /**

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

@ -43,7 +43,7 @@ public class TemplateResourceSearchManager {
if (resourceList.isEmpty()) { if (resourceList.isEmpty()) {
List<TemplateResource> localResource = getEmbedResourceList(); List<TemplateResource> localResource = getEmbedResourceList();
localResource.stream().forEach(resource->{ localResource.stream().forEach(resource->{
if (resource.getName().contains(searchText)) { if (resource.getName().toLowerCase().contains(searchText)) {
resourceList.add(resource); resourceList.add(resource);
} }
}); });
@ -81,7 +81,7 @@ public class TemplateResourceSearchManager {
public List<String> getRecommendSearchKeys() { public List<String> getRecommendSearchKeys() {
List<String> searchKey = new ArrayList<>(); List<String> searchKey = new ArrayList<>();
String[] keys = CloudCenter.getInstance().acquireConf("alphafine.tempalte.recommend", "库存,指标,可视化").split(","); String[] keys = CloudCenter.getInstance().acquireConf("alphafine.tempalte.recommend", "跑马灯,填报,地图").split(",");
for (String k : keys) { for (String k : keys) {
searchKey.add(k); searchKey.add(k);
} }

Loading…
Cancel
Save