Browse Source

Merge pull request #14237 in DESIGN/design from bugfix/11.0 to feature/x

* commit '358fa060a307cf73545591dc4e47e1309d03f8b0':
  REPORT-125241 fix:修复模板从内层目录移动到最外层目录时显示异常问题
  REPORT-127241 设计器性能埋点字段调整
  REPORT-117002 设计器性能埋点监控 调整代码
  REPORT-117002 设计器性能埋点监控 调整代码
  无jira 打包问题
  REPORT-77878 fix: fvs插件-表格默认字体颜色是白色,但是右键清除单元格格式,字体会变为黑色
  REPORT-70155 fix: fvs根据主题样式创建默认单元格
  REPORT-123532 控件字体样式设置不生效 【问题原因】设计器端修改字体样式后,没有修改对象中属性值 【改动思路】修改对象属性值
feature/x
superman 4 months ago
parent
commit
924d0846e4
  1. 37
      designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java
  2. 4
      designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java
  3. 2
      designer-form/src/main/java/com/fr/design/widgettheme/ParaEditorSettingPane.java
  4. 17
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java
  5. 3
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

37
designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java

@ -1,7 +1,5 @@
package com.fr.design.carton.latency;
import com.fanruan.third.v2.org.ehcache.impl.internal.concurrent.ConcurrentHashMap;
import com.fr.concurrent.FineExecutors;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.config.MarketConfig;
import com.fr.design.DesignerEnvManager;
@ -10,15 +8,19 @@ import com.fr.design.mainframe.SiteCenterToken;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.general.CloudCenter;
import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
@ -44,11 +46,13 @@ import static com.fr.design.carton.CartonConstants.USERID;
*/
public class DesignerLatencyMetric {
private String latencyUrl;
private ExecutorService executorService;
private ScheduledExecutorService scheduler;
private static final Map<LatencyLevel, AtomicInteger> LATENCY_CONTAINER = new ConcurrentHashMap<>();
private static final String LATENCY_INFO_URL = "https://cloud.fanruan.com/api/monitor/record_of_deisgner_latency/single";
private static final String DEFAULT_MONITOR_URL = "https://cloud.fanruan.com/api/monitor/";
private static final String LATENCY_TABLE_SUFFIX = "record_of_designer_latency/single";
private final static class InstanceHolder {
static final DesignerLatencyMetric INSTANCE = new DesignerLatencyMetric();
@ -72,11 +76,10 @@ public class DesignerLatencyMetric {
// 初始化容器
initializeContainer();
// 启动异步性能记录线程池
executorService = FineExecutors.newCachedThreadPool(
new NamedThreadFactory(DesignerLatencyMetric.class));
executorService = Executors.newFixedThreadPool(8);
// 启动定时埋点
this.scheduler = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("LatencyMetricWorker"));
this.scheduler.scheduleWithFixedDelay(this::collectAndSubmit, 60, 60, TimeUnit.SECONDS);
this.scheduler.scheduleWithFixedDelay(this::collectAndSubmit, 60, 60, TimeUnit.MINUTES);
// 注册设计器工作目录切换事件监听
EventDispatcher.listen(WorkspaceEvent.AfterSwitch, new Listener<Workspace>() {
@Override
@ -84,6 +87,7 @@ public class DesignerLatencyMetric {
collectAndSubmit();
}
});
FineLoggerFactory.getLogger().info("[Latency] designer latency metric started.");
}
}
@ -99,9 +103,19 @@ public class DesignerLatencyMetric {
this.scheduler.shutdown();
}
collectAndSubmit();
FineLoggerFactory.getLogger().info("[Latency] designer latency metric stopped.");
}
}
private String getLatencyUrl() {
if (StringUtils.isEmpty(latencyUrl)) {
String monitorEntry = CloudCenter.getInstance().acquireUrlByKind("cloud.monitor.api.entrypoint");
latencyUrl = (StringUtils.isNotEmpty(monitorEntry) ? monitorEntry : DEFAULT_MONITOR_URL)
+ LATENCY_TABLE_SUFFIX;
}
return latencyUrl;
}
private void initializeContainer() {
for (LatencyLevel level : LatencyLevel.values()) {
LATENCY_CONTAINER.put(level, new AtomicInteger());
@ -134,9 +148,10 @@ public class DesignerLatencyMetric {
para.put("token", SiteCenterToken.generateToken());
para.put("content", collect());
try {
HttpToolbox.post(LATENCY_INFO_URL, para);
} catch (Throwable ignore) {
// doNothing
HttpToolbox.post(getLatencyUrl(), para);
FineLoggerFactory.getLogger().debug("[Latency] submit latency log to cloud.");
} catch (Throwable t) {
FineLoggerFactory.getLogger().debug(t,"[Latency] failed to submit latency log to cloud.");
}
resetContainer();
}
@ -151,7 +166,9 @@ public class DesignerLatencyMetric {
info.put(DESIGN_METHOD, WorkContext.getCurrent().isLocal() ? LOCAL : REMOTE);
info.put(OPERANDS_NUM, LATENCY_CONTAINER.values().stream().mapToInt(AtomicInteger::get).sum());
for (Map.Entry<LatencyLevel, AtomicInteger> entry : LATENCY_CONTAINER.entrySet()) {
info.put(entry.getKey().getMark(), entry.getValue().get());
if (!LatencyLevel.UNDEFINE.equals(entry.getKey())) {
info.put(entry.getKey().getMark(), entry.getValue().get());
}
}
return info;
}

4
designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java

@ -421,7 +421,9 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
dialog.setVisible(true);
DesignerFrameFileDealerPane.getInstance().getSelectedOperation().refresh();
LocateAction.gotoEditingTemplateLeaf(targetFile);
SwingUtilities.invokeLater(() -> {
LocateAction.gotoEditingTemplateLeaf(targetFile);
});
}
}

