From 3da2a0856d6411a0eb7504e1083d2f857bfd17a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Tue, 20 Dec 2022 10:34:28 +0800 Subject: [PATCH 01/55] =?UTF-8?q?REPORT-75091=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=84=B1=E6=95=8F=E4=B8=80=E4=BA=8C=E6=9C=9F=E8=A7=A3=E9=99=A4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=B1=8F=E8=94=BD=20=E3=80=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91rt=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91rt=20=E3=80=90review?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/preview/PreviewTablePane.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 027afdf5b2..f65d4a9cfa 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 @@ -162,9 +162,8 @@ public class PreviewTablePane extends BasicPane { JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); // 预览行数面板 northPane.add(initPreviewNumberPane(), BorderLayout.CENTER); - /// 迭代延期,暂时屏蔽下功能入口 // 脱敏预览设置面板 -// northPane.add(initDesensitizationPane(), BorderLayout.EAST); + northPane.add(initDesensitizationPane(), BorderLayout.EAST); initDesensitizationPane(); return northPane; } From 5a717baaea4cc0f968841f55dff8675ce5ac932c Mon Sep 17 00:00:00 2001 From: "Cloud.Liu" Date: Thu, 22 Dec 2022 21:46:31 +0800 Subject: [PATCH 02/55] =?UTF-8?q?KERNEL-12978=20fix:=20=E9=80=82=E9=85=8DC?= =?UTF-8?q?BB=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/actions/file/LocalePane.java | 3 ++- .../main/java/com/fr/design/actions/file/PreferencePane.java | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java b/designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java index 634af28b9e..843b3bf724 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/LocalePane.java @@ -12,6 +12,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.file.filetree.FileNode; import com.fr.general.GeneralUtils; +import com.fr.general.Inter; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; @@ -121,7 +122,7 @@ public class LocalePane extends BasicPane { private void initPredefinedProperties() { - Map supportLocaleMap = InterProviderFactory.getProvider().getSupportLocaleMap(); + Map supportLocaleMap = Inter.getSupportLocaleMap(); // richie:暂时去掉设计器中国际化键值对的显示 Map map = new HashMap<>(); 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 46485409bb..840de5867b 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 @@ -46,7 +46,6 @@ 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.stable.Constants; @@ -634,7 +633,7 @@ public class PreferencePane extends BasicPane { } private UIDictionaryComboBox createLanguageComboBox() { - Map map = InterProviderFactory.getProvider().getSupportLocaleMap(); + Map map = Inter.getSupportLocaleMap(); int size = map.size(); Locale[] keys = new Locale[size]; String[] values = new String[size]; From 91383d8d020026dee17b8ce0c6a42fd48344a2d7 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 30 Dec 2022 13:38:05 +0800 Subject: [PATCH 03/55] =?UTF-8?q?KERNEL-13094=20=E6=94=AF=E6=8C=81frm?= =?UTF-8?q?=E7=9A=84=E7=BB=84=E4=BB=B6copy=E5=88=B0fvs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beans/models/ClipboardProvider.java | 18 ++++++++ .../models/DashboardClipboardManager.java | 45 +++++++++++++++++++ .../beans/models/FormSelectionClipboard.java | 45 +++++++++++++++++++ .../designer/beans/models/SelectionModel.java | 26 ++++++----- 4 files changed, 122 insertions(+), 12 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/designer/beans/models/ClipboardProvider.java create mode 100644 designer-form/src/main/java/com/fr/design/designer/beans/models/DashboardClipboardManager.java create mode 100644 designer-form/src/main/java/com/fr/design/designer/beans/models/FormSelectionClipboard.java diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/ClipboardProvider.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/ClipboardProvider.java new file mode 100644 index 0000000000..4382fc35f7 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/ClipboardProvider.java @@ -0,0 +1,18 @@ +package com.fr.design.designer.beans.models; + +public interface ClipboardProvider { + + /** + * 剪切到剪贴板 + * + * @param o 剪切对象 + */ + void cut2Clipboard(Object o); + + /** + * 复制到剪贴板 + * + * @param o 复制对象 + */ + void copy2Clipboard(Object o); +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/DashboardClipboardManager.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/DashboardClipboardManager.java new file mode 100644 index 0000000000..55cf2f12c7 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/DashboardClipboardManager.java @@ -0,0 +1,45 @@ +package com.fr.design.designer.beans.models; + +import java.util.ArrayList; +import java.util.List; + +/** + * 用来管理不同剪贴板,以及之间的数据同步 + */ +public class DashboardClipboardManager { + private static class Holder { + private static final DashboardClipboardManager HOLDER = new DashboardClipboardManager(); + } + + private static final List CLIPBOARD_LIST = new ArrayList<>(); + + + public void registerDashboardClipboard(ClipboardProvider clipboard) { + CLIPBOARD_LIST.add(clipboard); + } + + public void removeDashboardClipboard(ClipboardProvider clipboard) { + CLIPBOARD_LIST.remove(clipboard); + } + + public static DashboardClipboardManager getInstance() { + return Holder.HOLDER; + } + + private DashboardClipboardManager() { + } + + public void cut2Clipboard(Object o) { + for (ClipboardProvider clipboard : CLIPBOARD_LIST) { + //同步其他剪贴板 + clipboard.cut2Clipboard(o); + } + } + + public void copy2Clipboard(Object o) { + for (ClipboardProvider clipboard : CLIPBOARD_LIST) { + //同步其他剪贴板 + clipboard.copy2Clipboard(o); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/FormSelectionClipboard.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/FormSelectionClipboard.java new file mode 100644 index 0000000000..a190532769 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/FormSelectionClipboard.java @@ -0,0 +1,45 @@ +package com.fr.design.designer.beans.models; + +import com.fr.design.mainframe.FormSelection; + +public class FormSelectionClipboard implements ClipboardProvider { + private static final FormSelection FRM_CLIPBOARD = new FormSelection(); + + static { + DashboardClipboardManager.getInstance().registerDashboardClipboard(FormSelectionClipboard.getInstance()); + } + + private static class Holder { + private static final FormSelectionClipboard HOLDER = new FormSelectionClipboard(); + } + + public static FormSelectionClipboard getInstance() { + return Holder.HOLDER; + } + + private FormSelectionClipboard() { + } + + + public boolean isEmpty() { + return FRM_CLIPBOARD.isEmpty(); + } + + public FormSelection getClipboard() { + return FRM_CLIPBOARD; + } + + @Override + public void cut2Clipboard(Object o) { + if (o instanceof FormSelection) { + ((FormSelection) o).cut2ClipBoard(FRM_CLIPBOARD); + } + } + + @Override + public void copy2Clipboard(Object o) { + if (o instanceof FormSelection) { + ((FormSelection) o).copy2ClipBoard(FRM_CLIPBOARD); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index f75e08d723..807325a3b4 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -46,12 +46,14 @@ public class SelectionModel { //被粘贴组件在所选组件位置处往下、往右各错开20像素。执行多次粘贴时,在上一次粘贴的位置处错开20像素。 private static final int DELTA_X_Y = 20; //粘贴时候的偏移距离 private static final double OFFSET_RELATIVE = 0.80; - private static FormSelection clipboard = new FormSelection(); + private static FormSelectionClipboard formClipboard = FormSelectionClipboard.getInstance(); private FormDesigner designer; private FormSelection selection; private Rectangle hotspotBounds; private FormWidgetOptionProvider provider; + + public SelectionModel(FormDesigner designer) { this.designer = designer; selection = new FormSelection(); @@ -71,7 +73,7 @@ public class SelectionModel { * @return 是否为空 */ public static boolean isEmpty() { - return clipboard.isEmpty(); + return formClipboard.isEmpty(); } /** @@ -161,7 +163,7 @@ public class SelectionModel { if (hasSelectionComponent()) { FormSelection cutSelection = ClipboardFilter.cut(selection); if (cutSelection != null) { - cutSelection.cut2ClipBoard(clipboard); + DashboardClipboardManager.getInstance().cut2Clipboard(cutSelection); designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_CUTED); setSelectedCreator(hasSelectedParaComponent() ? designer.getParaComponent() : designer.getRootComponent()); designer.repaint(); @@ -192,7 +194,7 @@ public class SelectionModel { if (!selection.isEmpty()) { FormSelection copySelection = ClipboardFilter.copy(selection); if (copySelection != null) { - copySelection.copy2ClipBoard(clipboard); + DashboardClipboardManager.getInstance().copy2Clipboard(copySelection); } } } @@ -203,7 +205,7 @@ public class SelectionModel { * @return 否 */ public boolean pasteFromClipBoard() { - FormSelection pasteSelection = ClipboardFilter.paste(clipboard); + FormSelection pasteSelection = ClipboardFilter.paste(formClipboard.getClipboard()); if (pasteSelection != null && !pasteSelection.isEmpty()) { if (!hasSelectedPasteSource()) { //未选 @@ -240,7 +242,7 @@ public class SelectionModel { //编辑器外面还有两层容器,使用designer.getRootComponent()获取到的是编辑器中层的容器,不是编辑器表层 //当前选择的就是编辑器表层 FormSelectionUtils.paste2Container(designer, (XLayoutContainer) selection.getSelectedCreator(), - clipboard, + formClipboard.getClipboard(), DELTA_X_Y, DELTA_X_Y); } @@ -248,7 +250,7 @@ public class SelectionModel { //cpt本地组件复用,编辑器就一层,是最底层,使用designer.getRootComponent()就可以获取到 //使用selection.getSelectedCreator()也应该是可以获取到的。 FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), - clipboard, + formClipboard.getClipboard(), DELTA_X_Y, DELTA_X_Y); } @@ -266,7 +268,7 @@ public class SelectionModel { if (hasSelectedPasteSource()) { selectedPaste(); } else { - FormSelectionUtils.paste2Container(designer, container, clipboard, + FormSelectionUtils.paste2Container(designer, container, formClipboard.getClipboard(), rectangle.x + rectangle.width / 2, rectangle.y + DELTA_X_Y); } @@ -281,7 +283,7 @@ public class SelectionModel { selectedPaste(); } else { FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), - clipboard, + formClipboard.getClipboard(), rectangle.x + rectangle.width / 2, rectangle.y + DELTA_X_Y); } @@ -314,13 +316,13 @@ public class SelectionModel { positionX = selectionRec.x - containerRec.x + selectionRec.width / 2; positionY = (int) (selectionRec.y - containerRec.y + selectionRec.height * OFFSET_RELATIVE); } - FormSelectionUtils.paste2Container(designer, container, clipboard, positionX, positionY); + FormSelectionUtils.paste2Container(designer, container, formClipboard.getClipboard(), positionX, positionY); } else if (container != null && selection.getSelectedCreator().getParent() instanceof XWAbsoluteLayout) { //绝对布局 Rectangle rec = selection.getSelctionBounds(); - FormSelectionUtils.paste2Container(designer, container, clipboard, rec.x + DELTA_X_Y, rec.y + DELTA_X_Y); + FormSelectionUtils.paste2Container(designer, container, formClipboard.getClipboard(), rec.x + DELTA_X_Y, rec.y + DELTA_X_Y); } else if (isExtraContainer(container)) { - provider.paste2Container(clipboard); + provider.paste2Container(formClipboard.getClipboard()); } } From 022637b26f2776cf601f3138c72b6ebe3e3847d5 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 3 Jan 2023 15:37:55 +0800 Subject: [PATCH 04/55] =?UTF-8?q?REPORT-86045=20FR11=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=81=87=E4=BF=9D=E5=AD=98-=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E5=86=85=E6=92=A4=E9=94=80=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=86=8D=E7=BC=96=E8=BE=91=E9=99=A4=E6=AD=A4=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E5=9D=97=E5=A4=96=E9=83=A8=E5=88=86=EF=BC=8C=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=20=E5=AE=9E=E9=99=85=E6=9C=AA=E4=BF=9D?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 在报表块编辑模式下重置Form对象,比如setTarget,需要做些额外 的工作,才能确保新的target完全可用,主要是要确保散落 在formDesign中各处的对象,如selectedCreators等,要有新的 target对象保持一致,否则再回到表单编辑界面时,就不能通过 这些creators,对target对象进行修改了。 【改动思路】 将表单编辑界面的一些修改操作也放到报表块编辑模式场景下执行, 确保该更新的都能更新到 --- .../java/com/fr/design/mainframe/JForm.java | 88 ++++++++++--------- 1 file changed, 47 insertions(+), 41 deletions(-) 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 e3162e9ef6..4e9c45ce44 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 @@ -6,8 +6,6 @@ import com.fr.base.Parameter; import com.fr.base.Releasable; import com.fr.base.extension.FileExtension; import com.fr.base.iofile.attr.ExtendSharableAttrMark; -import com.fr.base.theme.FineColorGather; -import com.fr.base.theme.FineColorManager; import com.fr.base.theme.FineColorSynchronizer; import com.fr.base.theme.FormTheme; import com.fr.base.theme.TemplateTheme; @@ -17,8 +15,8 @@ import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; -import com.fr.design.actions.FormMobileAttrAction; import com.fr.design.actions.FormECParallelCalAction; +import com.fr.design.actions.FormMobileAttrAction; import com.fr.design.actions.TemplateParameterAction; import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.actions.file.export.EmbeddedFormExportExportAction; @@ -56,8 +54,8 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; -import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.ComponentShareUtil; +import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.template.info.JFormProcessInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog; @@ -71,7 +69,6 @@ import com.fr.design.parameter.ParameterPropertyPane; import com.fr.design.preview.FormPreview; import com.fr.design.preview.MobilePreview; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; -import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.gui.LayoutUtils; import com.fr.file.FILE; import com.fr.file.FILEChooserPane; @@ -110,7 +107,14 @@ import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.tree.TreePath; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Insets; +import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; @@ -1266,46 +1270,48 @@ public class JForm extends JTemplate implements BaseJForm Date: Wed, 4 Jan 2023 11:35:34 +0800 Subject: [PATCH 05/55] =?UTF-8?q?REPORT-87768=20fix:=E8=A7=84=E9=81=BF?= =?UTF-8?q?=E4=B8=8BtemplateID=E7=9A=84=E9=87=8D=E5=A4=8D=E7=94=9F?= =?UTF-8?q?=E6=88=90?= 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 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 b59df2cf08..d59d616357 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 @@ -330,7 +330,9 @@ public abstract class JTemplate> * 为另存的模板创建新的模板id */ private void generateNewTemplateIdForSaveAs() { - generateTemplateId(); + if (StringUtils.isEmpty(template.getTemplateID())) { + generateTemplateId(); + } } /** From 2e5d636edc2d748f3a4056b2a27249d07beeb7db Mon Sep 17 00:00:00 2001 From: Yann Date: Wed, 4 Jan 2023 11:46:34 +0800 Subject: [PATCH 06/55] =?UTF-8?q?REPORT-87576=20=E5=8F=96=E8=89=B2?= =?UTF-8?q?=E6=9D=BF=E4=BD=BF=E7=94=A8=E5=90=8E=E4=BC=9A=E8=AE=A9fr?= =?UTF-8?q?=E5=8D=A1=E4=BD=8F=E3=80=82=E5=8F=AF=E7=A8=B3=E5=AE=9A=E5=A4=8D?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/style/BorderPane.java | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java index 6d62593935..d2a302ea01 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java @@ -265,34 +265,31 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse int lineStyle = currentLineCombo.getSelectedLineStyle(); Color lineColor = currentLineColorPane.getSelectObject(); CellBorderStyle cellBorderStyle = new CellBorderStyle(); - if (topToggleButton.isSelected()) { - cellBorderStyle.setTopColor(lineColor); + if (lineColor != null) { + if (topToggleButton.isSelected()) { + cellBorderStyle.setTopColor(lineColor); + } + if (bottomToggleButton.isSelected()) { + cellBorderStyle.setBottomColor(lineColor); + } + if (leftToggleButton.isSelected()) { + cellBorderStyle.setLeftColor(lineColor); + } + if (rightToggleButton.isSelected()) { + cellBorderStyle.setRightColor(lineColor); + } + if (verticalToggleButton.isSelected()) { + cellBorderStyle.setVerticalColor(lineColor); + } + if (horizontalToggleButton.isSelected()) { + cellBorderStyle.setHorizontalColor(lineColor); + } } cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (bottomToggleButton.isSelected()) { - cellBorderStyle.setBottomColor(lineColor); - } cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (leftToggleButton.isSelected()) { - cellBorderStyle.setLeftColor(lineColor); - } cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (rightToggleButton.isSelected()) { - cellBorderStyle.setRightColor(lineColor); - } cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (verticalToggleButton.isSelected()) { - cellBorderStyle.setVerticalColor(lineColor); - } cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); - - if (horizontalToggleButton.isSelected()) { - cellBorderStyle.setHorizontalColor(lineColor); - } cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); outerToggleButton.setSelected(leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected()); From e34a0c78ae6e2c77f87a312fb1fcc53c1fe5eb14 Mon Sep 17 00:00:00 2001 From: Carlson Date: Wed, 4 Jan 2023 14:36:17 +0800 Subject: [PATCH 07/55] =?UTF-8?q?REPORT-87768=20fix:=E8=80=83=E8=99=91?= =?UTF-8?q?=E5=8F=A6=E5=AD=98=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d59d616357..e8cdc3ee8d 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 @@ -330,7 +330,7 @@ public abstract class JTemplate> * 为另存的模板创建新的模板id */ private void generateNewTemplateIdForSaveAs() { - if (StringUtils.isEmpty(template.getTemplateID())) { + if (StringUtils.isEmpty(template.getTemplateID()) || this.getEditingFILE().exists()) { generateTemplateId(); } } From e260386ad110fc0dabd403316dcff3686fe882df Mon Sep 17 00:00:00 2001 From: Yann Date: Wed, 4 Jan 2023 17:52:14 +0800 Subject: [PATCH 08/55] =?UTF-8?q?REPORT-86430=20AlphaFine=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BF=83tab=E9=A1=B5=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=9C=89=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/search/manager/impl/PluginSearchManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index babf9f4865..de8f468829 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -214,7 +214,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { } return time; } - })); + }).reversed()); } catch (Exception e) { FineLoggerFactory.getLogger().error(e, e.getMessage()); } From e1b4a4f850c188a441f744abb4f36322eba7e806 Mon Sep 17 00:00:00 2001 From: Carlson Date: Wed, 4 Jan 2023 19:33:27 +0800 Subject: [PATCH 09/55] =?UTF-8?q?REPORT-87768=20=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=89=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/JTemplate.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 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 e8cdc3ee8d..43714f949b 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 @@ -326,15 +326,6 @@ public abstract class JTemplate> public abstract JComponent getCurrentReportComponentPane(); - /** - * 为另存的模板创建新的模板id - */ - private void generateNewTemplateIdForSaveAs() { - if (StringUtils.isEmpty(template.getTemplateID()) || this.getEditingFILE().exists()) { - generateTemplateId(); - } - } - /** * 收集图表信息 */ @@ -959,7 +950,9 @@ public abstract class JTemplate> originID = currentId; } // 在保存之前,初始化 templateID - generateNewTemplateIdForSaveAs(); + if (StringUtils.isEmpty(currentId)) { + generateTemplateId(); + } this.editingFILE = editingFILE; boolean result = this.saveToNewFile(oldName); @@ -1834,7 +1827,7 @@ public abstract class JTemplate> originID = currentId; } // 在保存之前,初始化 templateID - generateNewTemplateIdForSaveAs(); + generateTemplateId(); this.editingFILE = editingFILE; boolean result = this.saveToNewRealFile(oldName); if (result) { From 9e232beb6df4adf5e1fad63685b33d5ffd3dab59 Mon Sep 17 00:00:00 2001 From: Carlson Date: Thu, 5 Jan 2023 10:09:14 +0800 Subject: [PATCH 10/55] =?UTF-8?q?REPORT-87768=20=E7=BB=99=E5=AD=90?= =?UTF-8?q?=E7=B1=BB=E6=8F=90=E4=BE=9B=E4=B8=80=E4=B8=8B=E9=87=8D=E5=86=99?= =?UTF-8?q?=E7=9A=84=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/JTemplate.java | 13 +++++++++---- 1 file changed, 9 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 43714f949b..444ef577fb 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 @@ -326,6 +326,13 @@ public abstract class JTemplate> public abstract JComponent getCurrentReportComponentPane(); + /** + * 为另存的模板创建新的模板id + */ + protected void generateNewTemplateIdForSaveAs() { + generateTemplateId(); + } + /** * 收集图表信息 */ @@ -950,9 +957,7 @@ public abstract class JTemplate> originID = currentId; } // 在保存之前,初始化 templateID - if (StringUtils.isEmpty(currentId)) { - generateTemplateId(); - } + generateNewTemplateIdForSaveAs(); this.editingFILE = editingFILE; boolean result = this.saveToNewFile(oldName); @@ -1827,7 +1832,7 @@ public abstract class JTemplate> originID = currentId; } // 在保存之前,初始化 templateID - generateTemplateId(); + generateNewTemplateIdForSaveAs(); this.editingFILE = editingFILE; boolean result = this.saveToNewRealFile(oldName); if (result) { From dfe0ea9969d615c019edf9b87c3d966d8e725a8d Mon Sep 17 00:00:00 2001 From: "Coral.Chen" Date: Mon, 9 Jan 2023 17:07:34 +0800 Subject: [PATCH 11/55] =?UTF-8?q?REPORT-86259=20=E3=80=90=E5=AF=BC?= =?UTF-8?q?=E5=87=BAexcel&word=E3=80=91=E4=BB=85=E9=99=90=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E4=B8=8B=E9=99=90=E5=88=B6=E5=A4=8D=E5=88=B6=20REPORT?= =?UTF-8?q?-86426-=E5=AF=BC=E5=87=BAexcel/pdf=20=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/ExportUniversalPane.java | 26 ++++++++++++++----- .../design/report/ReportExportAttrPane.java | 5 ++-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java b/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java index 3714d66a27..dce865b402 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java @@ -1,7 +1,6 @@ package com.fr.design.report; import com.fr.base.CustomConfig; -import com.fr.config.Configuration; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icheckbox.UICheckBox; @@ -11,16 +10,20 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; +import com.fr.io.attr.ReportExportAttr; import com.fr.transaction.Configurations; import com.fr.transaction.WorkerFacade; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.BorderFactory; -import javax.swing.JPanel; /** + * 通用 + * * @author hades * @version 11.0 * Created by hades on 2022/5/26 @@ -30,13 +33,15 @@ public class ExportUniversalPane extends BasicPane { private static final String HELP_URL = CloudCenter.getInstance().acquireUrlByKind("help.alt_font.zh_CN", "https://help.fanruan.com/finereport/doc-view-4707.html"); private UICheckBox specialCharacterExport; + // 密码支持公式 + private UICheckBox passwordSupportFormula; public ExportUniversalPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - JPanel outerNorthPane =FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Config")); + JPanel outerNorthPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Config")); JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); - JPanel specialCharacterExportPane =FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); + JPanel specialCharacterExportPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); specialCharacterExport = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Special_Character")); specialCharacterExport.setSelected(true); specialCharacterExportPane.add(specialCharacterExport); @@ -55,6 +60,11 @@ public class ExportUniversalPane extends BasicPane { labelPane.add(centerLabel, BorderLayout.CENTER); labelPane.add(rightLabel, BorderLayout.EAST); northPane.add(labelPane); + JPanel passwordSupportPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane(); + passwordSupportFormula = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Universal_Export_Password_Support_Formula")); + passwordSupportFormula.setSelected(false); + passwordSupportPane.add(passwordSupportFormula); + northPane.add(passwordSupportPane); outerNorthPane.add(northPane); this.add(outerNorthPane); } @@ -64,15 +74,17 @@ public class ExportUniversalPane extends BasicPane { return "ExportUniversalPane"; } - public void populate() { + public void populate(ReportExportAttr reportExportAttr) { this.specialCharacterExport.setSelected(CustomConfig.getInstance().isOptimizedSpecialCharacterExport()); + this.passwordSupportFormula.setSelected(reportExportAttr.isPwdSupportFormula()); } - public void update() { + public void update(ReportExportAttr reportExportAttr) { Configurations.modify(new WorkerFacade(CustomConfig.class) { @Override public void run() { CustomConfig.getInstance().setOptimizedSpecialCharacterExport(specialCharacterExport.isSelected()); + reportExportAttr.setPwdSupportFormula(passwordSupportFormula.isSelected()); } }); } diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java index 2de520d273..cd992c3fdf 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportExportAttrPane.java @@ -61,7 +61,7 @@ public class ReportExportAttrPane extends BasicPane { } if (this.exportUniversalPane != null) { - this.exportUniversalPane.populate(); + this.exportUniversalPane.populate(reportExportAttr); } if (this.excelExportPane != null) { @@ -84,9 +84,8 @@ public class ReportExportAttrPane extends BasicPane { public ReportExportAttr update() { ReportExportAttr reportExportAttr = new ReportExportAttr(); - if (this.exportUniversalPane != null) { - this.exportUniversalPane.update(); + this.exportUniversalPane.update(reportExportAttr); } if (this.excelExportPane != null) { From e18d9c5a16025fb81a16461ac645b9fadcbd0bc7 Mon Sep 17 00:00:00 2001 From: "Coral.Chen" Date: Mon, 9 Jan 2023 17:18:41 +0800 Subject: [PATCH 12/55] =?UTF-8?q?REPORT-86426-=E5=AF=BC=E5=87=BAexcel/pdf?= =?UTF-8?q?=20=E5=AF=86=E7=A0=81=E6=94=AF=E6=8C=81=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/report/ExportUniversalPane.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java b/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java index dce865b402..5fe52560dc 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ExportUniversalPane.java @@ -74,11 +74,21 @@ public class ExportUniversalPane extends BasicPane { return "ExportUniversalPane"; } + /** + * 填充数据 + * + * @param reportExportAttr 报表导出属性 + */ public void populate(ReportExportAttr reportExportAttr) { this.specialCharacterExport.setSelected(CustomConfig.getInstance().isOptimizedSpecialCharacterExport()); this.passwordSupportFormula.setSelected(reportExportAttr.isPwdSupportFormula()); } + /** + * 更新界面 + * + * @param reportExportAttr 报表导出属性 + */ public void update(ReportExportAttr reportExportAttr) { Configurations.modify(new WorkerFacade(CustomConfig.class) { @Override From 8f8f92959af47676c17d00637ce32fa6005c8a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Wed, 11 Jan 2023 10:44:35 +0800 Subject: [PATCH 13/55] =?UTF-8?q?REPORT-83316=20&&=20REPORT-83320=20&&=20R?= =?UTF-8?q?EPORT-83488=20&&=20REPORT-83493=20=E6=95=B0=E6=8D=AE=E8=84=B1?= =?UTF-8?q?=E6=95=8F=E4=B8=80=E6=9C=9F=E8=BF=AD=E4=BB=A3bug=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E9=83=BD=E6=98=AFUI=E9=97=AE=E9=A2=98=20=E3=80=90=E6=94=B9?= =?UTF-8?q?=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E8=B7=9F=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E6=B2=9F=E9=80=9A=E5=90=8E=EF=BC=8C=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E3=80=90review=E5=BB=BA=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/preview/PreviewTablePane.java | 13 +- .../TableDataPreviewDesensitizeManager.java | 16 +- .../view/common/ChooseMark.java | 42 +++ .../rule/DesensitizationRuleChoosePane.java | 66 ++++- .../TableDataDesensitizationTableModel.java | 273 +++++++++++++----- .../gui/icombocheckbox/UICheckListPopup.java | 20 +- .../gui/icombocheckbox/UIComboCheckBox.java | 36 ++- 7 files changed, 377 insertions(+), 89 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java 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 f65d4a9cfa..7b9a7a3d20 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 @@ -164,7 +164,6 @@ public class PreviewTablePane extends BasicPane { northPane.add(initPreviewNumberPane(), BorderLayout.CENTER); // 脱敏预览设置面板 northPane.add(initDesensitizationPane(), BorderLayout.EAST); - initDesensitizationPane(); return northPane; } @@ -260,6 +259,16 @@ public class PreviewTablePane extends BasicPane { 0); } + /** + * 根据TableData设置脱敏设置的个数 + */ + private void setDesensitizationCountByTableData() { + desensitizationPane.setDesensitizationCount(isDesensitizeOpened(), + this.tableData instanceof DesensitizationTableData ? + ((DesensitizationTableData) this.tableData).getDesensitizationConfig().getDesensitizationItems().size() : + 0); + } + /** * 初始化centerPane * @@ -722,7 +731,7 @@ public class PreviewTablePane extends BasicPane { * @param previewTableModel */ private void setPreviewTableModel(TableModel previewTableModel) { - setDesensitizationCount(previewTableModel); + setDesensitizationCountByTableData(); setModel(previewTableModel); setCurrentRows(previewTableModel.getRowCount()); fireLoadedListener(); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java index 3d3c59331f..3d8fc8d02b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java @@ -5,6 +5,7 @@ import com.fr.base.TableData; import com.fr.data.desensitize.base.DesensitizationTableData; import com.fr.data.desensitize.base.TableDataDesensitizationItem; import com.fr.data.desensitize.manage.DesensitizationManager; +import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.util.DesentizationUtils; import com.fr.decision.webservice.bean.user.DepartmentPostBean; import com.fr.decision.webservice.bean.user.RoleBean; @@ -77,7 +78,9 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage // 获取此数据集的所有脱敏信息 Collection desensitizationItems = ((DesensitizationTableData) tableData).getDesensitizationConfig().getDesensitizationItems(); if (DesentizationUtils.isCollectionNotEmpty(desensitizationItems)) { - // 先对脱敏配置项集合做过滤和排序处理 + // 更新规则 + dealWithLastedRules(desensitizationItems); + // 对脱敏配置项集合做过滤和排序处理 List items = desensitizationItems.stream() .filter(item -> item.getRule().isEnable() && matchColumnIndex(item, model) >= 0) @@ -92,9 +95,18 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage return new DesensitizedPreviewTableModel(model, desensitizationItemMap); } + /** + * 在预览计算前,将Item中的规则替换为最新规则(防止平台规则被临时修改) + */ + private void dealWithLastedRules(Collection desensitizationItems) { + desensitizationItems.forEach(item -> { + // 获取最新的规则 + item.setRule(DesensitizationRuleManager.getInstance().getLastedDesentizationRule(item.getRule())); + }); + } + /** * 通过TableData获取其列名 - * 实现逻辑有点绕,TableData本身并不能返回列名集合,只能先去获取当前模板所有数据集,然后匹配名称拿到TableDataWrapper再获取列名 * * @param tableData * @return diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java new file mode 100644 index 0000000000..099e9a960a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java @@ -0,0 +1,42 @@ +package com.fr.design.data.datapane.preview.desensitization.view.common; + +import com.fr.design.gui.ibutton.UIRadioButton; + +import javax.swing.AbstractCellEditor; +import javax.swing.JTable; +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; +import java.awt.Component; + +/** + * 标记选中的CellEditor + * + * @author Yvan + * @version 11.0 + * Created by Yvan on 2022/12/20 + */ +public class ChooseMark extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { + + private final UIRadioButton selectedButton; + + public ChooseMark() { + this.selectedButton = new UIRadioButton(); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + selectedButton.setSelected(isSelected); + return selectedButton; + } + + @Override + public Object getCellEditorValue() { + return selectedButton.isSelected(); + } + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + selectedButton.setSelected(isSelected); + return selectedButton; + } +} diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java index fd627e8cc4..3b44c0b187 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java @@ -4,9 +4,10 @@ import com.fr.base.svg.IconUtils; import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; +import com.fr.data.desensitize.rule.base.DesensitizationRuleStatus; +import com.fr.design.data.datapane.preview.desensitization.view.common.ChooseMark; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableEditorPane; @@ -22,6 +23,7 @@ import javax.swing.SwingUtilities; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; import java.awt.CardLayout; +import java.awt.Color; import java.awt.Component; import java.awt.event.ActionEvent; import java.util.LinkedHashSet; @@ -107,18 +109,23 @@ public class DesensitizationRuleChoosePane extends JPanel { super(new String[]{ StringUtils.EMPTY, Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Name"), - Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Description") + Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Description"), + Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Status"), }); this.parent = parent; this.debugActionOnly = debugActionOnly; this.setColumnClass(new Class[]{ - RuleChoosePane.class, + ChooseMark.class, UILabel.class, - UILabel.class + UILabel.class, + DesensitizationRuleStatusPane.class }); - this.setDefaultEditor(RuleChoosePane.class, new RuleChoosePane()); - this.setDefaultRenderer(RuleChoosePane.class, new RuleChoosePane()); + this.setDefaultEditor(ChooseMark.class, new ChooseMark()); + this.setDefaultRenderer(ChooseMark.class, new ChooseMark()); + this.setDefaultEditor(DesensitizationRuleStatusPane.class, new DesensitizationRuleStatusPane()); + this.setDefaultRenderer(DesensitizationRuleStatusPane.class, new DesensitizationRuleStatusPane()); this.createTable().getColumnModel().getColumn(0).setMaxWidth(20); + this.createTable().getColumnModel().getColumn(3).setMaxWidth(60); } @Override @@ -134,6 +141,11 @@ public class DesensitizationRuleChoosePane extends JPanel { case 2: // 脱敏规则描述 return DesensitizationRule.getDescription(rule); + case 3: + // 脱敏规则状态 + DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(rule); + // 非正常状态需要标记为异常 + return ruleStatus == DesensitizationRuleStatus.NORMAL ? StringUtils.EMPTY : Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Status_Abnormal"); default: return StringUtils.EMPTY; } @@ -161,29 +173,51 @@ public class DesensitizationRuleChoosePane extends JPanel { .collect(Collectors.toSet()); } - private class RuleChoosePane extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { + /** + * 规则状态展示页面 + */ + private class DesensitizationRuleStatusPane extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { - private UIRadioButton selectedButton; + private UILabel ruleStatusLabel; - public RuleChoosePane() { - this.selectedButton = new UIRadioButton(); + DesensitizationRuleStatusPane() { + // 规则状态 + this.ruleStatusLabel = new UILabel(); + this.ruleStatusLabel.setForeground(Color.RED); + } + + /** + * 根据脱敏规则信息,刷新规则状态,主要用于与规则选择器的联动 + * + * @param rule + */ + public void refreshRuleStatus(DesensitizationRule rule) { + DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(rule); + if (ruleStatus == DesensitizationRuleStatus.NORMAL) { + // 正常规则时,重置提示Label + this.ruleStatusLabel.setText(StringUtils.EMPTY); + this.ruleStatusLabel.setToolTipText(null); + } else { + this.ruleStatusLabel.setText(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Status_Abnormal")); + this.ruleStatusLabel.setToolTipText(ruleStatus.getDescription()); + } } @Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { - selectedButton.setSelected(isSelected); - return selectedButton; + refreshRuleStatus(getList().get(row)); + return ruleStatusLabel; } @Override public Object getCellEditorValue() { - return selectedButton.isSelected(); + return ruleStatusLabel; } @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { - selectedButton.setSelected(isSelected); - return selectedButton; + refreshRuleStatus(getList().get(row)); + return ruleStatusLabel; } } @@ -298,7 +332,7 @@ public class DesensitizationRuleChoosePane extends JPanel { @Override public void checkEnabled() { - setEnabled(table.getSelectedRow() != -1); + setEnabled(table.getSelectedRow() != -1 && getList().get(table.getSelectedRow()).isEnable()); } @Override diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java index bbc91efa2a..4d6cfa8ff6 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java @@ -2,11 +2,14 @@ package com.fr.design.data.datapane.preview.desensitization.view.setting; import com.fr.data.desensitize.base.DesensitizationTableData; import com.fr.data.desensitize.base.TableDataDesensitizationItem; +import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.rule.base.DesensitizationRule; +import com.fr.data.desensitize.rule.base.DesensitizationRuleStatus; import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager; import com.fr.design.data.datapane.preview.desensitization.view.rule.DesensitizationRulePane; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; +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.icombocheckbox.UIComboCheckBox; @@ -15,12 +18,14 @@ import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableModelAdapter; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.stable.StringUtils; import org.jetbrains.annotations.Nullable; import javax.swing.AbstractCellEditor; +import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.SwingUtilities; @@ -28,10 +33,11 @@ import javax.swing.event.CellEditorListener; import javax.swing.event.ChangeEvent; import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellRenderer; +import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.LinkedHashSet; @@ -52,6 +58,8 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter matchRoleNamesByIds(Collection roleIds) { - List result = new ArrayList<>(); + private String matchRoleNamesByIds(Collection roleIds) { + StringBuilder builder = new StringBuilder(); for (String roleId : roleIds) { if (roleMap != null && roleMap.containsKey(roleId)) { - result.add(roleMap.get(roleId)); + builder.append(roleMap.get(roleId)); + builder.append(COMMA); } } - return result; + return builder.length() <= 1 ? StringUtils.EMPTY : builder.substring(0, builder.length() - 1); } @Override public boolean isCellEditable(int row, int col) { - return true; + TableSequences match = TableSequences.match(col); + return match != TableSequences.DesensitizationRuleStatus; } @Override @@ -166,7 +183,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter 0 ? builder.substring(0, builder.length() - 1) : StringUtils.EMPTY; //计算加省略号后的文本 editor.setText(this.showOmitText ? omitEditorText(editor, text) : text); + // tooltips显示原值 + setEditorToolTipText(editor, text); + } + + /** + * 为UITextField设置悬浮提示值 + * + * @param editor + * @param text + */ + protected void setEditorToolTipText(JComponent editor, String text) { + // 默认不做设置 } /** From 4c0a7489464acf5352132b2758d8c2fc4a0a46de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvan-=E6=AC=A7=E9=98=B3=E5=B8=86?= Date: Wed, 11 Jan 2023 11:25:37 +0800 Subject: [PATCH 14/55] =?UTF-8?q?REPORT-83316=20&&=20REPORT-83320=20&&=20R?= =?UTF-8?q?EPORT-83488=20&&=20REPORT-83493=20=E6=95=B0=E6=8D=AE=E8=84=B1?= =?UTF-8?q?=E6=95=8F=E4=B8=80=E6=9C=9F=E8=BF=AD=E4=BB=A3bug=20=E3=80=90?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?review=E6=84=8F=E8=A7=81=EF=BC=8C=E6=8A=BD=E5=87=BA=E6=96=B9?= =?UTF-8?q?=E6=B3=95=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF?= =?UTF-8?q?=E3=80=91=E6=A0=B9=E6=8D=AEreview=E6=84=8F=E8=A7=81=EF=BC=8C?= =?UTF-8?q?=E6=8A=BD=E5=87=BA=E6=96=B9=E6=B3=95=20=E3=80=90review=E5=BB=BA?= =?UTF-8?q?=E8=AE=AE=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TableDataPreviewDesensitizeManager.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java index 3d8fc8d02b..29e12bfaf4 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/TableDataPreviewDesensitizeManager.java @@ -82,8 +82,7 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage dealWithLastedRules(desensitizationItems); // 对脱敏配置项集合做过滤和排序处理 List items = desensitizationItems.stream() - .filter(item -> item.getRule().isEnable() && - matchColumnIndex(item, model) >= 0) + .filter(item -> isAvaliableItem4Preview(item, model)) .sorted(Comparator.comparingInt(item -> matchColumnIndex(item, model))) .collect(Collectors.toList()); // 然后转换成Map @@ -95,6 +94,18 @@ public class TableDataPreviewDesensitizeManager implements DesensitizationManage return new DesensitizedPreviewTableModel(model, desensitizationItemMap); } + /** + * 判断是否为有效的用于预览脱敏效果的DesensitizationItem + * + * @param item 脱敏配置项 + * @param model 数据集预览数据 + * @return + */ + private boolean isAvaliableItem4Preview(TableDataDesensitizationItem item, PreviewTableModel model) { + return item.getRule().isEnable() && + matchColumnIndex(item, model) >= 0; + } + /** * 在预览计算前,将Item中的规则替换为最新规则(防止平台规则被临时修改) */ From dc7f9fee247f303cf87d969b25a3baa50ce9532b Mon Sep 17 00:00:00 2001 From: "Leo.Qin" Date: Fri, 13 Jan 2023 12:55:34 +0800 Subject: [PATCH 15/55] =?UTF-8?q?REPORT-84645=20lic=E9=99=90=E5=88=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E7=B1=BB=E5=9E=8B-=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E9=85=8D=E5=90=88=20=E3=80=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E3=80=91rt=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=80=9D=E8=B7=AF=E3=80=91=E8=AE=BE=E8=AE=A1=E5=99=A8=E4=B8=AD?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=A0=B9=E6=8D=AElic=E4=B8=AD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E7=B1=BB=E5=9E=8B=E9=99=90=E5=88=B6=EF=BC=8C?= =?UTF-8?q?=E7=BB=99=E5=87=BA=E7=9B=B8=E5=BA=94=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/connect/ConnectionListPane.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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 23c22144b5..eaa4c37d8d 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 @@ -22,6 +22,7 @@ import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionOperator; import com.fr.general.NameObject; import com.fr.log.FineLoggerFactory; +import com.fr.regist.FRCoreContext; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; @@ -118,17 +119,25 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh * @return 菜单项 */ public NameableCreator[] createNameableCreators() { - NameableCreator[] creators = new NameableCreator[]{new NameObjectCreator( + NameObjectCreator jdbc = new NameObjectCreator( "JDBC", "/com/fr/design/images/data/source/jdbcTableData.png", JDBCDatabaseConnection.class, DatabaseConnectionPane.JDBC.class - ), new NameObjectCreator( + ); + NameObjectCreator jndi = new NameObjectCreator( "JNDI", "/com/fr/design/images/data/source/jdbcTableData.png", JNDIDatabaseConnection.class, DatabaseConnectionPane.JNDI.class - )}; + ); + NameableCreator[] creators; + if (FRCoreContext.getLicense().limitDatabaseType()) { + // 不支持JDNI,屏蔽接口 + creators = new NameableCreator[]{jdbc}; + } else { + creators = new NameableCreator[]{jdbc, jndi}; + } Set pluginCreators = ExtraDesignClassManager.getInstance().getArray(ConnectionProvider.XML_TAG); for (ConnectionProvider provider : pluginCreators) { NameObjectCreator creator = new NameObjectCreator( From 7347a81a81e197f437e1414b11a1673fd3afa635 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 13 Jan 2023 15:25:32 +0800 Subject: [PATCH 16/55] =?UTF-8?q?REPORT-88307=20=E6=8E=A7=E4=BB=B6-?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=8E=A7=E4=BB=B6-=E5=B0=86=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E4=B8=AD=E7=9A=84=E2=80=9C=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E2=80=9D=E6=94=B9=E4=B8=BA=E2=80=9C=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/widget/ui/designer/LabelDefinePane.java | 2 +- .../fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java index 1c30b1a557..992ea9cfb5 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java @@ -68,7 +68,7 @@ public class LabelDefinePane extends AbstractDataModify