|
|
|
@ -75,11 +75,11 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
|
|
|
|
|
/** |
|
|
|
|
* 当前最新的所有规则 |
|
|
|
|
*/ |
|
|
|
|
private Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> lastedRules = new LinkedHashMap<>(); |
|
|
|
|
private Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> latestRules = new LinkedHashMap<>(); |
|
|
|
|
|
|
|
|
|
private Component parent; |
|
|
|
|
|
|
|
|
|
public TableDataDesensitizationTableModel(DesensitizationTableData tableData, Component parent, List<String> columnNames, Map<String, String> roleMap, Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> lastedRules) { |
|
|
|
|
public TableDataDesensitizationTableModel(DesensitizationTableData tableData, Component parent, List<String> columnNames, Map<String, String> roleMap, Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> latestRules) { |
|
|
|
|
// table相关
|
|
|
|
|
super(new String[]{ |
|
|
|
|
Toolkit.i18nText("Fine-Design_Report_Desensitization_Column"), |
|
|
|
@ -91,7 +91,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
|
|
|
|
|
this.parent = parent; |
|
|
|
|
this.columnNames = columnNames; |
|
|
|
|
this.roleMap = roleMap; |
|
|
|
|
this.lastedRules = lastedRules; |
|
|
|
|
this.latestRules = latestRules; |
|
|
|
|
|
|
|
|
|
initTable(); |
|
|
|
|
} |
|
|
|
@ -250,7 +250,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
|
|
|
|
|
private ActionListener chooseRuleListener = new ActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
DesensitizationRulePane rulePane = new DesensitizationRulePane(lastedRules); |
|
|
|
|
DesensitizationRulePane rulePane = new DesensitizationRulePane(latestRules); |
|
|
|
|
TableDataDesensitizationItem desensitizationItem = getCurrentSelectBean(); |
|
|
|
|
int selectedRow = table.getSelectedRow(); |
|
|
|
|
BasicDialog ruleDialog = rulePane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(parent), new DialogActionAdapter() { |
|
|
|
@ -443,7 +443,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
|
|
|
|
|
DesensitizationRule rule = currentItem.getRule(); |
|
|
|
|
if (needMarkRule(rule)) { |
|
|
|
|
// 非正常规则,根据规则状态展示不同提示文字
|
|
|
|
|
DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(rule, lastedRules); |
|
|
|
|
DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(rule, latestRules); |
|
|
|
|
this.ruleStatusLabel.setText(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Status_Abnormal")); |
|
|
|
|
this.ruleStatusLabel.setToolTipText(ruleStatus.getDescription()); |
|
|
|
|
} else { |
|
|
|
@ -516,13 +516,13 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
|
|
|
|
|
Iterator<TableDataDesensitizationItem> iterator = items.iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
TableDataDesensitizationItem item = iterator.next(); |
|
|
|
|
DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(item.getRule(), lastedRules); |
|
|
|
|
DesensitizationRuleStatus ruleStatus = DesensitizationRuleManager.getInstance().getRuleStatus(item.getRule(), latestRules); |
|
|
|
|
if (ruleStatus == DesensitizationRuleStatus.REMOVED) { |
|
|
|
|
// 规则被移除,则删除整条脱敏Item
|
|
|
|
|
iterator.remove(); |
|
|
|
|
} else { |
|
|
|
|
// 规则被修改、禁用等,更新一下规则
|
|
|
|
|
item.setRule(DesensitizationRuleManager.getInstance().getLastedDesentizationRule(item.getRule(), lastedRules)); |
|
|
|
|
item.setRule(DesensitizationRuleManager.getInstance().getLastedDesentizationRule(item.getRule(), latestRules)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
fireTableDataChanged(); |
|
|
|
|