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中的规则替换为最新规则(防止平台规则被临时修改) */