From b28939592ea72e48680d9abcb4509da2d94ac8b4 Mon Sep 17 00:00:00 2001 From: Tommy Date: Wed, 8 Dec 2021 11:31:46 +0800 Subject: [PATCH 01/12] =?UTF-8?q?REPORT-63505=20=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81=E5=90=8E?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=BB=84=E4=BB=B6=E9=A2=84=E8=A7=88=E5=9B=BE?= =?UTF-8?q?=E4=B8=8D=E6=B8=B2=E6=9F=93=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/action/CreateComponentAction.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java index 1baac868ff..8d2adceb84 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java @@ -10,7 +10,9 @@ import com.fr.data.impl.NameTableData; import com.fr.data.impl.TableDataDictionary; import com.fr.design.actions.UpdateAction; import com.fr.design.data.DesignTableDataManager; +import com.fr.design.designer.creator.XChartEditor; import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XWTitleLayout; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; @@ -33,6 +35,7 @@ import com.fr.form.ui.ChartEditor; import com.fr.form.ui.DataControl; import com.fr.form.ui.DictionaryContainer; import com.fr.form.ui.ElementCaseEditor; +import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.Widget; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; @@ -56,6 +59,7 @@ import javax.swing.Action; import javax.swing.UIManager; import java.awt.Color; import java.awt.Component; +import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Rectangle; @@ -253,6 +257,17 @@ public class CreateComponentAction extends UpdateAction { BufferedImage im = new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_ARGB); comp.paint(im.getGraphics()); + if (comp instanceof XWTitleLayout) { + XCreator body = ((XWTitleLayout) comp).getBodyCreator(); + if (body instanceof XChartEditor) { + XChartEditor chartEditor = (XChartEditor) body; + Dimension size = chartEditor.getSize(); + BufferedImage chartImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB); + PaddingMargin margin = chartEditor.toData().getMargin(); + chartEditor.getDesignerEditor().paintEditor(chartImage.getGraphics(), size, margin); + im.getGraphics().drawImage(chartImage, 0, chartEditor.getY(), null); + } + } return im; } From b927d0263d42229b111ed6915420701f7a8f91a5 Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 8 Dec 2021 17:08:57 +0800 Subject: [PATCH 02/12] =?UTF-8?q?CHART-22213=20fix:=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=AD=A6=E6=88=92=E7=BA=BF=20=E9=BB=98=E8=AE=A4=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E6=98=AF9px12px=20=E4=B8=8D=E6=98=AF9px?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/config/DefaultStyleConstants.java | 26 +++++------ .../chart/config/DefaultStyleHelper4Van.java | 45 ++++++++++++++----- 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java index 6d0de41cee..4cbba62906 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java +++ b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java @@ -18,35 +18,35 @@ import java.awt.Font; * Created by shine on 2021/6/25 */ public class DefaultStyleConstants { - static final FRFont TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.BOLD, 14, new Color(241, 246, 255)); - static final FRFont LEGEND = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191)); + static final FRFont TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.BOLD, 19, new Color(241, 246, 255)); + static final FRFont LEGEND = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(159, 173, 191)); - static final FRFont AXIS_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191)); - static final FRFont AXIS_TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(200, 211, 228)); + static final FRFont AXIS_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(159, 173, 191)); + static final FRFont AXIS_TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(200, 211, 228)); static final Color AXIS_LINE = new Color(46, 75, 102); static final Color GRID_LINE = new Color(30, 55, 78); - static final FRFont ALERT_FONT = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(255, 0, 0)); + static final FRFont ALERT_FONT = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(255, 0, 0)); - static final FRFont DATA_SHEET = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191)); + static final FRFont DATA_SHEET = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(159, 173, 191)); static final Color DATA_SHEET_BORDER = new Color(46, 75, 102); static final Color BORDER = Color.BLACK; static final int BORDER_WIDTH = Constants.LINE_NONE; static final int SPECIAL_BORDER_WIDTH = Constants.LINE_THIN; - static final FRFont PIE_CATEGORY_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 10, new Color(232, 232, 232)); + static final FRFont PIE_CATEGORY_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 13, new Color(232, 232, 232)); static final Color GAUGE_PANE_BACK_COLOR = null; static final Color GAUGE_HINGE = null; static final Color GAUGE_PANE_BACK_COLOR_4_RING = new Color(72, 73, 79); static final Color GAUGE_SLOT_BACKGROUND_COLOR = new Color(72, 73, 79); private static final String FONT_NAME = ChartBaseUtils.getLocalDefaultFont("verdana"); - static final FRFont THERMOMETER_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.BOLD, 9, new Color(232, 232, 232));//试管仪表盘标签的默认样式 - static final FRFont THERMOMETER_AXIS_LABEL = FRFont.getInstance(FONT_NAME, Font.PLAIN, 8, new Color(159, 173, 191)); + static final FRFont THERMOMETER_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.BOLD, 12, new Color(232, 232, 232));//试管仪表盘标签的默认样式 + static final FRFont THERMOMETER_AXIS_LABEL = FRFont.getInstance(FONT_NAME, Font.PLAIN, 11, new Color(159, 173, 191)); static final FRFont RING_VALUE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, ChartConstants.AUTO_FONT_SIZE, new Color(232, 232, 232));//百分比圆环仪表盘值标签的默认样式 static final FRFont POINTER_VALUE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, ChartConstants.AUTO_FONT_SIZE, new Color(232, 232, 232));//多指针仪表盘值标签的默认样式 - static final FRFont POINTER_CATE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, 10, new Color(232, 232, 232));//多指针仪表盘分类标签的默认样式 + static final FRFont POINTER_CATE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, 13, new Color(232, 232, 232));//多指针仪表盘分类标签的默认样式 static final Color MAP_NULL_VALUE_COLOR = new Color(168, 168, 168); static final Color MAP_BORDER = Color.BLACK; @@ -56,12 +56,6 @@ public class DefaultStyleConstants { static final Color DRILL_MAP_DRILL_TOOLS_BACK = Color.BLACK; static final float DRILL_MAP_DRILL_TOOLS_BACK_OPACITY = 0.8f; - //todo vancharts - private static final Color GANTT_OUT_LINE = GRID_LINE; - private static final FRFont GANTT_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 8, new Color(217, 217, 217)); - private static final Color GANTT_BORDER_LINE = new Color(30, 36, 58); - private static final Color GAUGE_TICK = new Color(39, 49, 71); - static final Background BACK = null; static String COLORS = null; diff --git a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java index d6fc30bd5d..31694433ff 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java +++ b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java @@ -1,5 +1,7 @@ package com.fr.van.chart.config; +import com.fr.base.ChartColorMatching; +import com.fr.base.ChartPreStyleConfig; import com.fr.chart.base.AttrBorder; import com.fr.chart.base.AttrFillStyle; import com.fr.chart.base.ChartConstants; @@ -28,8 +30,17 @@ import com.fr.plugin.chart.type.GaugeStyle; */ public class DefaultStyleHelper4Van { + private static boolean duchampMode() { + try { + return ChartEditContext.duchampMode(); + } catch (Throwable e) { + //tomcat预览 默认数据的图表 + return true; + } + } + public static void dealVanPlot4Custom(VanChartPlot plot, CustomPlotType customPlotType) { - if (!ChartEditContext.duchampMode()) { + if (!duchampMode()) { return; } dealVanPlotCommonAttr(plot); @@ -60,7 +71,7 @@ public class DefaultStyleHelper4Van { } public static VanChartAxis dealAxisDefault(VanChartAxis axis) { - if (!ChartEditContext.duchampMode()) { + if (!duchampMode()) { return axis; } axis.getTitle().getTextAttr().setFRFont(DefaultStyleConstants.AXIS_TITLE); @@ -71,28 +82,38 @@ public class DefaultStyleHelper4Van { } public static void dealAxisAlert(VanChartAlertValue vanChartAlertValue) { - if (!ChartEditContext.duchampMode()) { + if (!duchampMode()) { return; } vanChartAlertValue.setAlertFont(DefaultStyleConstants.ALERT_FONT); } static void dealVanPlotCommonAttr(Plot plot) { - if (!ChartEditContext.duchampMode()) { + if (!duchampMode()) { return; } if (plot instanceof VanChartPlot) { VanChartPlot vanChartPlot = (VanChartPlot) plot; - ColorFillStyle colorFillStyle = new ColorFillStyle(); - colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC); - colorFillStyle.setFillStyleName(DefaultStyleConstants.COLORS); - AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle(); - if (plotFillStyle == null) { - plotFillStyle = new AttrFillStyle(); - vanChartPlot.setPlotFillStyle(plotFillStyle); + ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance(); + Object preStyle = manager.getPreStyle(DefaultStyleConstants.COLORS); + if (preStyle instanceof ChartColorMatching) { + ColorFillStyle colorFillStyle = new ColorFillStyle(); + //default是默认的意思,为服务器默认配色方案 + //acc为多个颜色组合 + //gradient为渐变颜色 + colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC); + colorFillStyle.setFillStyleName(DefaultStyleConstants.COLORS); + colorFillStyle.setColorList(((ChartColorMatching) preStyle).getColorList()); + + AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle(); + if (plotFillStyle == null) { + plotFillStyle = new AttrFillStyle(); + vanChartPlot.setPlotFillStyle(plotFillStyle); + } + plotFillStyle.setColorFillStyle(colorFillStyle); } - plotFillStyle.setColorFillStyle(colorFillStyle); + if (vanChartPlot.getLegend() != null) { vanChartPlot.getLegend().setFRFont(DefaultStyleConstants.LEGEND); From 4f62f88149dace31c3bf6fd84cd2fcd714217979 Mon Sep 17 00:00:00 2001 From: Tommy Date: Mon, 13 Dec 2021 11:48:34 +0800 Subject: [PATCH 03/12] =?UTF-8?q?REPORT-63505=20=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81=E5=90=8E?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=BB=84=E4=BB=B6=E9=A2=84=E8=A7=88=E5=9B=BE?= =?UTF-8?q?=E4=B8=8D=E6=B8=B2=E6=9F=93=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/action/CreateComponentAction.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java index 1baac868ff..8d2adceb84 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java @@ -10,7 +10,9 @@ import com.fr.data.impl.NameTableData; import com.fr.data.impl.TableDataDictionary; import com.fr.design.actions.UpdateAction; import com.fr.design.data.DesignTableDataManager; +import com.fr.design.designer.creator.XChartEditor; import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XWTitleLayout; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; @@ -33,6 +35,7 @@ import com.fr.form.ui.ChartEditor; import com.fr.form.ui.DataControl; import com.fr.form.ui.DictionaryContainer; import com.fr.form.ui.ElementCaseEditor; +import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.Widget; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; @@ -56,6 +59,7 @@ import javax.swing.Action; import javax.swing.UIManager; import java.awt.Color; import java.awt.Component; +import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Rectangle; @@ -253,6 +257,17 @@ public class CreateComponentAction extends UpdateAction { BufferedImage im = new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_ARGB); comp.paint(im.getGraphics()); + if (comp instanceof XWTitleLayout) { + XCreator body = ((XWTitleLayout) comp).getBodyCreator(); + if (body instanceof XChartEditor) { + XChartEditor chartEditor = (XChartEditor) body; + Dimension size = chartEditor.getSize(); + BufferedImage chartImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_ARGB); + PaddingMargin margin = chartEditor.toData().getMargin(); + chartEditor.getDesignerEditor().paintEditor(chartImage.getGraphics(), size, margin); + im.getGraphics().drawImage(chartImage, 0, chartEditor.getY(), null); + } + } return im; } From e103647723b3a40d9fe94d21aabb8ee7acec4593 Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 15 Dec 2021 17:32:25 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/app/DesignerAppUtilsTest.java | 41 ++++++++----------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/designer-realize/src/test/java/com/fr/design/mainframe/app/DesignerAppUtilsTest.java b/designer-realize/src/test/java/com/fr/design/mainframe/app/DesignerAppUtilsTest.java index 46aa574e90..f47d18d34a 100644 --- a/designer-realize/src/test/java/com/fr/design/mainframe/app/DesignerAppUtilsTest.java +++ b/designer-realize/src/test/java/com/fr/design/mainframe/app/DesignerAppUtilsTest.java @@ -3,15 +3,11 @@ package com.fr.design.mainframe.app; import com.fr.invoke.Reflect; import com.fr.plugin.context.PluginMarker; import com.fr.plugin.context.PluginMarkerAdapter; -import com.fr.plugin.engine.remote.PluginRemoteSync; import com.fr.stable.TemplateIOErrorContextHolder; import com.fr.third.guava.collect.Multimap; -import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; -import org.powermock.api.easymock.PowerMock; -import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import java.util.Collection; @@ -24,13 +20,12 @@ import java.util.HashSet; * Created by vito on 2021/5/31 */ @RunWith(PowerMockRunner.class) -@PrepareForTest({PluginRemoteSync.class}) public class DesignerAppUtilsTest { @Test public void testDealWithErrorDetailMultiLineAndCache() { TemplateIOErrorContextHolder.registerPluginNameMap(new HashMap() {{ put("2", "好用的插件"); - }},new HashSet<>()); + }}, new HashSet<>()); TemplateIOErrorContextHolder.addNeedEnablePlugin(PluginMarkerAdapter.create("1", "1.0", "1插件")); TemplateIOErrorContextHolder.addNeedInstallPlugin(PluginMarker.create("2", "1.0")); TemplateIOErrorContextHolder.addNeedInstallPlugin(PluginMarker.create("3", "1.0")); @@ -47,7 +42,7 @@ public class DesignerAppUtilsTest { public void testInvalidatePlugins() { TemplateIOErrorContextHolder.registerPluginNameMap(new HashMap() {{ put("2", "好用的插件"); - }},new HashSet<>()); + }}, new HashSet<>()); TemplateIOErrorContextHolder.addNeedEnablePlugin(PluginMarkerAdapter.create("1", "1.0", "1插件")); TemplateIOErrorContextHolder.addNeedInstallPlugin(PluginMarker.create("2", "1.0")); TemplateIOErrorContextHolder.addNeedInstallPlugin(PluginMarker.create("3", "1.0")); @@ -60,19 +55,19 @@ public class DesignerAppUtilsTest { } @Test - public void testRearrange(){ + public void testRearrange() { // 远程插件模拟注册 - PluginRemoteSync pluginRemoteSync = EasyMock.createMock(PluginRemoteSync.class); - EasyMock.expect(pluginRemoteSync.getPluginRemoteStatusByIdIndex()).andReturn(new HashMap(){{ - put("com.fr.plugin1", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin1","1",true).get()); - put("com.fr.plugin2", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin2","1",true).get()); - put("com.fr.plugin3", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin3","1",false).get()); - put("com.fr.plugin4", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin4","1",false).get()); - }}).anyTimes(); - EasyMock.replay(pluginRemoteSync); - PowerMock.mockStaticPartial(PluginRemoteSync.class, "getInstance"); - EasyMock.expect(PluginRemoteSync.getInstance()).andReturn(pluginRemoteSync).anyTimes(); - PowerMock.replay(PluginRemoteSync.class); +// PluginRemoteSync pluginRemoteSync = EasyMock.createMock(PluginRemoteSync.class); +// EasyMock.expect(pluginRemoteSync.getPluginRemoteStatusByIdIndex()).andReturn(new HashMap(){{ +// put("com.fr.plugin1", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin1","1",true).get()); +// put("com.fr.plugin2", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin2","1",true).get()); +// put("com.fr.plugin3", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin3","1",false).get()); +// put("com.fr.plugin4", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin4","1",false).get()); +// }}).anyTimes(); +// EasyMock.replay(pluginRemoteSync); +// PowerMock.mockStaticPartial(PluginRemoteSync.class, "getInstance"); +// EasyMock.expect(PluginRemoteSync.getInstance()).andReturn(pluginRemoteSync).anyTimes(); +// PowerMock.replay(PluginRemoteSync.class); // 本地插件模拟检查 TemplateIOErrorContextHolder.registerPluginNameMap(new HashMap() {{ @@ -81,7 +76,7 @@ public class DesignerAppUtilsTest { put("com.fr.plugin3", "好用的插件3"); put("com.fr.plugin4", "好用的插件4"); put("com.fr.plugin5", "好用的插件5"); - }},new HashSet<>()); + }}, new HashSet<>()); // unknown TemplateIOErrorContextHolder.addNeedInstallPlugin(PluginMarker.create("com.fr.plugin7", "1")); // disable @@ -93,14 +88,14 @@ public class DesignerAppUtilsTest { Multimap pendingPlugins = TemplateIOErrorContextHolder.getPendingPlugin(); - Reflect.on(DesignerAppUtils.class).call("rearrange",pendingPlugins).get(); - Assert.assertEquals(1,pendingPlugins.get(TemplateIOErrorContextHolder.UNKNOWN_PLUGIN).size()); + Reflect.on(DesignerAppUtils.class).call("rearrange", pendingPlugins).get(); + Assert.assertEquals(1, pendingPlugins.get(TemplateIOErrorContextHolder.UNKNOWN_PLUGIN).size()); Collection pluginMarkerAdapters = pendingPlugins.get(TemplateIOErrorContextHolder.DISABLE_PLUGIN); Assert.assertEquals(2, pluginMarkerAdapters.size()); pluginMarkerAdapters.contains(PluginMarker.create("com.fr.plugin3", "1")); pluginMarkerAdapters.contains(PluginMarker.create("com.fr.plugin4", "1")); Collection pluginMarkerAdapters1 = pendingPlugins.get(TemplateIOErrorContextHolder.NOT_INSTALLED_PLUGIN); Assert.assertEquals(1, pluginMarkerAdapters1.size()); - pluginMarkerAdapters1.contains(PluginMarker.create("com.fr.plugin5","1")); + pluginMarkerAdapters1.contains(PluginMarker.create("com.fr.plugin5", "1")); } } \ No newline at end of file From 539dd8ca4ce4778ceeba2afaebec012e3e475586 Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 21 Dec 2021 14:45:30 +0800 Subject: [PATCH 05/12] =?UTF-8?q?CHART-22090=20=E6=9D=A1=E4=BB=B6=E5=B1=9E?= =?UTF-8?q?=E6=80=A7-=E9=A2=9C=E8=89=B2=E6=8E=A7=E4=BB=B6=E6=AE=8B?= =?UTF-8?q?=E7=95=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/component/VanChartUIListControlPane.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java index 8a18814ebd..07f35672c7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java @@ -25,6 +25,7 @@ import java.awt.BorderLayout; import java.awt.Component; import java.awt.FlowLayout; import java.awt.Point; +import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -210,6 +211,16 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem public void doCancel() { setVisible(false); } + + @Override + public void setVisible(boolean b) { + //把一些可能没隐藏的子弹框隐藏 比如 边框-颜色弹框 + for (Window window : getOwnedWindows()) { + window.setVisible(false); + } + + super.setVisible(b); + } } } From 8638c51f4ce98c08d66b9ad59c944c822b54359c Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 21 Dec 2021 14:48:14 +0800 Subject: [PATCH 06/12] update --- .../chart/designer/component/VanChartUIListControlPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java index 07f35672c7..ce8253b981 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java @@ -214,12 +214,12 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem @Override public void setVisible(boolean b) { + super.setVisible(b); + //把一些可能没隐藏的子弹框隐藏 比如 边框-颜色弹框 for (Window window : getOwnedWindows()) { window.setVisible(false); } - - super.setVisible(b); } } From 75a342690caa19f7ccb9dd7dd6d4ace4816605de Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 21 Dec 2021 18:58:26 +0800 Subject: [PATCH 07/12] =?UTF-8?q?CHART-22076=20fix:fvs.cpt=20=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E8=AE=BE=E7=BD=AE=E8=B6=85=E9=93=BE=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E8=B6=85=E9=93=BE=20=E6=96=87=E6=9C=AC=E7=99=BD?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/utils/gui/AdjustWorkBookDefaultStyleUtils.java | 7 ++++++- .../fr/design/mainframe/HyperlinkGroupPaneActionImpl.java | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java index 760fc3c808..a3121e36ca 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java @@ -17,6 +17,7 @@ public class AdjustWorkBookDefaultStyleUtils { private static final Color TEMPLATE_BACKGROUND = new Color(16, 11, 43); private static final Color CELL_ELEMENT_BORDER = new Color(110, 110, 110); + private static final Color CELL_ELEMENT_FONT_FOREGROUND = Color.WHITE; private static Color currentStoryBack = null; @@ -31,7 +32,7 @@ public class AdjustWorkBookDefaultStyleUtils { public static void adjustCellElement(CellElement cellElement) { if (DesignModeContext.isDuchampMode()) { Style style = cellElement.getStyle(); - style = style.deriveFRFont(style.getFRFont().applyForeground(Color.WHITE)); + style = style.deriveFRFont(style.getFRFont().applyForeground(CELL_ELEMENT_FONT_FOREGROUND)); style = style.deriveBorder(0, CELL_ELEMENT_BORDER, 0, CELL_ELEMENT_BORDER, 0, CELL_ELEMENT_BORDER, @@ -40,6 +41,10 @@ public class AdjustWorkBookDefaultStyleUtils { } } + public static Color adjustCellElementFontForeground(Color color) { + return DesignModeContext.isDuchampMode() ? CELL_ELEMENT_FONT_FOREGROUND : color; + } + public static void adjustFloatElement(FloatElement floatElement) { if (DesignModeContext.isDuchampMode()) { Style style = floatElement.getStyle(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java b/designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java index 71a37e42f0..d90b7e8ec3 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java @@ -6,6 +6,7 @@ import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; +import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.general.FRFont; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; @@ -82,7 +83,7 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro frFont = frFont.applyForeground(Color.blue); frFont = frFont.applyUnderline(Constants.LINE_THIN); } else { - frFont = frFont.applyForeground(Color.black); + frFont = frFont.applyForeground(AdjustWorkBookDefaultStyleUtils.adjustCellElementFontForeground(Color.black)); frFont = frFont.applyUnderline(Constants.LINE_NONE); } editCellElement.setStyle(elementStyle.deriveFRFont(frFont)); From e49d512d1861fa87ea7fc73d84e42b7d5ad6732e Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 22 Dec 2021 10:18:51 +0800 Subject: [PATCH 08/12] =?UTF-8?q?CHART-21877=20fix:fvs.cpt=20=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E8=AE=BE=E7=BD=AE=E5=8D=95=E5=85=83=E6=A0=BC=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E9=A2=9C=E8=89=B2=E5=90=8E=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E5=AD=97=E4=BD=93=E6=98=AF=E9=BB=91=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/style/BorderPane.java | 13 +++++++++---- .../utils/gui/AdjustWorkBookDefaultStyleUtils.java | 9 ++++++++- .../fr/design/actions/utils/ReportActionUtils.java | 5 +++-- .../cell/settingpane/AbstractCellAttrPane.java | 2 ++ .../mainframe/cell/settingpane/CellStylePane.java | 12 +++++++----- 5 files changed, 29 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java index 9f948e7a18..a3151b2e71 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java @@ -17,14 +17,19 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.color.NewColorSelectBox; - +import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.stable.Constants; import com.fr.stable.CoreConstants; -import javax.swing.*; +import javax.swing.Icon; +import javax.swing.JPanel; +import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.GridLayout; import java.util.Arrays; import java.util.HashSet; import java.util.Set; @@ -198,7 +203,7 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse public Style update(Style style) { if (style == null) { - style = Style.DEFAULT_STYLE; + style = AdjustWorkBookDefaultStyleUtils.adjustCellElement(Style.DEFAULT_STYLE); } if (backgroundPane.currentPane.isBackgroundChange()) { diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java index a3121e36ca..bfa742f9b1 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java @@ -32,13 +32,20 @@ public class AdjustWorkBookDefaultStyleUtils { public static void adjustCellElement(CellElement cellElement) { if (DesignModeContext.isDuchampMode()) { Style style = cellElement.getStyle(); + style = adjustCellElement(style); + cellElement.setStyle(style); + } + } + + public static Style adjustCellElement(Style style) { + if (DesignModeContext.isDuchampMode()) { style = style.deriveFRFont(style.getFRFont().applyForeground(CELL_ELEMENT_FONT_FOREGROUND)); style = style.deriveBorder(0, CELL_ELEMENT_BORDER, 0, CELL_ELEMENT_BORDER, 0, CELL_ELEMENT_BORDER, 0, CELL_ELEMENT_BORDER); - cellElement.setStyle(style); } + return style; } public static Color adjustCellElementFontForeground(Color color) { diff --git a/designer-realize/src/main/java/com/fr/design/actions/utils/ReportActionUtils.java b/designer-realize/src/main/java/com/fr/design/actions/utils/ReportActionUtils.java index 2c0b73fe95..a40397b7f3 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/utils/ReportActionUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/utils/ReportActionUtils.java @@ -4,6 +4,7 @@ import com.fr.base.Style; import com.fr.design.actions.cell.style.StyleActionInterface; import com.fr.design.mainframe.DesignOperationEvent; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.event.EventDispatcher; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; @@ -15,7 +16,7 @@ import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.ElementCase; import com.fr.report.elementcase.TemplateElementCase; -import java.awt.*; +import java.awt.Rectangle; public class ReportActionUtils { private ReportActionUtils() { @@ -113,7 +114,7 @@ public class ReportActionUtils { CellElement editCellElement = report.getCellElement(((CellSelection) sel).getColumn(), ((CellSelection) sel).getRow()); if (editCellElement == null) { - return Style.DEFAULT_STYLE; + return AdjustWorkBookDefaultStyleUtils.adjustCellElement(Style.DEFAULT_STYLE); } //peter:直接返回当前编辑元素的Style diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/AbstractCellAttrPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/AbstractCellAttrPane.java index 83ef31eaa9..358da10b5d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/AbstractCellAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/AbstractCellAttrPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.cell.settingpane; import com.fr.design.mainframe.AbstractAttrPane; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.report.cell.DefaultTemplateCellElement; @@ -53,6 +54,7 @@ public abstract class AbstractCellAttrPane extends AbstractAttrPane { TemplateCellElement cellElement = elementCase.getTemplateCellElement(cs.getColumn(), cs.getRow()); if (cellElement == null) { cellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); + AdjustWorkBookDefaultStyleUtils.adjustCellElement(cellElement); } this.cellElement = cellElement; elementCase.addCellElement(this.cellElement); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java index 049b0111ae..0130d0fad0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java @@ -5,16 +5,18 @@ import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.cell.settingpane.style.StylePane; import com.fr.design.style.BorderUtils; +import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.design.utils.gui.GUICoreUtils; - import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; -import javax.swing.*; +import javax.swing.JFrame; +import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Rectangle; /** * @author zhou @@ -101,12 +103,12 @@ public class CellStylePane extends AbstractCellAttrPane { TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { cellElement = new DefaultTemplateCellElement(column, row); + AdjustWorkBookDefaultStyleUtils.adjustCellElement(cellElement); elementCase.addCellElement(cellElement); } Style style = cellElement.getStyle(); if (style == null) { - style = Style.DEFAULT_STYLE; - + style = AdjustWorkBookDefaultStyleUtils.adjustCellElement(Style.DEFAULT_STYLE); } style = stylePane.updateStyle(style); cellElement.setStyle(style); From 8d46130275772012f8b8b859db8157cba50ccf60 Mon Sep 17 00:00:00 2001 From: pengda Date: Thu, 23 Dec 2021 15:23:26 +0800 Subject: [PATCH 09/12] =?UTF-8?q?CHART-22211=20=E7=94=98=E7=89=B9=E5=9B=BE?= =?UTF-8?q?=E7=94=A8=E6=96=87=E4=BB=B6=E6=95=B0=E6=8D=AE=E9=9B=86=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/component/GanttTableDataContentPane.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java index b8a2001147..82bb26e438 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java @@ -93,13 +93,13 @@ public class GanttTableDataContentPane extends AbstractTableDataContentPane{ ganttDefinition.setEndTime(endTime == null ? StringUtils.EMPTY : String.valueOf(endTime)); Object markTime = markerTimeComboBox.getSelectedItem(); - ganttDefinition.setMarkTime(isNoneObject(markTime) ? StringUtils.EMPTY : String.valueOf(markTime)); + ganttDefinition.setMarkTime(isNoneObject(markTime) ? null : String.valueOf(markTime)); Object process = processComboBox.getSelectedItem(); - ganttDefinition.setProgress(isNoneObject(process) ? StringUtils.EMPTY : String.valueOf(process)); + ganttDefinition.setProgress(isNoneObject(process) ? null : String.valueOf(process)); Object taskID = taskIDComboBox.getSelectedItem(); - ganttDefinition.setLinkID(isNoneObject(taskID) ? StringUtils.EMPTY : String.valueOf(taskID)); + ganttDefinition.setLinkID(isNoneObject(taskID) ? null : String.valueOf(taskID)); } private boolean isNoneObject(Object markTime) { @@ -117,9 +117,9 @@ public class GanttTableDataContentPane extends AbstractTableDataContentPane{ seriesComboBox.setSelectedItem(ganttDefinition.getSeriesName()); startTimeComboBox.setSelectedItem(ganttDefinition.getStartTime()); endTimeComboBox.setSelectedItem(ganttDefinition.getEndTime()); - markerTimeComboBox.setSelectedItem(StringUtils.isEmpty(ganttDefinition.getMarkTime()) ? NONE : ganttDefinition.getMarkTime()); - processComboBox.setSelectedItem(StringUtils.isEmpty(ganttDefinition.getProgress()) ? NONE : ganttDefinition.getProgress()); - taskIDComboBox.setSelectedItem(StringUtils.isEmpty(ganttDefinition.getLinkID()) ? NONE : ganttDefinition.getLinkID()); + markerTimeComboBox.setSelectedItem(ganttDefinition.getMarkTime() == null ? NONE : ganttDefinition.getMarkTime()); + processComboBox.setSelectedItem(ganttDefinition.getProgress() == null ? NONE : ganttDefinition.getProgress()); + taskIDComboBox.setSelectedItem(ganttDefinition.getLinkID() == null ? NONE : ganttDefinition.getLinkID()); } } From eb35507eb4216b0ece2c8242fd53debe0e1cf1eb Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 23 Dec 2021 14:03:15 +0800 Subject: [PATCH 10/12] =?UTF-8?q?REPORT-64741=20=E3=80=90=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=8F=AF=E6=9B=B4=E6=96=B0=E6=8F=90=E9=86=92=E3=80=91?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8-=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E7=AB=AF=E5=AE=89=E8=A3=85=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E9=AB=98=E4=BA=8E=E5=BD=93=E5=89=8D=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E7=89=88=E6=9C=AC=E7=9A=84=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 1. 重新确定了组件是否可以被安装的规则。 安装新组件时,如果之前没有安装过该UID的组件,则允许安装; 否则将会比较新旧组件的兼容性和版本高低,以确定是否安装新组件。 优先满足兼容性需求,兼容性相同时,再考虑组件版本. 兼容 + 高版本 > 兼容 + 低版本 > 不兼容 + 高版本 > 不兼容 + 低版本 2. 安装新的组件reu时,删除组内旧的组件reu文件 【改动思路】 同上 --- .../fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java | 2 +- .../java/com/fr/design/mainframe/share/util/InstallUtils.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java index b8cb0e6788..646a4c8634 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java @@ -179,7 +179,7 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock { //安装 File file = new File(filePath); try { - if (file.exists() && getDefaultGroup().installModule(file)) { + if (file.exists() && getDefaultGroup().installUniqueIdModule(file)) { ShareUtils.recordInstallTime(file.getName(), System.currentTimeMillis()); ComponentCollector.getInstance().collectCmpDownLoad(widget.getUuid()); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java index 610f688a46..b3c711c01a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java @@ -112,7 +112,7 @@ public class InstallUtils { private static boolean installReuFile(Group group, File chosenFile, long installTime) { try { - if (!group.installModule(chosenFile)) { + if (!group.installUniqueIdModule(chosenFile)) { return false; } ShareUtils.recordInstallTime(chosenFile.getName(), installTime); From eb17d1c17f3979829df1cdeb74094e8f3d98232c Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 23 Dec 2021 11:12:07 +0800 Subject: [PATCH 11/12] =?UTF-8?q?REPORT-64811=20=E4=BF=9D=E6=8C=81?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=95=86=E5=9F=8E=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?reu=E6=96=87=E4=BB=B6=E5=90=8D=E4=B8=AD=E7=9A=84=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 使用商城组件数据中的fileLoca字段值作为本地reu文件名,该字段与oss服务器中reu文件的 文件名保持一致. 设计器在下载安装组件时,不对reu文件进行重命名操作, 即本地安装组件时,使用原本地reu 文件名,在线安装商城组件时,使用原oss服务器中reu文件名. 【改动思路】 同上 --- .../mainframe/share/ui/block/OnlineWidgetBlock.java | 11 ++++++++++- .../fr/design/mainframe/share/util/DownloadUtils.java | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java index 646a4c8634..74651ccae7 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java @@ -150,6 +150,14 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock { } } + private String createLocalReuFilename() { + String filename = widget.getFileLoca(); + if (StringUtils.isEmpty(filename) || !filename.endsWith(".reu")) { + filename = widget.getName() + "." + widget.getUuid() + ".reu"; + } + return filename; + } + private void downLoadWidget() { if (OnlineWidgetRepoPane.getInstance().isShowPackagePanel()) { ComponentCollector.getInstance().collectDownloadPktNum(); @@ -170,7 +178,8 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock { protected Boolean doInBackground() { String filePath; try { - filePath = DownloadUtils.download(widget.getId(), widget.getName() + "." + widget.getUuid(), process); + String filename = createLocalReuFilename(); + filePath = DownloadUtils.download(widget.getId(), filename, process); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); return false; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/DownloadUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/DownloadUtils.java index 96c2cc28c6..18cb938387 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/DownloadUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/DownloadUtils.java @@ -67,7 +67,7 @@ public class DownloadUtils { long totalSize = entity.getContentLength(); InputStream content = entity.getContent(); - filePath = StableUtils.pathJoin(realPath, fileName + ".reu"); + filePath = StableUtils.pathJoin(realPath, fileName); StableUtils.makesureFileExist(new File(filePath)); FileOutputStream writer = new FileOutputStream(filePath); byte[] data = new byte[PluginConstants.BYTES_NUM]; From 4a1df52f26c14ebc25a6d355024978b73f4950de Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 28 Dec 2021 15:14:55 +0800 Subject: [PATCH 12/12] =?UTF-8?q?REPORT-64738=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=9C=A8=E7=BA=BF=E7=BB=84=E4=BB=B6=E5=BA=93=E4=B8=AD?= =?UTF-8?q?=E5=8F=AF=E8=A7=81=E7=BB=84=E4=BB=B6=E5=BA=94=E5=8E=BB=E9=87=8D?= =?UTF-8?q?=E4=B8=94=E4=BB=85=E6=98=BE=E7=A4=BA=E5=85=BC=E5=AE=B9=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=9A=84=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 1. 获取组件包中子组件json数据接口添加当前设计器版本参数 2. 下载组件包的接口添加当前设计器版本参数 【改动思路】 同上 --- .../mainframe/share/util/DownloadUtils.java | 39 +++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/DownloadUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/DownloadUtils.java index 18cb938387..b6375b1d69 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/DownloadUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/DownloadUtils.java @@ -30,6 +30,9 @@ import java.nio.charset.StandardCharsets; import java.security.KeyFactory; import java.security.interfaces.RSAPublicKey; import java.security.spec.X509EncodedKeySpec; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; /** * created by Harrison on 2020/05/27 @@ -55,9 +58,9 @@ public class DownloadUtils { @NotNull public static String download(String id, String fileName, com.fr.design.extra.Process process) throws Exception { - CloseableHttpResponse fileRes = getHttpResponse(REUSES_URL, id); + CloseableHttpResponse fileRes = postDownloadHttpResponse(REUSES_URL, id); if (fileRes.getStatusLine().getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY) { - fileRes = getHttpResponse(fileRes.getHeaders("Location")[0].getValue()); + fileRes = getDownloadHttpResponse(fileRes.getHeaders("Location")[0].getValue()); } if (fileRes.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { String realPath = StableUtils.pathJoin(ProductConstants.getEnvHome(), ShareComponentConstants.PLUGIN_CACHE, ShareComponentConstants.DOWNLOAD_SHARE); @@ -93,9 +96,11 @@ public class DownloadUtils { public static String downloadPackage(String id, String fileName, CancelCheck cancelCheck) throws Exception { - CloseableHttpResponse fileRes = getHttpResponse(PACKAGE_REUSES_URL, id); + Map params = new HashMap<>(); + params.put("designerVersion", ProductConstants.RELEASE_VERSION); + CloseableHttpResponse fileRes = postDownloadHttpResponse(PACKAGE_REUSES_URL, id, params); if (fileRes.getStatusLine().getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY) { - fileRes = getHttpResponse(fileRes.getHeaders("Location")[0].getValue()); + fileRes = getDownloadHttpResponse(fileRes.getHeaders("Location")[0].getValue()); } String realPath = StableUtils.pathJoin(ProductConstants.getEnvHome(), ShareComponentConstants.PLUGIN_CACHE, ShareComponentConstants.DOWNLOAD_PACKAGE_SHARE); String filePath; @@ -130,21 +135,33 @@ public class DownloadUtils { } } - private static CloseableHttpResponse getHttpResponse(String url, String id) throws Exception { + private static CloseableHttpResponse postDownloadHttpResponse(String url, String id) throws Exception { + return postDownloadHttpResponse(url, id, new HashMap<>()); + } + + private static CloseableHttpResponse postDownloadHttpResponse(String url, String id, Map params) throws Exception { //先登录一下。不然可能失败 CloseableHttpClient client = createClient(); FineLoggerFactory.getLogger().info("login fr-market"); FineLoggerFactory.getLogger().info("start download widget {}", id); - HttpUriRequest file = RequestBuilder.post() + RequestBuilder builder = RequestBuilder.post() .setHeader("User-Agent", "Mozilla/5.0") - .setUri(url).addParameter("id", encrypt(id)).addParameter("userId", - String.valueOf(DesignerEnvManager.getEnvManager().getDesignerLoginUid())) - .build(); - return client.execute(file); + .setUri(url) + .addParameter("id", encrypt(id)) + .addParameter("userId", String.valueOf(DesignerEnvManager.getEnvManager().getDesignerLoginUid())); + + if (params != null) { + Set keys = params.keySet(); + for (String key: keys) { + builder.addParameter(key, params.get(key)); + } + } + + return client.execute(builder.build()); } - private static CloseableHttpResponse getHttpResponse(String url) throws Exception { + private static CloseableHttpResponse getDownloadHttpResponse(String url) throws Exception { //先登录一下。不然可能失败 CloseableHttpClient client = createClient(); HttpUriRequest file = RequestBuilder.get()