2
designer-form/src/main/java/com/fr/design/widgettheme/ParaEditorSettingPane.java

@ -41,6 +41,7 @@ public class ParaEditorSettingPane<T extends Widget> extends EditorSettingPane<T
fontColorButton.setColor(textStyle.getFontColor());
bold.setSelected(textStyle.isBold());
italic.setSelected(textStyle.isItalic());
fontNameSelectBox.setSelectedItem(textStyle.getName());
}
@Override
@ -51,6 +52,7 @@ public class ParaEditorSettingPane<T extends Widget> extends EditorSettingPane<T
textStyle.setFontColor(fontColorButton.getColor());
textStyle.setBold(bold.isSelected());
textStyle.setItalic(italic.isSelected());
textStyle.setName((String) fontNameSelectBox.getSelectedItem());
paraEditorTheme.setTextStyle(textStyle);
}

17
designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java

@ -6,20 +6,21 @@ import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.form.FormECBackgroundAction;
import com.fr.design.actions.form.FormECColumnsAction;
import com.fr.design.actions.form.FormECFrozenAction;
import com.fr.design.designer.creator.XElementCase;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.fit.NewUIModeCellElementPainter;
import com.fr.design.fit.common.FormDesignerUtil;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.mainframe.*;
import com.fr.design.mainframe.cell.QuickEditorRegion;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.form.fit.common.LightTool;
import com.fr.form.main.Form;
import com.fr.grid.Grid;
@ -27,6 +28,7 @@ import com.fr.grid.GridColumn;
import com.fr.grid.GridCorner;
import com.fr.grid.GridRow;
import com.fr.page.ReportSettingsProvider;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.worksheet.FormElementCase;
import com.fr.design.selection.SelectionEvent;
@ -34,7 +36,6 @@ import com.fr.design.selection.SelectionListener;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.Insets;
import java.awt.Rectangle;
/**
@ -69,6 +70,16 @@ public class FormElementCasePaneDelegate extends ElementCasePane<FormElementCase
}
}
});
// fvs根据主题样式创建默认单元格
if (DesignModeContext.isDuchampMode()) {
sheet.setDefaultCellElementSupplier(() -> {
DefaultTemplateCellElement defaultTemplateCellElement = DefaultThemedTemplateCellElementCase.createInstance();
// fvs调整单元格默认样式
AdjustWorkBookDefaultStyleUtils.adjustCellElement(defaultTemplateCellElement);
return defaultTemplateCellElement;
});
}
}
private Rectangle getBoundsLineRect(TemplateElementCase elementCase) {

3
designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

@ -32,6 +32,7 @@ import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.theme.utils.DefaultThemedTemplateCellElementCase;
import com.fr.design.report.RowColumnPane;
import com.fr.design.selection.QuickEditor;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.grid.GridUtils;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
@ -562,6 +563,8 @@ public class CellSelection extends Selection {
for (int i = 0; i < removeElementList.size(); i++) {
CellElement element = removeElementList.get(i);
element.setStyle(null);
// fvs调整单元格默认样式
AdjustWorkBookDefaultStyleUtils.adjustCellElement(element);
}
break;

Loading…
Cancel
Save