Browse Source

REPORT-51244 【10.0.17】复用组件接触点优化 - 功能补充

feature/10.0
kerry 4 years ago
parent
commit
51a80eab8d
  1. 9
      designer-base/src/main/java/com/fr/design/mainframe/ComponentReuseNotifyUtil.java
  2. 3
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  3. 20
      designer-base/src/main/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfo.java
  4. 2
      designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java
  5. 6
      designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java
  6. 12
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java
  7. 7
      designer-form/src/main/java/com/fr/design/mainframe/ReuseTriggerPointManager.java
  8. 70
      designer-form/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java
  9. 2
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java
  10. 1
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java
  11. 12
      designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java

9
designer-base/src/main/java/com/fr/design/mainframe/ComponentReuseNotifyUtil.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe;
import com.fr.design.DesignerEnvManager;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo;
import com.fr.design.mainframe.toast.DesignerToastMsgUtil;
@ -17,11 +18,6 @@ public class ComponentReuseNotifyUtil {
}
public static void enterWidgetLib() {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB);
enterWidgetLibExtraAction();
}
public static void enterWidgetLibExtraAction() {
if (ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib()) {
return;
@ -35,5 +31,8 @@ public class ComponentReuseNotifyUtil {
if (snapChat.hasRead()) {
DesignerToastMsgUtil.toastPrompt(Toolkit.i18nText("Fine-Design_Component_Reuse_Merge_Prompt"));
}
ComponentReuseNotificationInfo.getInstance().setClickedWidgetLib(true);
DesignerEnvManager.getEnvManager().saveXMLFile();
}
}

3
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -942,9 +942,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
if (snapChat != null && !snapChat.hasRead()) {
SnapChatUtil.paintPropertyItemPoint(g, getBounds());
}
}
};
button.setDisabledIcon(IconUtils.readIcon(getIconBaseDir() + btnIconName + ICON_SUFFIX_DISABLED));

