From 9f96ccac1bd04c1d541a638d2c9a091a44b96d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 7 Jun 2021 14:32:40 +0800 Subject: [PATCH 01/14] =?UTF-8?q?REPORT-53229=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=A1=B6=E9=83=A8=E7=89=88=E6=9C=AC=E5=8F=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=94=B9=E4=B8=BA=E5=B0=8F=E7=89=88=E6=9C=AC=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/DesignerFrame.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 3d7fb8c48b..8a03582d0f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -52,6 +52,7 @@ import com.fr.file.FILEFactory; import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; +import com.fr.general.GeneralUtils; import com.fr.general.IOUtils; import com.fr.invoke.Reflect; import com.fr.log.FineLoggerFactory; @@ -863,7 +864,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta JTemplate editingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); StringBuilder defaultTitleSB = new StringBuilder(); - defaultTitleSB.append(ProductConstants.PRODUCT_NAME); + defaultTitleSB.append(ProductConstants.APP_NAME); + defaultTitleSB.append(GeneralUtils.getVersion()); defaultTitleSB.append(" "); defaultTitleSB.append(ProductConstants.BRANCH); defaultTitleSB.append(" "); From 6e1c75179cbb8de8ae6aba3d3d0980fe20949802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Tue, 8 Jun 2021 09:39:57 +0800 Subject: [PATCH 02/14] =?UTF-8?q?REPORT-53229=20=E8=A1=A5=E4=B8=8A?= =?UTF-8?q?=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/DesignerFrame.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 8a03582d0f..6fa9871bc7 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -865,6 +865,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta JTemplate editingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); StringBuilder defaultTitleSB = new StringBuilder(); defaultTitleSB.append(ProductConstants.APP_NAME); + defaultTitleSB.append(" "); defaultTitleSB.append(GeneralUtils.getVersion()); defaultTitleSB.append(" "); defaultTitleSB.append(ProductConstants.BRANCH); From eeb3ad9ce3593882f1d1a67a7b91e34e4f8fbb84 Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Tue, 8 Jun 2021 10:22:16 +0800 Subject: [PATCH 03/14] =?UTF-8?q?REPORT-53351=20=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E5=90=8Esql-=E5=8F=82=E6=95=B0=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=97=B6=E7=9A=84=E6=98=BE=E7=A4=BA=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../preview/sql/PreviewPerformedSqlPane.java | 54 +++++++------------ 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java index 2800e6f759..938c49f9a4 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java @@ -107,11 +107,11 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener { topPanel.add(imagePanel, BorderLayout.WEST); topPanel.add(messagePanel, BorderLayout.CENTER); - topPanel.setBorder(BorderFactory.createEmptyBorder(10,10,0,10)); + topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); //中间的SQL面板 centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); - centerPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10)); + centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); JScrollPane scrollPane = new JScrollPane(); JTextArea checkArea = new JTextArea(sql); checkArea.setEditable(false); @@ -135,7 +135,7 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener { UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); okButton.addActionListener(this); bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); - bottomPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); + bottomPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); bottomPanel.add(okButton, BorderLayout.EAST); this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Preview_Performed_Sql")); @@ -167,42 +167,28 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener { parameterMap.put(parameter.getName(), parameter.getValue()); } } - boolean showOriginSql = true; - for (ParameterProvider parameter : DataOperator.getInstance().getTableDataParameters(tableData)) { - if (parameterMap.containsKey(parameter.getName())) { - Object value = parameterMap.get(parameter.getName()); - if (value != null && !StringUtils.EMPTY.equals(value)) { - showOriginSql = false; - } - parameter.setValue(value); - } - } String sql; // 计算高亮文本位置 List specialCharParamIndex = null; boolean highlight = true; - if (showOriginSql) { - sql = tableData.getQuery(); - } else { - NameSpace ns = ParameterMapNameSpace.create(parameterMap); - calculator.pushNameSpace(ns); - Parameter[] paras = processParameters(tableData, calculator); - // 所有被转义参数的集合 - Set specialCharParam = EscapeSqlHelper.getInstance().getSpecialCharParam(paras); - // 将参数转义等 - Set tableDataProviders = getTableDataProviders(); - for (TableDataProvider provider : tableDataProviders) { - provider.processParametersBeforeAnalyzeSQL(paras, calculator); - } + NameSpace ns = ParameterMapNameSpace.create(parameterMap); + calculator.pushNameSpace(ns); + Parameter[] paras = processParameters(tableData, calculator); + // 所有被转义参数的集合 + Set specialCharParam = EscapeSqlHelper.getInstance().getSpecialCharParam(paras); + // 将参数转义等 + Set tableDataProviders = getTableDataProviders(); + for (TableDataProvider provider : tableDataProviders) { + provider.processParametersBeforeAnalyzeSQL(paras, calculator); + } - if (!specialCharParam.isEmpty()) { - specialCharParamIndex = ParameterHelper.analyzeCurrentContextTableData4Template(tableData.getQuery(), paras, specialCharParam); - } - String oldSql = ParameterHelper.analyzeCurrentContextTableData4Templatee(tableData.getQuery(), paras); - sql = processExtraSQL(paras, oldSql, calculator, tableDataProviders); - if (!StringUtils.equals(oldSql, sql)) { - highlight = false; - } + if (!specialCharParam.isEmpty()) { + specialCharParamIndex = ParameterHelper.analyzeCurrentContextTableData4Template(tableData.getQuery(), paras, specialCharParam); + } + String oldSql = ParameterHelper.analyzeCurrentContextTableData4Templatee(tableData.getQuery(), paras); + sql = processExtraSQL(paras, oldSql, calculator, tableDataProviders); + if (!StringUtils.equals(oldSql, sql)) { + highlight = false; } // sql内容复制到剪切板 StringSelection selection = new StringSelection(sql); From 58364c9503b34452927a5603858f99dc2e786186 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 8 Jun 2021 14:46:24 +0800 Subject: [PATCH 04/14] =?UTF-8?q?REPORT-53592=20=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E5=88=9B=E5=BB=BA=E5=85=B1=E4=BA=AB=E7=BB=84?= =?UTF-8?q?=E4=BB=B6npe=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/share/effect/EffectItemGroup.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java index a07478c9d9..91d842c61e 100644 --- a/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java +++ b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java @@ -111,8 +111,11 @@ public class EffectItemGroup { ChartCollection chartCollection = (ChartCollection) value; for (int index = 0; index < chartCollection.getChartCount(); index++) { Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class); - SourceNode chartSourceNode = SourceNodeUtils.createSourceNode(chart.getPlot(), chartCollection.getChartName(index), cellSourceNode); Plot plot = chart.getPlot(); + if (plot == null) { + break; + } + SourceNode chartSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), cellSourceNode); initChartPlot(plot, chartSourceNode, false); } @@ -126,8 +129,11 @@ public class EffectItemGroup { ChartCollection chartCollection = (ChartCollection) editor.getChartCollection(); for (int index = 0; index < chartCollection.getChartCount(); index++) { Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class); - SourceNode plotSourceNode = SourceNodeUtils.createSourceNode(chart.getPlot(), chartCollection.getChartName(index), null); Plot plot = chart.getPlot(); + if (plot == null) { + break; + } + SourceNode plotSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), null); initChartPlot(plot, plotSourceNode, false); } From be9a0b313f4cb7fef6e0b35bc2531b17a6a86ff4 Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Tue, 8 Jun 2021 15:06:41 +0800 Subject: [PATCH 05/14] =?UTF-8?q?REPORT-53351=20=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E5=90=8Esql-=E5=8F=82=E6=95=B0=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=97=B6=E7=9A=84=E6=98=BE=E7=A4=BA=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/preview/sql/PreviewPerformedSqlPane.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java index 938c49f9a4..bf210380bc 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java @@ -167,6 +167,11 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener { parameterMap.put(parameter.getName(), parameter.getValue()); } } + for (ParameterProvider parameter : DataOperator.getInstance().getTableDataParameters(tableData)) { + if (parameterMap.containsKey(parameter.getName())) { + parameter.setValue(parameterMap.get(parameter.getName())); + } + } String sql; // 计算高亮文本位置 List specialCharParamIndex = null; From 9c51640be0cd67477df803d0ff7fb61319de6e79 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 8 Jun 2021 17:02:45 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E8=A7=86=E8=A7=89=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/controlpane/UIListGroupControlPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java index dbc71fe1af..384d2bb524 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java @@ -482,7 +482,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements L UILabel label = new UILabel(labelText + getWrapperLabelText()) { @Override public void paint(Graphics g) { - ((Graphics2D) g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.7f)); + ((Graphics2D) g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f)); super.paint(g); } }; @@ -490,7 +490,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements L label.setOpaque(true); label.setBackground(Color.WHITE); label.setForeground(Color.decode("#333334")); - label.setFont(label.getFont().deriveFont(10F)); + label.setFont(label.getFont().deriveFont(11F)); label.setPreferredSize(new Dimension(224, 26)); this.nameEdList = nameEdList; this.add(label, BorderLayout.NORTH); From a8596d7e27fd6b5f7ea4dc61c7ca111e8fa35b87 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 8 Jun 2021 17:17:42 +0800 Subject: [PATCH 07/14] =?UTF-8?q?REPORT-53135=20=E3=80=90=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E8=81=94=E5=8A=A8=E3=80=91=E7=BB=84=E4=BB=B6=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=97=B6=EF=BC=8C=E6=B2=A1=E6=9C=89=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mod/ContentObjectManager.java | 28 +++++++++++++++++++ .../com/fr/design/mod/ContentReplaceUtil.java | 8 ++++++ .../com/fr/design/mod/ContentReplacer.java | 5 ++++ .../repalce/JavaScriptContentReplacer.java | 4 +++ .../VanChartHtmlLabelContentReplacer.java | 5 ++++ .../share/ui/generate/ShareGeneratePane.java | 26 +++++++++++++++-- .../share/ui/generate/ShareMainPane.java | 13 +++++++-- 7 files changed, 85 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java b/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java index b70ea88b0a..0111f7836f 100644 --- a/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java +++ b/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java @@ -9,6 +9,8 @@ import com.fr.data.SimpleDSColumn; import com.fr.data.condition.FormulaCondition; import com.fr.data.impl.FormulaDictionary; import com.fr.data.impl.NameTableData; +import com.fr.design.mod.impl.repalce.JavaScriptContentReplacer; +import com.fr.design.mod.impl.repalce.VanChartHtmlLabelContentReplacer; import com.fr.form.main.FormHyperlink; import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.WidgetTitle; @@ -22,6 +24,7 @@ import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.group.FunctionGrouper; import com.fr.report.cell.cellattr.core.group.SelectCount; import com.fr.stable.Filter; +import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -49,6 +52,8 @@ public class ContentObjectManager { private final Set set = new HashSet<>(); + private final Map map = new HashMap<>(); + private ContentObjectManager() { set.add(Formula.class.getName()); set.add(JavaScriptImpl.class.getName()); @@ -70,6 +75,8 @@ public class ContentObjectManager { set.add(SelectCount.class.getName()); set.add(WidgetTitle.class.getName()); set.add(FunctionGrouper.class.getName()); + map.put(JavaScriptImpl.class.getName(), new JavaScriptContentReplacer()); + map.put(VanChartHtmlLabel.class.getName(), new VanChartHtmlLabelContentReplacer()); } public void searchObject(Object ob) { @@ -84,6 +91,9 @@ public class ContentObjectManager { objectMap = ClassHelper.searchObject(ob, set, filter); } public void clearObject() { + if (objectMap != null) { + objectMap.clear(); + } objectMap = null; } @@ -92,4 +102,22 @@ public class ContentObjectManager { return objectMap; } + public boolean needContentTip(Object ob, Set nameSet) { + long start = System.currentTimeMillis(); + objectMap = ClassHelper.searchObject(ob, set, ModClassFilter.getInstance()); + for (Map.Entry> entry : objectMap.entrySet()) { + for (Object o : entry.getValue()) { + for (String name : nameSet) { + ContentReplacer contentReplacer = map.get(entry.getKey()); + if (contentReplacer!= null && contentReplacer.contain(o, name)) { + clearObject(); + return true; + } + } + } + } + clearObject(); + return false; + } + } diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java b/designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java index 1d8e73e840..3b7d9e7715 100644 --- a/designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java +++ b/designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java @@ -77,6 +77,7 @@ public class ContentReplaceUtil { content = getFormulaPureContent(content); FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer(); frFormulaTransformer.addRenamedWidget(oldName, newName); + frFormulaTransformer.addRenamedParameter(oldName, newName); return EQ_STRING + frFormulaTransformer.transform(content); } @@ -168,5 +169,12 @@ public class ContentReplaceUtil { return content; } + public static boolean containsName(String content, String name) { + if (StringUtils.isNotEmpty(content)) { + return content.contains(name); + } + return false; + } + } diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/ContentReplacer.java index 3f71265354..a9d54b6a40 100644 --- a/designer-base/src/main/java/com/fr/design/mod/ContentReplacer.java +++ b/designer-base/src/main/java/com/fr/design/mod/ContentReplacer.java @@ -10,4 +10,9 @@ public interface ContentReplacer { void replace(T t, String oldName, String newName); + + default boolean contain(T t, String name) { + return false; + } + } diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/JavaScriptContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/JavaScriptContentReplacer.java index 118f1b79ce..763b0b4a06 100644 --- a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/JavaScriptContentReplacer.java +++ b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/JavaScriptContentReplacer.java @@ -19,4 +19,8 @@ public class JavaScriptContentReplacer implements ContentReplacer xCreators = new HashSet<>(); + xCreator.traversalNameRelatedXCreators(xCreators); + Set nameSet = new HashSet<>(); + for (XCreator creator : xCreators) { + nameSet.add(creator.toData().getWidgetName()); + } + boolean result = ContentObjectManager.getInstance().needContentTip(shareWidget, nameSet); + FineLoggerFactory.getLogger().debug("needContentTip spend {} ms", (System.currentTimeMillis() - start)); + return result; + } + private JPanel createUploadCheckBox() { JPanel panel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java index df1d2c04ba..a4fc73fbe7 100644 --- a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java @@ -131,13 +131,15 @@ public class ShareMainPane extends JPanel { private boolean upload; private List effectItemGroups; + private final boolean needContentTip; - public ShareMainPane(Image shareCover, Rectangle rec, boolean upload, List effectItemGroups) { + public ShareMainPane(Image shareCover, Rectangle rec, boolean upload, List effectItemGroups, boolean needContentTip) { this.shareCover = shareCover; this.rec = rec; this.upload = upload; this.effectItemGroups = effectItemGroups; + this.needContentTip = needContentTip; initCover(shareCover); this.setLayout(FRGUIPaneFactory.createBorderLayout()); @@ -174,7 +176,14 @@ public class ShareMainPane extends JPanel { private JPanel createOverviewPane(boolean upload) { JPanel componentPane = createComponentOverviewPane(upload); String title = Toolkit.i18nText("Fine-Design_Share_Overview"); - JPanel overviewPane = FRGUIPaneFactory.createTitledBorderPane(title); + JPanel overviewPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(title); + if (needContentTip) { + UILabel tipsLabel = ShareUIUtils.createTipsLabel(Toolkit.i18nText("Fine-Design_Share_Generate_Content_Tip")); + tipsLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); + JPanel panel = new JPanel(FRGUIPaneFactory.createBorderLayout()); + panel.add(tipsLabel); + overviewPane.add(panel, BorderLayout.NORTH); + } overviewPane.add(componentPane, BorderLayout.CENTER); return overviewPane; From 77076eae38ad4eff198b29a3ffb9b265830f4b16 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 8 Jun 2021 17:19:23 +0800 Subject: [PATCH 08/14] =?UTF-8?q?REPORT-53135=20=E6=BC=8F=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mod/ContentReplaceUtil.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java b/designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java index 3b7d9e7715..f2afd5d8da 100644 --- a/designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java +++ b/designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java @@ -77,7 +77,6 @@ public class ContentReplaceUtil { content = getFormulaPureContent(content); FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer(); frFormulaTransformer.addRenamedWidget(oldName, newName); - frFormulaTransformer.addRenamedParameter(oldName, newName); return EQ_STRING + frFormulaTransformer.transform(content); } From 59d5958c8cc39df0bd7182ea0f39ab7b6e06d89f Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 8 Jun 2021 18:54:16 +0800 Subject: [PATCH 09/14] =?UTF-8?q?REPORT-53133=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8-=E5=90=88=E5=85=A5=E4=B8=BB=E7=89=88?= =?UTF-8?q?=E6=9C=AC-=E6=9C=89=E4=BF=A9=E5=95=86=E5=9F=8E=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E4=B8=8B=E6=9D=A5=E7=9A=84=E5=A4=8D=E7=94=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E6=8B=96=E5=85=A5=E5=90=8E=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=A0=91=E5=A4=84=E6=B2=A1=E6=98=BE=E7=A4=BA=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E5=9B=BE=E6=A0=87=EF=BC=8C=E9=BA=BB?= =?UTF-8?q?=E7=83=A6=E7=9C=8B=E4=B8=8B=E6=98=AF=E8=BF=99=E4=BF=A9=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=BB=93=E6=9E=84=E6=9C=89=E5=95=A5=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=98=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/creator/XWTitleLayout.java | 17 ++++++++++++++++- .../treeview/ComponentTreeCellRenderer.java | 14 ++------------ .../share/util/ShareComponentUtils.java | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java index 7401b5ede0..bfa841a4a5 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java @@ -112,6 +112,21 @@ public class XWTitleLayout extends DedicateLayoutContainer { return null; } + + /** + * 返回body组件 + * @return body组件 + */ + public XCreator getBodyCreator() { + for (int i=0; i < getXCreatorCount(); i++) { + XCreator creator = getXCreator(i); + if (creator.hasTitleStyle()) { + return creator; + } + } + return null; + } + /** * 编辑状态的时候需要重新绘制下边框 * @@ -196,4 +211,4 @@ public class XWTitleLayout extends DedicateLayoutContainer { super.setShareId(shareId); this.getEditingChildCreator().setShareId(shareId); } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java b/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java index f310adc42f..e3b9b81750 100644 --- a/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java +++ b/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java @@ -1,13 +1,11 @@ package com.fr.design.designer.treeview; import com.fr.base.BaseUtils; -import com.fr.base.iofile.attr.ExtendSharableAttrMark; import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; -import com.fr.form.ui.AbstractBorderStyleWidget; +import com.fr.design.mainframe.share.util.ShareComponentUtils; import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -38,7 +36,7 @@ public class ComponentTreeCellRenderer extends DefaultTreeCellRenderer { } if (icon != null) { setIcon(icon); - this.needAddShareIcon = isShareWidget((XCreator) value); + this.needAddShareIcon = ShareComponentUtils.isShareWidgetWithChild((XCreator) value); } } @@ -47,14 +45,6 @@ public class ComponentTreeCellRenderer extends DefaultTreeCellRenderer { return this; } - private boolean isShareWidget(XCreator xCreator) { - if (!xCreator.toData().acceptType(AbstractBorderStyleWidget.class)) { - return false; - } - ExtendSharableAttrMark attrMark = ((AbstractBorderStyleWidget) xCreator.toData()).getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG); - return attrMark != null && StringUtils.isNotEmpty(attrMark.getShareId()); - - } public void paint(Graphics g) { super.paint(g); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java index 485c44149b..80162a4065 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java @@ -5,6 +5,7 @@ import com.fr.base.iofile.attr.ExtendSharableAttrMark; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWTitleLayout; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.FormSelection; @@ -91,6 +92,19 @@ public class ShareComponentUtils { return false; } + public static boolean isShareWidgetWithChild(XCreator xCreator) { + boolean result = isShareWidget(xCreator); + if (result) { + return true; + } + //做下兼容处理,老的组件结构的共享信息存储在子组件上 + if (xCreator instanceof XWTitleLayout) { + XCreator child = ((XWTitleLayout) xCreator).getBodyCreator(); + return isShareWidget(child); + } + return false; + } + public static List getHelpConfigXCreatorList(XCreator root) { List helpConfigXCreatorList = new ArrayList<>(); From ed8b36a8ad5c15234bef9a3cc8d307d6f87bed89 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 8 Jun 2021 19:06:47 +0800 Subject: [PATCH 10/14] =?UTF-8?q?REPORT-52539=20window=E4=B8=8A=E7=94=9F?= =?UTF-8?q?=E6=88=90=E9=9D=A2=E6=9D=BF=E5=87=BA=E7=8E=B0=E4=BA=86=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/share/ui/generate/EffectContent.java | 4 ++-- .../com/fr/design/share/ui/generate/ShareGeneratePane.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java index 4fef5f51a4..0eeda7731c 100644 --- a/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java @@ -56,8 +56,8 @@ public class EffectContent extends JPanel { Object[] columnNames = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_From"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Rename")}; JTable table = new JTable(new EffectTableModel(effectItemGroup, columnNames)); table.setRowHeight(25); - table.getColumnModel().getColumn(0).setPreferredWidth(235); - table.getColumnModel().getColumn(1).setPreferredWidth(325); + table.getColumnModel().getColumn(0).setPreferredWidth(230); + table.getColumnModel().getColumn(1).setPreferredWidth(320); table.setDefaultEditor(EffectTableModel.class, new EffectItemEditor(table)); diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java index 82eb60f08a..3ba8bb8e6c 100644 --- a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java @@ -56,7 +56,7 @@ import static javax.swing.JOptionPane.ERROR_MESSAGE; **/ public class ShareGeneratePane extends BasicPane { - private static final Dimension DIALOG_SIZE = new Dimension(670, 740); + private static final Dimension DIALOG_SIZE = new Dimension(670, 760); private static final Dimension DIALOG_NORMAL_SIZE = new Dimension(670, 610); private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6); From 70e34c211787f3029517c03e31d1cf1561762cc6 Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Tue, 8 Jun 2021 19:44:39 +0800 Subject: [PATCH 11/14] =?UTF-8?q?REPORT-53367=20=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E5=90=8Esql-=E8=BF=9C=E7=A8=8B=E4=B8=8B?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E7=9A=84=E8=BD=AC=E4=B9=89=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E6=8F=90=E7=A4=BA=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/preview/sql/PreviewPerformedSqlPane.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java index bf210380bc..7f75d4d3a1 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java @@ -6,6 +6,7 @@ import com.fr.base.ParameterMapNameSpace; import com.fr.data.impl.DBTableData; import com.fr.data.impl.EscapeSqlHelper; import com.fr.data.operator.DataOperator; +import com.fr.decision.config.PreventSqlInjConfig; import com.fr.decision.webservice.v10.config.ConfigService; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.link.MessageWithLink; @@ -18,6 +19,7 @@ import com.fr.design.parameter.ParameterInputPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; +import com.fr.invoke.Reflect; import com.fr.log.FineLoggerFactory; import com.fr.plugin.injectable.PluginModule; import com.fr.script.Calculator; @@ -180,6 +182,10 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener { calculator.pushNameSpace(ns); Parameter[] paras = processParameters(tableData, calculator); // 所有被转义参数的集合 + //这里比较恶心。方法1是通过在DataOperatorProvider新增rpc接口,交由服务器去获取转义字符。但是要考虑兼容问题: + //新设计器jar远程老服务器jar,需要提供Compatible实现,但是这个实现能做什么呢?目前没有老的接口可以去获取服务器的转义字符,仍然啥也做不了; + //现在采用方法2,通过反射调用PreventSqlInjConfig的刷新方法(因为这个方法是private,直接改成public仍然有兼容问题) + Reflect.on(PreventSqlInjConfig.class).call("refreshPreventSqlInjConfig"); Set specialCharParam = EscapeSqlHelper.getInstance().getSpecialCharParam(paras); // 将参数转义等 Set tableDataProviders = getTableDataProviders(); From d8dc68e440fb24f8680d77c2a1a2e9484e67e7cb Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Tue, 8 Jun 2021 19:50:26 +0800 Subject: [PATCH 12/14] =?UTF-8?q?REPORT-53367=20=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E5=90=8Esql-=E8=BF=9C=E7=A8=8B=E4=B8=8B?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E7=9A=84=E8=BD=AC=E4=B9=89=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E6=8F=90=E7=A4=BA=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/preview/sql/PreviewPerformedSqlPane.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java index 7f75d4d3a1..d86b6ad6cd 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java @@ -182,9 +182,10 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener { calculator.pushNameSpace(ns); Parameter[] paras = processParameters(tableData, calculator); // 所有被转义参数的集合 - //这里比较恶心。方法1是通过在DataOperatorProvider新增rpc接口,交由服务器去获取转义字符。但是要考虑兼容问题: - //新设计器jar远程老服务器jar,需要提供Compatible实现,但是这个实现能做什么呢?目前没有老的接口可以去获取服务器的转义字符,仍然啥也做不了; - //现在采用方法2,通过反射调用PreventSqlInjConfig的刷新方法(因为这个方法是private,直接改成public仍然有兼容问题) + // 远程时如何获取服务器上的转义字符?这里比较恶心 + // 方法1是新增rpc接口,交由服务器去获取转义字符。但是要考虑兼容问题: + // 新设计器jar远程老服务器jar,需要提供Compatible实现,但是这个实现能做什么呢?目前没有老的接口可以去获取服务器的转义字符,仍然啥也做不了; + // 现在采用方法2,通过反射调用PreventSqlInjConfig的刷新方法(因为它是decision模块的private方法,直接改成public仍然有兼容问题) Reflect.on(PreventSqlInjConfig.class).call("refreshPreventSqlInjConfig"); Set specialCharParam = EscapeSqlHelper.getInstance().getSpecialCharParam(paras); // 将参数转义等 From 310eb160bdce1a6ee58817ba7bd6cf05bcb356da Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Tue, 8 Jun 2021 20:10:02 +0800 Subject: [PATCH 13/14] =?UTF-8?q?REPORT-53362=20=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E5=90=8Esql-=E9=BC=A0=E6=A0=87=E6=82=AC?= =?UTF-8?q?=E6=B5=AE=E6=9F=A5=E7=9C=8B=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=EF=BC=8C=E4=BC=9A=E5=A4=9A=E5=87=BA=E6=9D=A5=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E6=89=A7=E8=A1=8Csql=E7=9A=84=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../preview/sql/PreviewPerformedSqlPane.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java index d86b6ad6cd..8ddf261cfd 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java @@ -48,6 +48,8 @@ import java.awt.Frame; import java.awt.datatransfer.StringSelection; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -146,6 +148,12 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener { this.add(centerPanel, BorderLayout.CENTER); this.add(bottomPanel, BorderLayout.SOUTH); this.setSize(600, 400); + this.addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + close(); + } + }); GUICoreUtils.centerWindow(this); } @@ -272,4 +280,8 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener { public void actionPerformed(ActionEvent e) { this.dispose(); } + + private void close() { + this.dispose(); + } } From 3af622275391f496956161d41650569a460a6299 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Wed, 9 Jun 2021 09:23:02 +0800 Subject: [PATCH 14/14] =?UTF-8?q?REPORT-53592=20=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E5=88=9B=E5=BB=BA=E5=85=B1=E4=BA=AB=E7=BB=84?= =?UTF-8?q?=E4=BB=B6npe=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/share/effect/EffectItemGroup.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java index 91d842c61e..c04932d0d7 100644 --- a/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java +++ b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java @@ -113,7 +113,7 @@ public class EffectItemGroup { Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class); Plot plot = chart.getPlot(); if (plot == null) { - break; + continue; } SourceNode chartSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), cellSourceNode); initChartPlot(plot, chartSourceNode, false); @@ -131,7 +131,7 @@ public class EffectItemGroup { Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class); Plot plot = chart.getPlot(); if (plot == null) { - break; + continue; } SourceNode plotSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), null); initChartPlot(plot, plotSourceNode, false);