|
|
|
@ -1,11 +1,11 @@
|
|
|
|
|
package com.fr.design.mainframe.cell.settingpane.desensitization.model; |
|
|
|
|
|
|
|
|
|
import com.fr.base.operator.org.OrganizationOperator; |
|
|
|
|
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.beans.BasicBeanPane; |
|
|
|
|
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; |
|
|
|
@ -22,11 +22,11 @@ import com.fr.design.layout.VerticalFlowLayout;
|
|
|
|
|
import com.fr.report.cell.desensitization.CellDesensitizationBean; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.third.org.apache.commons.collections4.map.HashedMap; |
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
|
|
|
|
|
import javax.swing.JComponent; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
import javax.swing.SwingWorker; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Color; |
|
|
|
|
import java.awt.Component; |
|
|
|
@ -56,8 +56,8 @@ public class DesensitizationCellPane extends BasicBeanPane {
|
|
|
|
|
private UITextField ruleTextField; |
|
|
|
|
private UIComboCheckBox rolesComboBox; |
|
|
|
|
private static final String APOSTROPHE = "..."; |
|
|
|
|
private Map<String, String> roleMap; |
|
|
|
|
private DesensitizationRule rule; |
|
|
|
|
private static Map<String, String> roleMap; |
|
|
|
|
private static Map<DesensitizationRuleSource, Map<String, DesensitizationRule>> latestRules; |
|
|
|
|
private CellDesensitizationTableModel model; |
|
|
|
|
|
|
|
|
@ -141,7 +141,6 @@ public class DesensitizationCellPane extends BasicBeanPane {
|
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
|
|
CellDesensitizationBean selectBean = model.getSelectedValue(); |
|
|
|
|
latestRules = DesensitizationRuleManager.getInstance().getAllRules(); |
|
|
|
|
DesensitizationRulePane rulePane = new DesensitizationRulePane(latestRules); |
|
|
|
|
BasicDialog ruleDialog = rulePane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(parent), new DialogActionAdapter() { |
|
|
|
|
|
|
|
|
@ -204,7 +203,6 @@ public class DesensitizationCellPane extends BasicBeanPane {
|
|
|
|
|
public void populate(CellDesensitizationBean value, int row) { |
|
|
|
|
|
|
|
|
|
refreshRoles(); |
|
|
|
|
|
|
|
|
|
String ruleName = value.getDesensitizationRule().getRuleName(); |
|
|
|
|
ruleTextField.setText(ruleName); |
|
|
|
|
|
|
|
|
@ -218,14 +216,10 @@ public class DesensitizationCellPane extends BasicBeanPane {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 刷新用户组信息 |
|
|
|
|
* combobox组件刷新用户组信息 |
|
|
|
|
*/ |
|
|
|
|
private void refreshRoles() { |
|
|
|
|
Map<String, String> roles = TableDataPreviewDesensitizeManager.getInstance().getAllRoles(); |
|
|
|
|
if (!roleMap.equals(roles)) { |
|
|
|
|
roleMap = roles; |
|
|
|
|
rolesComboBox.refreshCombo(roles.values().toArray()); |
|
|
|
|
} |
|
|
|
|
rolesComboBox.refreshCombo(roleMap.values().toArray()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void refreshRuleState(CellDesensitizationBean value) { |
|
|
|
@ -310,4 +304,15 @@ public class DesensitizationCellPane extends BasicBeanPane {
|
|
|
|
|
return omitText.equals(StringUtils.EMPTY) ? text : omitText; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 刷新用户组和平台规则 |
|
|
|
|
*/ |
|
|
|
|
public void refresh() { |
|
|
|
|
|
|
|
|
|
roleMap = WorkContext.getCurrent().get(OrganizationOperator.class).getAllRoles(); |
|
|
|
|
|
|
|
|
|
latestRules = DesensitizationRuleManager.getInstance().getAllRules(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|