20
designer-base/src/main/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfo.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.reuse;
import com.fr.design.DesignerEnvManager;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLable;
import com.fr.stable.xml.XMLableReader;
@ -22,6 +23,8 @@ public class ComponentReuseNotificationInfo implements XMLable {
private boolean clickedWidgetLib = false;
private long lastGuidePopUpTime = 0;
public long getLastNotifyTime() {
return lastNotifyTime;
}
@ -46,11 +49,25 @@ public class ComponentReuseNotificationInfo implements XMLable {
this.clickedWidgetLib = clickedWidgetLib;
}
public long getLastGuidePopUpTime() {
return lastGuidePopUpTime;
}
public void setLastGuidePopUpTime(long lastGuidePopUpTime) {
this.lastGuidePopUpTime = lastGuidePopUpTime;
}
public void updateLastGuidePopUpTime() {
this.setLastGuidePopUpTime(System.currentTimeMillis());
DesignerEnvManager.getEnvManager().saveXMLFile();
}
@Override
public void readXML(XMLableReader reader) {
this.setLastNotifyTime(reader.getAttrAsLong("lastNotifyTime", 0L));
this.setNotifiedNumber(reader.getAttrAsInt("notifiedNumber", 0));
this.setClickedWidgetLib(reader.getAttrAsBoolean("clickedWidgetLib", false));
this.setLastGuidePopUpTime(reader.getAttrAsLong("lastGuidePopUpTime", 0L));
}
@Override
@ -58,7 +75,8 @@ public class ComponentReuseNotificationInfo implements XMLable {
writer.startTAG("ComponentReuseNotificationInfo");
writer.attr("lastNotifyTime", this.lastNotifyTime)
.attr("notifiedNumber", this.notifiedNumber)
.attr("clickedWidgetLib", this.clickedWidgetLib);
.attr("clickedWidgetLib", this.clickedWidgetLib)
.attr("lastGuidePopUpTime", this.lastGuidePopUpTime);
writer.end();
}

2
designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java

@ -18,7 +18,7 @@ import java.awt.Graphics;
public class ComponentTreeCellRenderer extends DefaultTreeCellRenderer {
private boolean needAddShareIcon = false;
private static final Icon SHARE_ICON = BaseUtils.readIcon("/com/fr/design/images/toast/icon_reuse.png");
private static final Icon SHARE_ICON = BaseUtils.readIcon("/com/fr/design/images/toast/reuse_icon.png");
public ComponentTreeCellRenderer() {
}

6
designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java

@ -16,6 +16,7 @@ import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.UserDefinedWidgetConfig;
@ -32,6 +33,7 @@ import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.ArrayUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JSeparator;
@ -244,10 +246,12 @@ public class FormParaWidgetPane extends JPanel {
private JPanel createComponentReuseToolPane() {
JPanel jPanel = new JPanel(new BorderLayout(17, 10));
UILabel uiLabel = new UILabel(BaseUtils.readIcon("/com/fr/design/images/form/designer/widget_apply_icon.png"));
uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 0 ,5, 0));
jPanel.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {
ComponentReuseNotifyUtil.enterWidgetLib();
FormWidgetDetailPane.getInstance().enterWidgetLib();
ComponentCollector.getInstance().collectToolbarJump();
}
@Override

12
designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -23,7 +23,10 @@ import java.util.List;
* Time: 下午8:18
*/
public class FormWidgetDetailPane extends FormDockView{
private static final int ONLINE_TAB = 1;
private JPanel centerPane;
private UIHeadGroup headGroup;
private List<BasicPane> paneList;
public static FormWidgetDetailPane getInstance() {
@ -78,7 +81,7 @@ public class FormWidgetDetailPane extends FormDockView{
paneNames[i] = title;
centerPane.add(paneList.get(i), title);
}
UIHeadGroup headGroup = new UIHeadGroup(paneNames) {
headGroup = new UIHeadGroup(paneNames) {
protected void tabChanged(int newSelectedIndex) {
if (newSelectedIndex == 1) {
ComponentCollector.getInstance().collectMarkerClick();
@ -91,6 +94,7 @@ public class FormWidgetDetailPane extends FormDockView{
this.add(centerPane, BorderLayout.CENTER);
}
/**
* 清除数据
*/
@ -101,6 +105,12 @@ public class FormWidgetDetailPane extends FormDockView{
}
public void enterWidgetLib() {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB);
headGroup.setSelectedIndex(ONLINE_TAB);
ComponentReuseNotifyUtil.enterWidgetLibExtraAction();
}
/**
* 定位
*

7
designer-form/src/main/java/com/fr/design/mainframe/ReuseTriggerPointManager.java

@ -14,6 +14,7 @@ import com.fr.design.mainframe.adaptve.config.impl.CellStyleTriggerPoint;
import com.fr.design.mainframe.adaptve.config.impl.CellValueImageChangeTriggerPoint;
import com.fr.design.mainframe.adaptve.config.ReuseNotifyInfo;
import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.toast.DesignerToastMsgUtil;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
@ -81,7 +82,7 @@ public class ReuseTriggerPointManager {
}
private boolean hasNotifiedTwice() {
public boolean hasNotifiedTwice() {
return ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() >= 2;
}
@ -147,6 +148,7 @@ public class ReuseTriggerPointManager {
JTemplate currentJTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
DesignerToastMsgUtil.toastPrompt(createReusePrompt((JForm) currentJTemplate));
ReuseTriggerPointManager.getInstance().writeTriggerInfo2xml();
ComponentCollector.getInstance().collectPromptJumpWhenShow();
}
}
@ -180,7 +182,8 @@ public class ReuseTriggerPointManager {
@Override
public void mouseClicked(MouseEvent e) {
jForm.tabChanged(0);
ComponentReuseNotifyUtil.enterWidgetLib();
FormWidgetDetailPane.getInstance().enterWidgetLib();
ComponentCollector.getInstance().collectPromptJumpWhenJump();
}
@Override

70
designer-form/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe.share.collect;
import com.fr.base.io.XMLReadHelper;
import com.fr.config.MarketConfig;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo;
import com.fr.form.share.DefaultSharableWidget;
import com.fr.form.share.SharableWidgetProvider;
import com.fr.form.share.constants.ComponentPath;
@ -44,6 +45,12 @@ import java.util.Iterator;
* created by Harrison on 2020/03/25
**/
public class ComponentCollector implements XMLable {
private static final long ONE_MINUTE = 60 * 1000L;
private static final int REUSE_INFO_FIRST_POPUP = 1;
private static final int REUSE_INFO_SECOND_POPUP = 2;
private static final String SIMPLE_DATE_PATTERN = "yyyy-MM-dd";
private static final String XML = "ComponentCollector";
@ -90,8 +97,13 @@ public class ComponentCollector implements XMLable {
private static final String MARKET_CLICK = "marketClick";
private static final String PROMPT_JUMP = "promptJump";
private static final String TOOLBAR_JUMP = "toolbarJump";
private static final String POPUP_JUMP = "popupJump";
private static final String uuid = DesignerEnvManager.getEnvManager().getUUID();
private static ComponentCollector instance;
private int localCmpNumber = 0;
@ -103,6 +115,12 @@ public class ComponentCollector implements XMLable {
private int cmpBoardClick = 0;
private int promptJump = 0;
private int toolbarJump = 0;
private int popupJump = 0;
private JSONArray activateRecord = JSONFactory.createJSON(JSON.ARRAY);
private JSONArray generateCmpRecord = JSONFactory.createJSON(JSON.ARRAY);
@ -314,6 +332,41 @@ public class ComponentCollector implements XMLable {
saveInfo();
}
public void collectPromptJumpWhenJump(){
if (ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() == REUSE_INFO_FIRST_POPUP) {
this.promptJump = 1;
saveInfo();
}else if(ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() == REUSE_INFO_SECOND_POPUP){
this.promptJump = 2;
saveInfo();
}
}
public void collectPromptJumpWhenShow() {
if (ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() == REUSE_INFO_SECOND_POPUP) {
this.promptJump = -1;
saveInfo();
}
}
public void collectToolbarJump() {
if (this.toolbarJump == 0) {
this.toolbarJump = 1;
saveInfo();
}
}
public void collectPopupJump() {
long currentTime = System.currentTimeMillis();
long lastGuidePopUpTime = ComponentReuseNotificationInfo.getInstance().getLastGuidePopUpTime();
if (currentTime - lastGuidePopUpTime <= ONE_MINUTE && this.popupJump == 0) {
this.popupJump = 1;
saveInfo();
}
}
public void clearSortType() {
sortType = JSONFactory.createJSON(JSON.ARRAY);
}
@ -419,6 +472,9 @@ public class ComponentCollector implements XMLable {
this.searchContent = parseJSONArray(reader.getAttrAsString(SEARCH_CONTENT,StringUtils.EMPTY));
this.filterContent = parseJSONArray(reader.getAttrAsString(FILTER_CONTENT, StringUtils.EMPTY));
this.sortType = parseJSONArray(reader.getAttrAsString(SORT_TYPE, StringUtils.EMPTY));
this.promptJump = reader.getAttrAsInt(PROMPT_JUMP, 0);
this.toolbarJump = reader.getAttrAsInt(TOOLBAR_JUMP, 0);
this.popupJump = reader.getAttrAsInt(POPUP_JUMP, 0);
}
}
@ -453,6 +509,9 @@ public class ComponentCollector implements XMLable {
.attr(SEARCH_CONTENT, searchContent.toString())
.attr(FILTER_CONTENT, filterContent.toString())
.attr(SORT_TYPE, sortType.toString())
.attr(PROMPT_JUMP, promptJump)
.attr(TOOLBAR_JUMP, toolbarJump)
.attr(POPUP_JUMP, popupJump)
.end();
}
@ -477,6 +536,15 @@ public class ComponentCollector implements XMLable {
jo.put(SEARCH_CONTENT, searchContent.toString());
jo.put(FILTER_CONTENT, filterContent.toString());
jo.put(SORT_TYPE, sortType.toString());
jo.put("guideInfo", assembleGuideInfo());
return jo.toString();
}
private String assembleGuideInfo() {
JSONObject jo = JSONFactory.createJSON(JSON.OBJECT);
jo.put(PROMPT_JUMP, promptJump)
.put(TOOLBAR_JUMP, toolbarJump)
.put(POPUP_JUMP, popupJump);
return jo.toString();
}

2
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java

@ -13,6 +13,7 @@ import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.WidgetToolBarPane;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.group.ui.GroupMoveDialog;
import com.fr.design.mainframe.share.ui.base.PopupMenuItem;
import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane;
@ -192,6 +193,7 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
return;
}
hidePreview();
ComponentCollector.getInstance().collectPopupJump();
Object source = e.getSource();
Widget creatorSource;
String shareId;

1
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java

@ -123,6 +123,7 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
if (lastPressEvent == null) {
return;
}
ComponentCollector.getInstance().collectPopupJump();
Object source = e.getSource();
Widget creatorSource;
String shareId;

12
designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java

@ -22,12 +22,12 @@ public class InstallComponentHelper {
private static final String PRE_INSTALL_PATH = "/com/fr/form/share/components";
private static final String[] PRE_INSTALL_COMPONENTS = new String[]{
"大屏标题-蓝白.739e7afd-ce1d-40ea-b272-3c96eacc27f8.reu",
"单数据指标卡-绿色.48ea0497-1c7f-4894-a927-0f18fe4d2f27.reu",
"单数据指标卡-蓝色.d158c9d6-66be-410a-8697-47b19a8f9565.reu",
"分类对比竖向仪表板-浅色.a90a7b81-26fd-4461-8a39-ce1c07a16ad0.reu",
"分层雷达图-浅色.d2cd7a40-c14c-4a79-a30e-25d2ba555479.reu",
"进度表格-浅色.8aafad8b-d85c-4921-b45d-1acb4c226ca2.reu"
"单行指标卡.f3df58b3-4302-4cab-ab77-caaf225de60a.reu",
"分层雷达图-深色.49f8397c-e6a6-482a-acc7-46d8cec353a4.reu",
"红绿灯表格-浅色.d0466992-328a-4ccf-ad67-6cbc844d669c.reu",
"进度表格-深色.de4141ce-5c25-4506-9424-f5aa15fbf6d0.reu",
"三列指标卡.61a83d18-a162-4dc3-aa57-3b954edaf82e.reu",
"透明按钮切换图表.e373e13a-3da0-4c29-91bc-9ae804241023.reu"
};
public static void installPreComponent() {

Loading…
Cancel
Save