diff --git a/build.gradle b/build.gradle index 671e64fb95..e0bf79aefe 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,5 @@ import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel +import org.gradle.internal.os.OperatingSystem plugins { id 'java' @@ -65,11 +66,7 @@ allprojects { implementation 'com.fr.cbb:fine-universal-skeleton:' + cbbVersion implementation 'com.install4j:install4j-runtime:8.0.4' implementation 'com.fr.third:jxbrowser:6.23' - implementation 'com.fr.third:jxbrowser-mac:6.23' - implementation 'com.fr.third:jxbrowser-win64:6.23' implementation 'com.fr.third:jxbrowser-v7:7.22' - implementation 'com.fr.third:jxbrowser-mac-v7:7.22' - implementation 'com.fr.third:jxbrowser-win64-v7:7.22' implementation 'com.fr.third:jxbrowser-swing-v7:7.22' implementation 'com.fr.third.server:servlet-api:3.0' implementation 'org.swingexplorer:swexpl:2.0.1' @@ -94,4 +91,16 @@ allprojects { testImplementation 'org.powermock:powermock-api-easymock:1.7.1' testImplementation 'junit:junit:4.12' } + + if (OperatingSystem.current().isMacOsX()) { + dependencies { + implementation 'com.fr.third:jxbrowser-mac:6.23' + implementation 'com.fr.third:jxbrowser-mac-v7:7.22' + } + } else if (OperatingSystem.current().isWindows()) { + dependencies { + implementation 'com.fr.third:jxbrowser-win64:6.23' + implementation 'com.fr.third:jxbrowser-win64-v7:7.22' + } + } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java index 2641452218..a9798d25c6 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java @@ -80,7 +80,7 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio // 仅校验jdbc连接,其他插件数据连接不进行校验 if (connection instanceof JDBCDatabaseConnection) { DatabaseResultBean bean = WorkContext.getCurrent().get(DataBaseTypeOperator.class).validateDatabaseType(connection.getDriver(), connection.feature()); - if (bean.equals(DatabaseResultBean.DefaultBean())) { + if (!bean.equals(DatabaseResultBean.DefaultBean())) { throw new DataBaseNotSupportedException(bean.getMsg()); } } 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 419299336e..11e30a2e9f 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 @@ -275,18 +275,25 @@ public class DesensitizationRuleChoosePane extends JPanel { @Override public void actionPerformed(ActionEvent e) { - // 获取当前选中规则 - DesensitizationRule selectedValue = getSelectedValue(); + // 获取当前选中规则的副本 + DesensitizationRule selectedValue = null; + try { + selectedValue = (DesensitizationRule) getSelectedValue().clone(); + } catch (CloneNotSupportedException ex) { + throw new RuntimeException(ex); + } DesensitizationRuleEditPane editPane = new DesensitizationRuleEditPane(getCurrentExistRuleNames(selectedValue.getRuleName())); editPane.populateBean(selectedValue); + final DesensitizationRule finalRule = selectedValue; BasicDialog basicDialog = editPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(parent), new DialogActionAdapter() { @Override public void doOk() { DesensitizationRule rule = editPane.updateBean(); // 修改同步到RuleManager中 if (DesensitizationRule.valid(rule)) { - DesensitizationRuleManager.getInstance().updateRule(rule); + DesensitizationRuleManager.getInstance().updateRule(finalRule, rule); } + setSelectedValue(rule); fireTableDataChanged(); } 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 f050e4b0cd..52b7e5b19b 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 @@ -250,6 +250,8 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter customRules = DesensitizationRuleManager.getInstance().getRulesBySource(DesensitizationRuleSource.CUSTOM); + latestRules.put(DesensitizationRuleSource.CUSTOM, customRules); + } + } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/CellDesensitizationGroupsPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/CellDesensitizationGroupsPane.java index 1c4f200cba..de4e046b84 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/CellDesensitizationGroupsPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/CellDesensitizationGroupsPane.java @@ -121,7 +121,19 @@ public class CellDesensitizationGroupsPane extends JPanel { */ public void populate(List desensitizationBeans) { if (Objects.nonNull(desensitizationBeans)) { + // 记录埋点数据 + if (!desensitizationBeans.isEmpty()) { + recordDesensitization(desensitizationBeans); + } + editorPane.populate(desensitizationBeans.toArray(new CellDesensitizationBean[]{})); } } + + /** + * 记录预览导出脱敏埋点 + */ + private int recordDesensitization(List desensitizationBeans) { + return desensitizationBeans.size(); + } }