From 2b2fd78d01ffe9224dac9dcb799109f8c7e6a6ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=B8=96=E8=B1=AA?= <1944167742@qq.com> Date: Fri, 12 Jul 2024 17:20:32 +0800 Subject: [PATCH 01/24] =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=BC=95=E6=93=8E?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=BC=B9=E7=AA=97=E7=BF=BB=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/itree/filetree/TemplateFileTree.java | 17 ++++++++++++++--- .../design/javascript/ExportJavaScriptPane.java | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java index b87a70b5b6..998c55e3a3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java @@ -38,10 +38,17 @@ public class TemplateFileTree extends EnvFileTree { private static final int MAX_NODE_EXPAND_NUM = 50; private static final int MAX_MATCHED_NODE_NUM = 500; + private boolean exportTemplate = false; + public TemplateFileTree() { super(ProjectConstants.REPORTLETS_NAME, null, null); } + public TemplateFileTree(boolean exportTemplate) { + this(); + this.exportTemplate = exportTemplate; + } + /* * 选中reportPath */ @@ -152,13 +159,17 @@ public class TemplateFileTree extends EnvFileTree { Set supportTypes = new HashSet(); if (filter != null) { for (String temp : filter.getSupportedTypes()) { - supportTypes.add(FileExtension.parse(temp)); + if (!(exportTemplate && temp.endsWith("fvs"))) { + supportTypes.add(FileExtension.parse(temp)); + } } } Set apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); for (App temp : apps) { - for (String extendsion : temp.defaultExtensions()) { - supportTypes.add(FileExtension.parse(extendsion)); + for (String extension : temp.defaultExtensions()) { + if (!(exportTemplate && extension.endsWith("fvs"))) { + supportTypes.add(FileExtension.parse(extension)); + } } } return supportTypes; diff --git a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java index 6c2e46e985..8fce015398 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java @@ -965,7 +965,7 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane Date: Mon, 15 Jul 2024 10:56:03 +0800 Subject: [PATCH 02/24] =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=BC=95=E6=93=8E?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=BC=B9=E7=AA=97=E7=BF=BB=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/itree/filetree/TemplateFileTree.java | 16 ++++------------ .../design/javascript/ExportJavaScriptPane.java | 4 ++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java index 998c55e3a3..c0f9c14c68 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java @@ -38,17 +38,10 @@ public class TemplateFileTree extends EnvFileTree { private static final int MAX_NODE_EXPAND_NUM = 50; private static final int MAX_MATCHED_NODE_NUM = 500; - private boolean exportTemplate = false; - public TemplateFileTree() { super(ProjectConstants.REPORTLETS_NAME, null, null); } - public TemplateFileTree(boolean exportTemplate) { - this(); - this.exportTemplate = exportTemplate; - } - /* * 选中reportPath */ @@ -159,16 +152,15 @@ public class TemplateFileTree extends EnvFileTree { Set supportTypes = new HashSet(); if (filter != null) { for (String temp : filter.getSupportedTypes()) { - if (!(exportTemplate && temp.endsWith("fvs"))) { - supportTypes.add(FileExtension.parse(temp)); - } + supportTypes.add(FileExtension.parse(temp)); } } Set apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); for (App temp : apps) { for (String extension : temp.defaultExtensions()) { - if (!(exportTemplate && extension.endsWith("fvs"))) { - supportTypes.add(FileExtension.parse(extension)); + FileExtension fileExtension = FileExtension.parse(extension); + if (filter == null || !filter.getNotSupportedTypes().contains(fileExtension)) { + supportTypes.add(fileExtension); } } } diff --git a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java index 8fce015398..84d681c529 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java @@ -965,8 +965,8 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane Date: Wed, 14 Aug 2024 10:21:09 +0800 Subject: [PATCH 03/24] =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=89=AA=E5=88=87?= =?UTF-8?q?=E3=80=81=E5=A4=8D=E5=88=B6=E6=8C=89=E9=92=AEfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/parameter/FormParaDesigner.java | 18 ++++++++++++++++-- .../com/fr/design/mainframe/FormDesigner.java | 12 ++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java index 20f8203ace..5a3eb5a8ab 100644 --- a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java @@ -88,6 +88,8 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP private static Image paraImage = BaseUtils.readImage("/com/fr/design/images/form/parameter.png"); + private UpdateAction[] basicMainPaneActions; + public FormParaDesigner() { this(new FormParameterUI()); } @@ -342,6 +344,14 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP return designerActions.toArray(new UpdateAction[designerActions.size()]); } + public UpdateAction[] getBasicMainActions() { + if (basicMainPaneActions == null) { + basicMainPaneActions = new UpdateAction[]{new CutAction(this), new CopyAction(this), new PasteAction(this), + new FormDeleteAction(this)}; + } + return basicMainPaneActions; + } + private boolean searchQueryCreators(XLayoutContainer rootContainer) { boolean b = false; for (int i = 0; i < rootContainer.getXCreatorCount(); i++) { @@ -736,8 +746,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP * @return 按钮组 a */ public JComponent[] toolBarButton4Form() { - return new JComponent[]{new CutAction(this).createToolBarComponent(), new CopyAction(this).createToolBarComponent(), new PasteAction(this).createToolBarComponent(), - new FormDeleteAction(this).createToolBarComponent()}; + UpdateAction[] actions = getBasicMainActions(); + JComponent[] components = new JComponent[actions.length]; + for (int i = 0; i < actions.length; i++) { + components[i] = actions[i].createToolBarComponent(); + } + return components; } @Override diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 87f7465490..bee2a32dc4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -777,6 +777,14 @@ public class FormDesigner extends TargetComponent
implements TreeSelection for (UpdateAction action : getActions()) { action.update(); } + + UpdateAction[] actions = getBasicMainActions(); + if (actions != null) { + for (UpdateAction action : actions) { + action.update(); + } + } + } } @@ -1485,6 +1493,10 @@ public class FormDesigner extends TargetComponent implements TreeSelection return designerActions.toArray(new UpdateAction[designerActions.size()]); } + public UpdateAction[] getBasicMainActions() { + return null; + } + private List getBasicActions(){ if (basicActions == null) { basicActions = new ArrayList(); From 884b5ed842d73ea7e7e331d443491fcc6e51ee20 Mon Sep 17 00:00:00 2001 From: renekton Date: Wed, 14 Aug 2024 10:26:53 +0800 Subject: [PATCH 04/24] =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=89=AA=E5=88=87?= =?UTF-8?q?=E3=80=81=E5=A4=8D=E5=88=B6=E6=8C=89=E9=92=AEfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/itree/filetree/TemplateFileTree.java | 7 ++----- .../com/fr/design/javascript/ExportJavaScriptPane.java | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java index c0f9c14c68..b87a70b5b6 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java @@ -157,11 +157,8 @@ public class TemplateFileTree extends EnvFileTree { } Set apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); for (App temp : apps) { - for (String extension : temp.defaultExtensions()) { - FileExtension fileExtension = FileExtension.parse(extension); - if (filter == null || !filter.getNotSupportedTypes().contains(fileExtension)) { - supportTypes.add(fileExtension); - } + for (String extendsion : temp.defaultExtensions()) { + supportTypes.add(FileExtension.parse(extendsion)); } } return supportTypes; diff --git a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java index 84d681c529..6c2e46e985 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java @@ -966,7 +966,7 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane Date: Wed, 14 Aug 2024 10:28:19 +0800 Subject: [PATCH 05/24] =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=89=AA=E5=88=87?= =?UTF-8?q?=E3=80=81=E5=A4=8D=E5=88=B6=E6=8C=89=E9=92=AEfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/form/parameter/FormParaDesigner.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java index 5a3eb5a8ab..bdca6c2ae5 100644 --- a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java @@ -344,6 +344,10 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP return designerActions.toArray(new UpdateAction[designerActions.size()]); } + /** + * 主面板区域控件按钮action组 + * @return + */ public UpdateAction[] getBasicMainActions() { if (basicMainPaneActions == null) { basicMainPaneActions = new UpdateAction[]{new CutAction(this), new CopyAction(this), new PasteAction(this), From 213181dc99a11f01a6a661e619fdb8ae624ff429 Mon Sep 17 00:00:00 2001 From: Anner Date: Wed, 21 Aug 2024 16:09:49 +0800 Subject: [PATCH 06/24] =?UTF-8?q?REPORT-126773=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E4=B8=BB=E9=A2=98=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=85=8D=E8=89=B2=E9=A2=84=E8=A7=88=E4=B8=8D=E7=94=9F=E6=95=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 9697113e27..def6cc51fa 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -268,9 +268,14 @@ public abstract class JTemplate> TemplateTheme usingTheme = getTemplateTheme(); boolean isUsingThemeChanged = StringUtils.equals(event.themName, usingTheme.getName()); - if (isUsingThemeChanged && (event.action == TemplateThemeConfig.ThemeConfigAction.REMOVE || - event.action == TemplateThemeConfig.ThemeConfigAction.UPDATE)) { - checkAndResetTheme(); + if (event.action == TemplateThemeConfig.ThemeConfigAction.REMOVE || + event.action == TemplateThemeConfig.ThemeConfigAction.UPDATE) { + if (isUsingThemeChanged) { + checkAndResetTheme(); + } else { + // 修改主题配置,但是没有修改主题名称 , 需要重新保存文件 + fireSuperTargetModified(); + } } } }; @@ -470,6 +475,7 @@ public abstract class JTemplate> /** * 用于 切换工作目录 时的模板资源暂存 + * * @return */ public FILE templateToStashFile4Envchange() { @@ -545,6 +551,7 @@ public abstract class JTemplate> /** * 刷新 模板资源 和 EditingFILE * 仅在切换工作目录,reload模板时使用 + * * @param file */ public void refreshResourceAndEditingFILE(FILE file) { @@ -1785,7 +1792,6 @@ public abstract class JTemplate> } - private CallbackSaveWorker saveAs(boolean showLoc) { FILE editingFILE = this.getEditingFILE(); if (editingFILE == null) { @@ -1975,7 +1981,6 @@ public abstract class JTemplate> } - @Override public void saveDirectly() { if (isSaving()) { @@ -2125,17 +2130,19 @@ public abstract class JTemplate> /** * 获取此模板所使用的tab栏操作类型 + * * @return */ - public String getTemplateTabOperatorType(){ + public String getTemplateTabOperatorType() { return DEFAULT_TAB_OPERATOR; } /** * 当前模板是否可以被保存 + * * @return 是/否 */ - public boolean canBeSaved(){ + public boolean canBeSaved() { return true; } @@ -2144,15 +2151,16 @@ public abstract class JTemplate> * * @return 是/否 */ - public boolean supportCache(){ + public boolean supportCache() { return true; } /** * 获取此模板在tab栏中显示的名称 + * * @return */ - public String getTabShowName(JTemplate jTemplate){ + public String getTabShowName(JTemplate jTemplate) { String name = TemplateUtils.createLockeTemplatedName(jTemplate, jTemplate.getTemplateName()); if (!jTemplate.isSaved() && !name.endsWith(" *")) { name += " *"; @@ -2162,9 +2170,10 @@ public abstract class JTemplate> /** * 切换环境之前是否需要保存 + * * @return */ - public boolean needSaveBeforeSwitchEnv(){ + public boolean needSaveBeforeSwitchEnv() { return false; } From f14b53bf60af72c90dd789393d2cec70d92c15ba Mon Sep 17 00:00:00 2001 From: Zhanying <2446962908@qq.com> Date: Wed, 4 Sep 2024 09:57:03 +0800 Subject: [PATCH 07/24] =?UTF-8?q?REPORT-132109=20fix:=20FVS=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=20=E6=B5=85=E8=89=B2=E4=B8=BB=E9=A2=98-=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E5=86=85=E5=90=88=E5=B9=B6=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E9=94=AE=E5=85=A5=E6=96=87=E5=AD=97=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E4=B8=BA=E7=99=BD=E8=89=B2(=E9=9D=9E=E9=BB=98?= =?UTF-8?q?=E8=AE=A4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/grid/selection/CellSelection.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java index ca95a933df..30790428b5 100644 --- a/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java +++ b/designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java @@ -407,7 +407,9 @@ public class CellSelection extends Selection { if (hasCellElement) { ec.merge(row, row + rowSpan - 1, column, column + columnSpan - 1); } else { - ec.addCellElement(DefaultThemedTemplateCellElementCase.createInstance(column, row, columnSpan, rowSpan, null), true); + TemplateCellElement cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row, columnSpan, rowSpan, null); + AdjustWorkBookDefaultStyleUtils.adjustCellElement(cellElement); + ec.addCellElement(cellElement, true); } return true; From 398b9397b57eccd340dd9ec275aa3945aca87ecf Mon Sep 17 00:00:00 2001 From: renekton Date: Wed, 4 Sep 2024 16:21:27 +0800 Subject: [PATCH 08/24] =?UTF-8?q?=E5=A2=9E=E5=8A=A0AppTypeFilter=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E6=8F=92=E4=BB=B6=E7=B1=BB=E5=9E=8B=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E4=B8=BA=E7=A9=BA=E5=88=99=E4=B8=8D=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/itree/filetree/TemplateFileTree.java | 21 +++++++++++++++---- .../javascript/ExportJavaScriptPane.java | 1 + 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java index b87a70b5b6..3b6e80874b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java @@ -7,6 +7,7 @@ import com.fr.design.file.NodeAuthProcessor; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.mainframe.App; import com.fr.design.mainframe.manager.search.TemplateTreeSearchManager; +import com.fr.file.filetree.AppTypeFilter; import com.fr.file.filetree.FileNode; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; @@ -19,6 +20,7 @@ import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; @@ -38,6 +40,8 @@ public class TemplateFileTree extends EnvFileTree { private static final int MAX_NODE_EXPAND_NUM = 50; private static final int MAX_MATCHED_NODE_NUM = 500; + protected AppTypeFilter appTypeFilter; + public TemplateFileTree() { super(ProjectConstants.REPORTLETS_NAME, null, null); } @@ -155,12 +159,17 @@ public class TemplateFileTree extends EnvFileTree { supportTypes.add(FileExtension.parse(temp)); } } - Set apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); - for (App temp : apps) { - for (String extendsion : temp.defaultExtensions()) { - supportTypes.add(FileExtension.parse(extendsion)); + if (appTypeFilter != null) { + Collections.addAll(supportTypes, appTypeFilter.getSupportedTypes()); + } else { + Set apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); + for (App temp : apps) { + for (String extendsion : temp.defaultExtensions()) { + supportTypes.add(FileExtension.parse(extendsion)); + } } } + return supportTypes; } @@ -360,6 +369,10 @@ public class TemplateFileTree extends EnvFileTree { } } + public void setAppTypeFilter(AppTypeFilter filter) { + appTypeFilter = filter; + } + private boolean notContained(String parentPath, ExpandMutableTreeNode treeNode) { List childList = currentTreeMode.getOrDefault(parentPath, new ArrayList<>()); String name = ((FileNode) (treeNode.getUserObject())).getName(); diff --git a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java index 6c2e46e985..dc9907f237 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java @@ -968,6 +968,7 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane new FileExtension[]{}); cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE"); this.refreshEnv(); From f09af5d353acdb9ac918e472cac7d3d2e8612c45 Mon Sep 17 00:00:00 2001 From: obo Date: Sat, 14 Sep 2024 15:34:27 +0800 Subject: [PATCH 09/24] =?UTF-8?q?REPORT-106743=20fix:=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=9C=B0=E5=9B=BE=E8=8B=B1=E6=96=87=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/van/chart/map/designer/type/WMSLayerPane.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java index 67369d826f..f8d0145f51 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java @@ -57,14 +57,15 @@ public class WMSLayerPane extends JPanel implements UIObserver { public WMSLayerPane() { final double p = TableLayout.PREFERRED; double[] rowSize = {p}; - double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, 84, 44}; + double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, 84, 95}; wmsUrl = new UITextArea(); - connectButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Connect_WMP")); - + String connectionButtonText = Toolkit.i18nText("Fine-Design_Chart_Connect_WMP"); + connectButton = new UIButton(connectionButtonText); + connectButton.setToolTipText(connectionButtonText); Component[][] comps = new Component[][]{ - new Component[]{new UILabel("url"), wmsUrl, connectButton} + new Component[]{new UILabel("URL"), wmsUrl, connectButton} }; JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, COLUMN_SIZE); northPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); From d878d8a94783b492a3a6f4d394f0178e4f1fba7a Mon Sep 17 00:00:00 2001 From: obo Date: Sat, 14 Sep 2024 15:37:42 +0800 Subject: [PATCH 10/24] =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=B8=8D=E7=94=A8?= =?UTF-8?q?=E5=8A=A0tooltip=EF=BC=8C=E5=9B=9E=E6=BB=9A=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/van/chart/map/designer/type/WMSLayerPane.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java index f8d0145f51..438af39695 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java @@ -61,9 +61,7 @@ public class WMSLayerPane extends JPanel implements UIObserver { wmsUrl = new UITextArea(); - String connectionButtonText = Toolkit.i18nText("Fine-Design_Chart_Connect_WMP"); - connectButton = new UIButton(connectionButtonText); - connectButton.setToolTipText(connectionButtonText); + connectButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Connect_WMP")); Component[][] comps = new Component[][]{ new Component[]{new UILabel("URL"), wmsUrl, connectButton} }; From 93ac7196f7c36357f4e5fe622bb129cdad656f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=AF=E9=B9=8F=20=E7=94=B3?= Date: Wed, 18 Sep 2024 10:53:11 +0800 Subject: [PATCH 11/24] =?UTF-8?q?REPORT-134777=20=E8=B6=85=E9=93=BE?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=94=AF=E6=8C=81=E5=85=AC=E5=BC=8F=E8=AE=A1?= =?UTF-8?q?=E7=AE=97-=E5=85=A8=E5=B1=80=E6=9F=A5=E6=89=BE=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E4=B8=8D=E5=88=B0=E6=8E=A7=E4=BB=B6=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../content/formula/FormulaReplaceObject.java | 41 ++++++++++++++++--- .../action/content/formula/FormulaTag.java | 13 +++++- .../formula/cell/SearchCellFormulaAction.java | 15 +++++-- .../AbstractSearchWidgetFormulaAction.java | 27 ++++++++++-- .../actions/replace/info/base/SearchTag.java | 4 ++ 5 files changed, 86 insertions(+), 14 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java index a58ae83d11..f80601fa25 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java @@ -4,27 +4,24 @@ import com.fr.base.BaseFormula; import com.fr.base.Formula; import com.fr.base.Parameter; import com.fr.base.StoreProcedureParameter; -import com.fr.base.core.KV; import com.fr.base.iofile.attr.WatermarkAttr; import com.fr.base.present.FormulaPresent; -import com.fr.base.present.Present; import com.fr.data.condition.FormulaCondition; import com.fr.data.core.Compare; import com.fr.design.actions.replace.info.DealWithInfoValue; import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.design.file.HistoryTemplateListCache; -import com.fr.form.main.Form; -import com.fr.function.IF; import com.fr.general.GeneralUtils; +import com.fr.js.NameJavaScript; import com.fr.js.SingleJavaScript; import com.fr.main.impl.WorkBook; import com.fr.report.cell.cellattr.CellInsertPolicyAttr; -import com.fr.report.cell.cellattr.core.RichChar; import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.core.sort.sortexpression.FormulaSortExpression; import com.fr.stable.FormulaProvider; import com.fr.stable.ParameterProvider; +import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.collections.combination.Pair; import org.jetbrains.annotations.Nullable; @@ -545,6 +542,40 @@ public enum FormulaReplaceObject implements DealWithInfoValue { } return false; } + }, + + /** + * 超链名字 + */ + NAMEJAVASCRIPT("NameJavaScript") { + @Override + public Map getValue(Object... o) { + HashMap map = new HashMap<>(); + if (StringUtils.isNotEmpty(((NameJavaScript) o[0]).getName())) { + map.put("content", ((NameJavaScript) o[0]).getName()); + } + return map; + } + + @Override + public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { + Object replaceObject = info.getContent().getReplaceObject(); + info.updateOldStr(((NameJavaScript)replaceObject).getName(), findStr); + String str = ((NameJavaScript)replaceObject).getName(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + ((NameJavaScript)replaceObject).setName(ShowValueUtils.replaceAll(str, findStr, replaceStr)); + } + + @Override + public boolean check(Info info) { + if (info.getContent().getReplaceObject() instanceof NameJavaScript) { + NameJavaScript nameJavaScript = (NameJavaScript) info.getContent().getReplaceObject(); + if (StableUtils.canBeFormula(nameJavaScript.getName())) { + return StringUtils.equals(nameJavaScript.getName(), info.getContent().getOldShowStr()); + } + } + return false; + } }; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java index be35a76671..210bd3dc86 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java @@ -1,12 +1,12 @@ package com.fr.design.actions.replace.action.content.formula; -import com.fr.chart.chartdata.MeterReportDefinition; import com.fr.data.VerifyItem; import com.fr.data.impl.FormulaDictionary; import com.fr.design.actions.replace.info.DealWithInfoValue; import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.info.base.SearchTag; import com.fr.design.actions.replace.utils.ShowValueUtils; +import com.fr.form.ui.Widget; import com.fr.general.GeneralUtils; import com.fr.main.impl.WorkBook; import com.fr.plugin.chart.map.data.VanMapReportDefinition; @@ -173,6 +173,17 @@ public enum FormulaTag implements DealWithInfoValue { dictionary.setProduceFormula(ShowValueUtils.replaceAll(str, findStr, replaceStr)); } } + }, + WIDGET_LABEL(SearchTag.WIDGET_LABEL) { + @Override + public void setValue(Info info, String findStr, String replaceStr, List> operatorArray) { + if (info.getContent().getHoldObject() instanceof Widget) { + Widget widget = (Widget) info.getContent().getHoldObject(); + String str = widget.getLabelName(); + ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr); + widget.setLabelName(ShowValueUtils.replaceAll(str, findStr, replaceStr)); + } + } }; int index; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java index 39ccf32585..45a85d697a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java @@ -6,13 +6,13 @@ import com.fr.base.present.FormulaPresent; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.actions.replace.action.content.cell.SearchCellAction; import com.fr.design.actions.replace.action.content.formula.chart.SearchChartCollectionFormulaAction; -import com.fr.design.actions.replace.action.content.formula.highlight.condition.*; import com.fr.design.actions.replace.action.content.formula.highlight.SearchHighlightFormulaAction; +import com.fr.design.actions.replace.action.content.formula.highlight.condition.SearchConditionFormula; +import com.fr.design.actions.replace.action.content.formula.highlight.condition.SearchConditionManager; import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchJSHighlightAction; import com.fr.design.actions.replace.action.content.formula.widget.DictionaryType; import com.fr.design.actions.replace.info.CellInfo; import com.fr.design.actions.replace.info.FormulaInfo; - import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.actions.replace.info.base.SearchTag; import com.fr.design.i18n.Toolkit; @@ -29,7 +29,7 @@ import com.fr.report.core.sort.common.CellSortAttr; import com.fr.report.core.sort.sortexpression.FormulaSortExpression; import com.fr.report.core.sort.sortexpression.SortExpression; import com.fr.stable.CommonUtils; - +import com.fr.stable.StableUtils; import java.util.List; import java.util.Map; @@ -119,7 +119,14 @@ public class SearchCellFormulaAction implements SearchCellFormula { for (int i = 0; i < nameJavaScriptGroup.size(); i++) { SearchJSHighlightAction action = SearchJSHighlightAction.getInstance(); ITContent content = ITContent.copy(cellInfo.getContent()); - content.addOtherPos(nameJavaScriptGroup.getNameHyperlink(i).getName()); + String name = nameJavaScriptGroup.getNameHyperlink(i).getName(); + if(StableUtils.canBeFormula(name)){ + ITContent newContent = ITContent.copy(content); + newContent.setReplaceObject(nameJavaScriptGroup.getNameHyperlink(i)); + newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Hyperlink")); + formulaInfos.add(new FormulaInfo(newContent)); + } + content.addOtherPos(name); action.searchJSFormulaFromOther(formulaInfos, content, nameJavaScriptGroup.getNameHyperlink(i).getJavaScript()); } } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/AbstractSearchWidgetFormulaAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/AbstractSearchWidgetFormulaAction.java index d8ff30f79e..5cb8aca91a 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/AbstractSearchWidgetFormulaAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/AbstractSearchWidgetFormulaAction.java @@ -4,12 +4,14 @@ import com.fr.base.Formula; import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchJSHighlightAction; import com.fr.design.actions.replace.info.FormulaInfo; import com.fr.design.actions.replace.info.base.ITContent; +import com.fr.design.actions.replace.info.base.SearchTag; import com.fr.design.i18n.Toolkit; import com.fr.form.event.Listener; import com.fr.form.ui.DataControl; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.widget.CRBoundsWidget; +import com.fr.stable.StableUtils; import java.util.List; @@ -33,12 +35,13 @@ public abstract class AbstractSearchWidgetFormulaAction implements SearchWidgetF Widget widget = (Widget) content.getReplaceObject(); //控件值中的公式 searchFormulaFromWidgetValue(content, formulaInfos); + searchFormulaFromWidgetLabel(content, formulaInfos); for (int i = 0; i < widget.getListenerSize(); i++) { Listener listener = widget.getListener(i); ITContent newContent = ITContent.copy(content); //控件的事件可以使用的JS有五种,这边统一交给Highlight那边判断超级链接并进行处理 SearchJSHighlightAction jsHighlightAction = SearchJSHighlightAction.getInstance(); - newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Event"),listener.getName()); + newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Event"), listener.getName()); jsHighlightAction.searchJSFormulaFromOther(formulaInfos, newContent, listener.getAction()); } @@ -53,8 +56,8 @@ public abstract class AbstractSearchWidgetFormulaAction implements SearchWidgetF @Override public void searchFormulaFromWidgetValue(ITContent content, List formulaInfos) { Widget widget = (Widget) content.getReplaceObject(); - if (widget instanceof WScaleLayout){ - widget = ((CRBoundsWidget)((WScaleLayout)widget).getWidget(0)).getWidget(); + if (widget instanceof WScaleLayout) { + widget = ((CRBoundsWidget) ((WScaleLayout) widget).getWidget(0)).getWidget(); } if (widget instanceof DataControl) { if (isWidgetValueValid(((DataControl) widget))) { @@ -66,7 +69,23 @@ public abstract class AbstractSearchWidgetFormulaAction implements SearchWidgetF } } - private boolean isWidgetValueValid(DataControl control){ + public void searchFormulaFromWidgetLabel(ITContent content, List formulaInfos) { + Widget widget = (Widget) content.getReplaceObject(); + if (widget instanceof WScaleLayout) { + widget = ((CRBoundsWidget) ((WScaleLayout) widget).getWidget(0)).getWidget(); + } + if (StableUtils.canBeFormula(widget.getLabelName())) { + ITContent newContent = ITContent.copy(content); + newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Form_Label_Name")); + newContent.setHoldObject(widget); + newContent.setReplaceObject(widget.getLabelName()); + newContent.setTag(SearchTag.WIDGET_LABEL); + formulaInfos.add(new FormulaInfo(newContent)); + } + } + + + private boolean isWidgetValueValid(DataControl control) { return control.getWidgetValue() != null && control.getWidgetValue().getValue() instanceof Formula; } diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java index b5e202bcb1..4664d3b2c7 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java @@ -56,6 +56,10 @@ public class SearchTag { * 引用JS */ public static final int IMPORT_JS = 11; + /** + * 控件-标签名称 + */ + public static final int WIDGET_LABEL = 12; From c9acbcae37847bb104a7525eb8bb3063b77b1cad Mon Sep 17 00:00:00 2001 From: "shengzu.xue" Date: Wed, 18 Sep 2024 10:30:26 +0800 Subject: [PATCH 12/24] =?UTF-8?q?REPORT-131817=20=E9=AB=98=E5=BE=B7?= =?UTF-8?q?=E5=9B=BD=E4=BA=A7=E5=9B=BE=E5=B1=82=E6=9B=BF=E6=8D=A2Mapbox?= =?UTF-8?q?=E5=9B=BE=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/van/chart/map/designer/type/GisLayerPane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java index 37f178e196..bc224ac922 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java @@ -254,6 +254,7 @@ public class GisLayerPane extends JPanel implements UIObserver { } public void populate(GisLayer layer) { + layer.convertMapboxLayer(); switch (layer.getGisLayerType()) { case AUTO: gisButton.setSelectedIndex(0); From 05b06432a1676bf69b4a6e56335089b5c3e0c75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Thu, 19 Sep 2024 14:03:40 +0800 Subject: [PATCH 13/24] =?UTF-8?q?REPORT-132457=20fix:=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=8F=82=E6=95=B0=E6=A0=8F=E7=BB=84=E4=BB=B6=E5=B0=8F?= =?UTF-8?q?=E7=AA=97=E8=AE=BE=E7=BD=AE=E5=B1=95=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/EastRegionContainerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 1357b48354..314e2dc1c2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -84,7 +84,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30; // 弹出对话框高度 private static final int POPUP_MIN_HEIGHT = 145; - private static final int POPUP_DEFAULT_HEIGHT = 356; + private static final int POPUP_DEFAULT_HEIGHT = 600; public static final String KEY_CELL_ELEMENT = "cellElement"; public static final String KEY_CELL_ATTR = "cellAttr"; public static final String KEY_FLOAT_ELEMENT = "floatElement"; From d6e5cd8f31266f6c9ca0154581c6fb2511356306 Mon Sep 17 00:00:00 2001 From: "Richard.Fang" Date: Thu, 19 Sep 2024 15:15:38 +0800 Subject: [PATCH 14/24] =?UTF-8?q?REPORT-130762=20feat:JNDI=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E6=8F=90=E4=BE=9B=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/connect/ConnectionListPane.java | 7 +++++++ .../connect/DatabaseConnectionPane.java | 9 ++++++++- .../datapane/preview/PreviewTablePane.java | 19 +++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index 6bfd0a37f0..a8468c101d 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -8,6 +8,7 @@ import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.metric.utils.DatabaseConnectionMetricHandler; import com.fr.data.operator.DataOperator; +import com.fr.decision.webservice.exception.security.SecurityRestrictionException; import com.fr.design.ExtraDesignClassManager; import com.fr.general.MapCompareUtils; import com.fr.design.dialog.BasicDialog; @@ -24,7 +25,9 @@ import com.fr.general.NameObject; import com.fr.license.database.DBTypes; import com.fr.license.database.DataBaseTypePointManager; import com.fr.license.exception.DataBaseNotSupportedException; +import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; +import com.fr.security.SecurityConfig; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; @@ -233,6 +236,10 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh if (connection instanceof JDBCDatabaseConnection) { DatabaseConnectionMetricHandler.handleSaveConnection((JDBCDatabaseConnection) connection, null); } + // JNDI禁用提示 + if (connection instanceof JNDIDatabaseConnection && SecurityConfig.getInstance().isDisableJNDI()) { + throw new SecurityRestrictionException(InterProviderFactory.getProvider().getLocText("Fine-Datasource_JNDI_Disabled")); + } default: break; } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index 11c3f64d64..05f916f4ef 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -14,6 +14,7 @@ import com.fr.data.solution.entity.DriverPage; import com.fr.data.solution.processor.ClassNotFoundExceptionSolutionProcessor; import com.fr.data.solution.processor.SolutionProcessor; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icontainer.UIScrollPane; @@ -22,9 +23,11 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.rpc.ExceptionHandler; import com.fr.rpc.RPCInvokerExceptionInfo; +import com.fr.security.SecurityConfig; import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; @@ -42,6 +45,7 @@ import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import javax.swing.UIManager; +import javax.swing.JOptionPane; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; @@ -95,7 +99,10 @@ public abstract class DatabaseConnectionPane connectionThread = new TestConnectionWorker(); midPane.setVisible(false); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index ffac1388c6..fe4dc5b79e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -7,10 +7,14 @@ import com.fr.base.TableData; import com.fr.base.svg.IconUtils; import com.fr.data.TableDataSource; import com.fr.data.desensitize.base.DesensitizationTableData; +import com.fr.data.impl.Connection; import com.fr.data.impl.DBTableData; import com.fr.data.impl.EmbeddedTableData; +import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.impl.NameDataModel; +import com.fr.data.impl.NameDatabaseConnection; import com.fr.data.operator.DataOperator; +import com.fr.decision.webservice.exception.security.SecurityRestrictionException; import com.fr.design.DesignerEnvManager; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager; @@ -37,8 +41,10 @@ import com.fr.esd.query.StrategicTableData; import com.fr.function.TIME; import com.fr.general.FRFont; import com.fr.general.data.DataModel; +import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; +import com.fr.security.SecurityConfig; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JComponent; @@ -589,11 +595,24 @@ public class PreviewTablePane extends BasicPane { if (tableData instanceof DBTableData) { boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase()); if (!status) { + validateJndiDisabled(((DBTableData) tableData).getDatabase()); throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); } } } + /** + * 校验下是否为JNDI连接且禁用该功能,若是显示禁用信息提示 + * @param connection + */ + private void validateJndiDisabled(Connection connection) throws SecurityRestrictionException { + if(connection instanceof NameDatabaseConnection && ((NameDatabaseConnection) connection).getConnection() instanceof JNDIDatabaseConnection) { + if(SecurityConfig.getInstance().isDisableJNDI()) { + throw new SecurityRestrictionException(InterProviderFactory.getProvider().getLocText("Fine-Datasource_JNDI_Disabled")); + } + } + } + /** * 处理预览Model的列类型 * From 7a58801baeda43b0a03c93a5c9ec778c2081d7c1 Mon Sep 17 00:00:00 2001 From: "Richard.Fang" Date: Thu, 19 Sep 2024 15:15:38 +0800 Subject: [PATCH 15/24] =?UTF-8?q?REPORT-130762=20feat:JNDI=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E6=8F=90=E4=BE=9B=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/connect/ConnectionListPane.java | 6 ++++++ .../connect/DatabaseConnectionPane.java | 8 +++++++- .../datapane/preview/PreviewTablePane.java | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index 6bfd0a37f0..3cfdc04458 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -8,6 +8,7 @@ import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.metric.utils.DatabaseConnectionMetricHandler; import com.fr.data.operator.DataOperator; +import com.fr.decision.webservice.exception.security.SecurityRestrictionException; import com.fr.design.ExtraDesignClassManager; import com.fr.general.MapCompareUtils; import com.fr.design.dialog.BasicDialog; @@ -25,6 +26,7 @@ import com.fr.license.database.DBTypes; import com.fr.license.database.DataBaseTypePointManager; import com.fr.license.exception.DataBaseNotSupportedException; import com.fr.log.FineLoggerFactory; +import com.fr.security.SecurityConfig; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; @@ -233,6 +235,10 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh if (connection instanceof JDBCDatabaseConnection) { DatabaseConnectionMetricHandler.handleSaveConnection((JDBCDatabaseConnection) connection, null); } + // JNDI禁用提示 + if (connection instanceof JNDIDatabaseConnection && SecurityConfig.getInstance().isDisableJNDI()) { + throw new SecurityRestrictionException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_JNDI_Disabled")); + } default: break; } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index 11c3f64d64..3efa87c32c 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -14,6 +14,7 @@ import com.fr.data.solution.entity.DriverPage; import com.fr.data.solution.processor.ClassNotFoundExceptionSolutionProcessor; import com.fr.data.solution.processor.SolutionProcessor; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icontainer.UIScrollPane; @@ -25,6 +26,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; import com.fr.rpc.ExceptionHandler; import com.fr.rpc.RPCInvokerExceptionInfo; +import com.fr.security.SecurityConfig; import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; @@ -42,6 +44,7 @@ import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import javax.swing.UIManager; +import javax.swing.JOptionPane; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; @@ -95,7 +98,10 @@ public abstract class DatabaseConnectionPane connectionThread = new TestConnectionWorker(); midPane.setVisible(false); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index ffac1388c6..5fea6eb958 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -7,10 +7,14 @@ import com.fr.base.TableData; import com.fr.base.svg.IconUtils; import com.fr.data.TableDataSource; import com.fr.data.desensitize.base.DesensitizationTableData; +import com.fr.data.impl.Connection; import com.fr.data.impl.DBTableData; import com.fr.data.impl.EmbeddedTableData; +import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.impl.NameDataModel; +import com.fr.data.impl.NameDatabaseConnection; import com.fr.data.operator.DataOperator; +import com.fr.decision.webservice.exception.security.SecurityRestrictionException; import com.fr.design.DesignerEnvManager; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager; @@ -39,6 +43,7 @@ import com.fr.general.FRFont; import com.fr.general.data.DataModel; import com.fr.log.FineLoggerFactory; +import com.fr.security.SecurityConfig; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JComponent; @@ -589,11 +594,24 @@ public class PreviewTablePane extends BasicPane { if (tableData instanceof DBTableData) { boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase()); if (!status) { + validateJndiDisabled(((DBTableData) tableData).getDatabase()); throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); } } } + /** + * 校验下是否为JNDI连接且禁用该功能,若是显示禁用信息提示 + * @param connection + */ + private void validateJndiDisabled(Connection connection) throws SecurityRestrictionException { + if(connection instanceof NameDatabaseConnection && ((NameDatabaseConnection) connection).getConnection() instanceof JNDIDatabaseConnection) { + if(SecurityConfig.getInstance().isDisableJNDI()) { + throw new SecurityRestrictionException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_JNDI_Disabled")); + } + } + } + /** * 处理预览Model的列类型 * From d17b810076546d44ded1117fb421d3c2bf770daf Mon Sep 17 00:00:00 2001 From: obo Date: Thu, 26 Sep 2024 11:09:42 +0800 Subject: [PATCH 16/24] =?UTF-8?q?REPORT-135046=20feat:=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E8=AF=AD=E8=A8=80=E5=88=87=E6=8D=A2=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=89=A9=E5=B1=95=E6=96=B0=E8=AF=AD=E7=A7=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/file/PreferencePane.java | 17 +++++++++++------ .../java/com/fr/design/utils/DesignUtils.java | 17 +++++++++++++++++ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index f8703275f8..64e59dfff0 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -40,19 +40,17 @@ import com.fr.design.mainframe.vcs.ui.UIPositiveIntEditor; import com.fr.design.mainframe.vcs.ui.VcsMovePanel; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.unit.UnitConvertUtil; +import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; -import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.general.log.Log4jConfig; import com.fr.io.attr.ImageExportAttr; -import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.report.ReportConfigManager; -import com.fr.scheduler.tool.FineScheduler; import com.fr.stable.Constants; import com.fr.stable.os.OperatingSystem; import com.fr.third.apache.logging.log4j.Level; @@ -76,7 +74,6 @@ import javax.swing.ButtonGroup; import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JFileChooser; -import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JProgressBar; @@ -89,7 +86,15 @@ import javax.swing.UIManager; import javax.swing.border.EmptyBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; @@ -816,7 +821,7 @@ public class PreferencePane extends BasicPane { } private UIDictionaryComboBox createLanguageComboBox() { - Map map = InterProviderFactory.getProvider().getSupportLocaleMap(); + Map map = DesignUtils.getAvailableLanguages(); int size = map.size(); Locale[] keys = new Locale[size]; String[] values = new String[size]; diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index e8c528ade2..c2be9dad09 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -19,10 +19,13 @@ import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.GeneralContext; +import com.fr.general.SupportLocale; +import com.fr.i18n.LanguageConfig; import com.fr.log.FineLoggerFactory; import com.fr.plugin.injectable.PluginModule; import com.fr.stable.ArrayUtils; import com.fr.stable.CommonCodeUtils; +import com.fr.stable.CommonUtils; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.bridge.ObjectHolder; @@ -50,8 +53,11 @@ import java.net.ServerSocket; import java.net.Socket; import java.net.URI; import java.nio.charset.StandardCharsets; +import java.util.Collections; import java.util.Enumeration; +import java.util.LinkedHashMap; import java.util.Locale; +import java.util.Map; import java.util.Set; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; @@ -496,4 +502,15 @@ public class DesignUtils { return Utils.getAvailableFontFamilyNames4Report(); } + /** + * 获取设计器可用的开放的语言配置,包括默认开放的五种语言和finedb扩展项 + * @return Locale和翻译对应的key + */ + public static Map getAvailableLanguages() { + Map map = new LinkedHashMap<>(SupportLocale.getInstance().getLocaleMap()); + for (Map.Entry entry : LanguageConfig.getInstance().getExtendedDesignLocales().entrySet()) { + map.put(CommonUtils.stringToLocale(entry.getKey()), entry.getValue()); + } + return Collections.unmodifiableMap(map); + } } From 8b638027035bb958ef175c4a0476ca2cf05427c7 Mon Sep 17 00:00:00 2001 From: obo Date: Thu, 26 Sep 2024 17:39:56 +0800 Subject: [PATCH 17/24] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=94=BE=E5=9C=A8?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i18n/DesignExtendLanguageConfig.java | 57 +++++++++++++++++++ .../java/com/fr/design/utils/DesignUtils.java | 4 +- 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/i18n/DesignExtendLanguageConfig.java diff --git a/designer-base/src/main/java/com/fr/design/i18n/DesignExtendLanguageConfig.java b/designer-base/src/main/java/com/fr/design/i18n/DesignExtendLanguageConfig.java new file mode 100644 index 0000000000..d2294faa83 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/i18n/DesignExtendLanguageConfig.java @@ -0,0 +1,57 @@ +package com.fr.design.i18n; + +import com.fr.config.ConfigContext; +import com.fr.config.DefaultConfiguration; +import com.fr.config.Identifier; +import com.fr.config.holder.factory.Holders; +import com.fr.config.holder.impl.MapConf; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * 设计器语言扩展配置 + * + * @author obo + * @since 11.0 + * Created on 2024/09/26 + */ +public class DesignExtendLanguageConfig extends DefaultConfiguration { + + private static volatile DesignExtendLanguageConfig designExtendLanguageConfig = null; + + /** + * + * @return + */ + public static DesignExtendLanguageConfig getInstance() { + if (designExtendLanguageConfig == null) { + designExtendLanguageConfig = ConfigContext.getConfigInstance(DesignExtendLanguageConfig.class); + } + return designExtendLanguageConfig; + } + + /** + * 设计器扩展的语言 + * key为localeString,例如en_US或en;value为改语言对应的国际化翻译key + */ + @Identifier("extendDesignLocales") + private MapConf> extendDesignLocales = Holders.map(new HashMap<>(), String.class, String.class); + + public Map getExtendedDesignLocales() { + return Collections.unmodifiableMap(extendDesignLocales.get()); + } + + public void setExtendedDesignLocales(Map map) { + extendDesignLocales.set(map); + } + + @Override + public Object clone() throws CloneNotSupportedException { + DesignExtendLanguageConfig cloned = (DesignExtendLanguageConfig) super.clone(); + cloned.extendDesignLocales = ( MapConf>) extendDesignLocales.clone(); + return cloned; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java index c2be9dad09..52059552b6 100644 --- a/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/DesignUtils.java @@ -11,6 +11,7 @@ import com.fr.design.dialog.FineJOptionPane; import com.fr.design.fun.DefaultValueAdjustProvider; import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.gui.UILookAndFeel; +import com.fr.design.i18n.DesignExtendLanguageConfig; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.ui.util.UIUtil; @@ -20,7 +21,6 @@ import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.GeneralContext; import com.fr.general.SupportLocale; -import com.fr.i18n.LanguageConfig; import com.fr.log.FineLoggerFactory; import com.fr.plugin.injectable.PluginModule; import com.fr.stable.ArrayUtils; @@ -508,7 +508,7 @@ public class DesignUtils { */ public static Map getAvailableLanguages() { Map map = new LinkedHashMap<>(SupportLocale.getInstance().getLocaleMap()); - for (Map.Entry entry : LanguageConfig.getInstance().getExtendedDesignLocales().entrySet()) { + for (Map.Entry entry : DesignExtendLanguageConfig.getInstance().getExtendedDesignLocales().entrySet()) { map.put(CommonUtils.stringToLocale(entry.getKey()), entry.getValue()); } return Collections.unmodifiableMap(map); From 83ad455a6794b2661942849b12b965f32c8c3f51 Mon Sep 17 00:00:00 2001 From: obo Date: Thu, 26 Sep 2024 17:40:12 +0800 Subject: [PATCH 18/24] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=94=BE=E5=9C=A8?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/i18n/DesignExtendLanguageConfig.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/i18n/DesignExtendLanguageConfig.java b/designer-base/src/main/java/com/fr/design/i18n/DesignExtendLanguageConfig.java index d2294faa83..27d0c839f7 100644 --- a/designer-base/src/main/java/com/fr/design/i18n/DesignExtendLanguageConfig.java +++ b/designer-base/src/main/java/com/fr/design/i18n/DesignExtendLanguageConfig.java @@ -22,8 +22,7 @@ public class DesignExtendLanguageConfig extends DefaultConfiguration { private static volatile DesignExtendLanguageConfig designExtendLanguageConfig = null; /** - * - * @return + * 获取实例 */ public static DesignExtendLanguageConfig getInstance() { if (designExtendLanguageConfig == null) { From 813ada35e87d3405b3ad84c080472c62b85f4d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Sun, 29 Sep 2024 18:56:30 +0800 Subject: [PATCH 19/24] =?UTF-8?q?REPORT-135106=20=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E5=8A=A0=E8=BD=BD=E9=97=AE=E9=A2=98=E5=92=8C?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E5=AF=BC=E8=87=B4=E7=9A=84=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E6=B6=88=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/editor/script/editor.js | 3 + .../com/fr/design/editor/script/i18n.js | 86 +++++++++++++++++-- 2 files changed, 84 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js index ec4de690d8..54a268c63d 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/editor.js @@ -128,6 +128,9 @@ if (key === "src") { return; } + + value = window.transformI18nText(value); + str += " " + key + "=\"" + value + "\""; if (key === "alt" && dataIdMap[value.trim()]) { diff --git a/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js index 205117f3cd..f80cc05e7c 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js +++ b/designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js @@ -21,7 +21,12 @@ "BI-Basic_Save": "保存", "BI-Basic_More": "更多", "BI-Custom_Color": "自定义颜色", - "BI-Transparent_Color": "透明" + "BI-Transparent_Color": "透明", + "Fine-Design_Chart_Category_Use_Name": "分类名", + "Fine-Design_Chart_Series_Name": "系列名", + "Fine-Design_Chart_Use_Value": "值", + "Fine-Design_Chart_Use_Percent": "百分比", + "Fine-Design_Chart_Use_Summary_Value": "汇总值" }; var taiwan = { @@ -45,7 +50,12 @@ "BI-Basic_Save": "保存", "BI-Basic_More": "更多", "BI-Custom_Color": "自定義顏色", - "BI-Transparent_Color": "透明" + "BI-Transparent_Color": "透明", + "Fine-Design_Chart_Category_Use_Name": "分類名", + "Fine-Design_Chart_Series_Name": "系列名", + "Fine-Design_Chart_Use_Value": "值", + "Fine-Design_Chart_Use_Percent": "百分比", + "Fine-Design_Chart_Use_Summary_Value": "匯總值" }; var english = { @@ -69,7 +79,12 @@ "BI-Basic_Save": "Save", "BI-Basic_More": "More", "BI-Custom_Color": "Custom Color", - "BI-Transparent_Color": "Transparent Color" + "BI-Transparent_Color": "Transparent Color", + "Fine-Design_Chart_Category_Use_Name": "Category Name", + "Fine-Design_Chart_Series_Name": "Series", + "Fine-Design_Chart_Use_Value": "Value", + "Fine-Design_Chart_Use_Percent": "Percentage", + "Fine-Design_Chart_Use_Summary_Value": "Summary Value" }; var japanese = { @@ -93,7 +108,12 @@ "BI-Basic_Save": "セーブ", "BI-Basic_More": "もっと", "BI-Custom_Color": "カスタムカラー", - "BI-Transparent_Color": "トランスペアレント" + "BI-Transparent_Color": "トランスペアレント", + "Fine-Design_Chart_Category_Use_Name": "分類名", + "Fine-Design_Chart_Series_Name": "系列名", + "Fine-Design_Chart_Use_Value": "値", + "Fine-Design_Chart_Use_Percent": "パーセンテージ", + "Fine-Design_Chart_Use_Summary_Value": "まとめ値" }; var korean = { @@ -117,7 +137,12 @@ "BI-Basic_Save": "저장", "BI-Basic_More": "더", "BI-Custom_Color": "맞춤 색상", - "BI-Transparent_Color": "투명한" + "BI-Transparent_Color": "투명한", + "Fine-Design_Chart_Category_Use_Name": "카테고리 명", + "Fine-Design_Chart_Series_Name": "표시값", + "Fine-Design_Chart_Use_Value": "값", + "Fine-Design_Chart_Use_Percent": "백분율", + "Fine-Design_Chart_Use_Summary_Value": "요약 값" }; function transformI18n(language) { @@ -144,5 +169,56 @@ } } + /** + * 将一个text转换成当前国际化语言环境的text + * @param text + * @returns {*} + */ + function transformI18nText(text) { + var i18nKey = _findI18nKey(text); + return window.BI.i18nText(i18nKey); + } + + /** + * 根据text找到i18n的key + * @param text + * @returns {string} + * @private + */ + function _findI18nKey(text) { + for (var [key, value] of Object.entries(chinese)) { + if (value === text) { + return key; + } + } + + for ([key, value] of Object.entries(taiwan)) { + if (value === text) { + return key; + } + } + + for ([key, value] of Object.entries(english)) { + if (value === text) { + return key; + } + } + + for ([key, value] of Object.entries(japanese)) { + if (value === text) { + return key; + } + } + + for ([key, value] of Object.entries(korean)) { + if (value === text) { + return key; + } + } + + return ''; + } + window.transformI18n = transformI18n; + window.transformI18nText = transformI18nText; }()); \ No newline at end of file From daf94d29f4ca58bac106e1be0b967d539b592b6a Mon Sep 17 00:00:00 2001 From: lidongy <1879087903@qq.com> Date: Wed, 9 Oct 2024 09:40:55 +0800 Subject: [PATCH 20/24] =?UTF-8?q?REPORT-134932=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E3=80=91=E5=8F=82=E6=95=B0=E9=9D=A2=E6=9D=BF=E7=9A=84?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E9=A2=9C=E8=89=B2=E4=BC=9A=E5=9C=A8=E2=80=9C?= =?UTF-8?q?=E6=92=A4=E5=9B=9E"=E6=8A=A5=E8=A1=A8=E4=B8=BB=E4=BD=93?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=97=B6=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 4 ++-- .../src/main/java/com/fr/design/mainframe/JForm.java | 2 +- .../src/main/java/com/fr/design/mainframe/JWorkBook.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 9697113e27..9445d38d25 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -718,7 +718,7 @@ public abstract class JTemplate> public void undo() { this.getUndoManager().undo(); // 撤销前模版使用主题可能已经被删除或修改,需要重置模版样式 - checkAndResetTheme(); + checkAndResetTheme(true); fireSuperTargetModified(); } @@ -728,7 +728,7 @@ public abstract class JTemplate> public void redo() { this.getUndoManager().redo(); // 重做前模版使用主题可能已经被删除或修改,需要重置模版样式 - checkAndResetTheme(); + checkAndResetTheme(true); fireSuperTargetModified(); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 97488e7d83..eabbbbfcb1 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -686,7 +686,7 @@ public class JForm extends JTemplate implements BaseJForm { protected void applyUndoState(WorkBookUndoState u) { try { WorkBook undoWorkBook = (WorkBook) u.getWorkBook().clone(); - undoWorkBook.checkAndResetTheme(); + undoWorkBook.checkAndResetTheme(true); undoWorkBook = (WorkBook) FineColorSynchronizer.flush(undoWorkBook, undoWorkBook.getTemplateTheme()); this.setTarget(undoWorkBook); if (!DesignerMode.isAuthorityEditing()) { From 56d31c997f9bc90cd6fcd4c44ca552c30b589fbd Mon Sep 17 00:00:00 2001 From: renekton Date: Wed, 9 Oct 2024 16:39:58 +0800 Subject: [PATCH 21/24] =?UTF-8?q?alpha=E6=90=9C=E7=B4=A2=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?fvs=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/help/alphafine/AlphaFineConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java index b723e08b16..898ffc9a77 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java @@ -143,7 +143,7 @@ public class AlphaFineConstants { public static final String FIRST_PAGE = "-1"; - public static final FileExtension[] FILE_EXTENSIONS = new FileExtension[]{FileExtension.CPT, FileExtension.FRM}; + public static final FileExtension[] FILE_EXTENSIONS = new FileExtension[]{FileExtension.CPT, FileExtension.FRM, FileExtension.VIS}; public static final int RECOMMEND_MAX_ITEM_NUM = 3; From d4aa48cd2b04bc514178671723e8d359a7ccca4c Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Tue, 15 Oct 2024 19:21:32 +0800 Subject: [PATCH 22/24] =?UTF-8?q?REPORT-135591=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=A2=9E=E5=BC=BA=E4=B8=8D=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=94=B9=E5=8F=98=E6=8C=89=E9=92=AE=E7=BB=84=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E5=AD=97=E4=BD=93=20&&=20REPORT-125065=20=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E6=A0=B7=E5=BC=8F=E5=92=8C=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=95=88=E6=9E=9C=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/widgettheme/ParaButtonSettingPane.java | 2 ++ .../com/fr/design/widgettheme/ParaTreeEditorSettingPane.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/widgettheme/ParaButtonSettingPane.java b/designer-form/src/main/java/com/fr/design/widgettheme/ParaButtonSettingPane.java index 620af9a80e..7f656a4bfa 100644 --- a/designer-form/src/main/java/com/fr/design/widgettheme/ParaButtonSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widgettheme/ParaButtonSettingPane.java @@ -38,6 +38,7 @@ public class ParaButtonSettingPane extends ButtonSettingPane extends ButtonSettingPane extends TreeEditorS ThemeTextStyle textStyle = widgetTheme.getTextStyle(); fontSizePane.setValue(textStyle.getFontSize()); fontColorButton.setColor(textStyle.getFontColor()); + fontNameSelectBox.setSelectedItem(textStyle.getName()); } @Override @@ -43,6 +44,7 @@ public class ParaTreeEditorSettingPane extends TreeEditorS ThemeTextStyle textStyle = new ThemeTextStyle(); textStyle.setFontSize(fontSizePane.getValue()); textStyle.setFontColor(fontColorButton.getColor()); + textStyle.setName((String) fontNameSelectBox.getSelectedItem()); widgetTheme.setTextStyle(textStyle); } } From 6250f7cd9a063b191dce816fa80cb37ffd75bcb2 Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Tue, 29 Oct 2024 16:40:56 +0800 Subject: [PATCH 23/24] =?UTF-8?q?REPORT-139097=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E7=89=88=E7=89=88=E6=9C=AC=E5=B1=8F=E8=94=BD=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E5=9B=9E=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/carton/latency/DesignerLatencyMetric.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java b/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java index 75fa28ef1e..189ef0136d 100644 --- a/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java +++ b/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java @@ -9,6 +9,7 @@ import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; import com.fr.general.GeneralUtils; import com.fr.general.http.HttpToolbox; import com.fr.json.JSONObject; @@ -72,7 +73,7 @@ public class DesignerLatencyMetric { * 启动 */ public void start() { - if (SwitchForSwingChecker.isLatencyMonitoring()) { + if (needMonitor()) { // 初始化容器 initializeContainer(); // 启动异步性能记录线程池 @@ -95,7 +96,7 @@ public class DesignerLatencyMetric { * 关闭 */ public void stop() { - if (SwitchForSwingChecker.isLatencyMonitoring()) { + if (needMonitor()) { if (this.executorService != null) { this.executorService.shutdown(); } @@ -107,6 +108,11 @@ public class DesignerLatencyMetric { } } + private static boolean needMonitor() { + // 海外版本不回传云中心 + return SwitchForSwingChecker.isLatencyMonitoring() && GeneralContext.isChineseEnv(); + } + private String getLatencyUrl() { if (StringUtils.isEmpty(latencyUrl)) { String monitorEntry = CloudCenter.getInstance().acquireUrlByKind("cloud.monitor.api.entrypoint"); From 0cd623d3904f43609efe316a1ee716bf41e83264 Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Tue, 29 Oct 2024 17:01:40 +0800 Subject: [PATCH 24/24] =?UTF-8?q?REPORT-139097=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E7=89=88=E7=89=88=E6=9C=AC=E5=B1=8F=E8=94=BD=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E5=9B=9E=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/carton/latency/DesignerLatencyMetric.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java b/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java index 189ef0136d..4690f44d9a 100644 --- a/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java +++ b/designer-base/src/main/java/com/fr/design/carton/latency/DesignerLatencyMetric.java @@ -20,6 +20,7 @@ import com.fr.workspace.Workspace; import com.fr.workspace.WorkspaceEvent; import java.util.HashMap; +import java.util.Locale; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutorService; @@ -110,7 +111,7 @@ public class DesignerLatencyMetric { private static boolean needMonitor() { // 海外版本不回传云中心 - return SwitchForSwingChecker.isLatencyMonitoring() && GeneralContext.isChineseEnv(); + return SwitchForSwingChecker.isLatencyMonitoring() && Locale.CHINA.equals(GeneralContext.getLocale()); } private String getLatencyUrl() {