|
|
@ -33,6 +33,7 @@ import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
import com.fr.design.ui.util.UIUtil; |
|
|
|
import com.fr.design.ui.util.UIUtil; |
|
|
|
|
|
|
|
import com.fr.esd.query.StrategicTableData; |
|
|
|
import com.fr.function.TIME; |
|
|
|
import com.fr.function.TIME; |
|
|
|
import com.fr.general.FRFont; |
|
|
|
import com.fr.general.FRFont; |
|
|
|
import com.fr.general.data.DataModel; |
|
|
|
import com.fr.general.data.DataModel; |
|
|
@ -223,6 +224,18 @@ public class PreviewTablePane extends BasicPane { |
|
|
|
* 点击脱敏配置后的操作 |
|
|
|
* 点击脱敏配置后的操作 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void clickDesensitizationLabel() { |
|
|
|
public void clickDesensitizationLabel() { |
|
|
|
|
|
|
|
// 埋点记录
|
|
|
|
|
|
|
|
recordDesensitization(); |
|
|
|
|
|
|
|
// 判断数据集类型
|
|
|
|
|
|
|
|
if (isGlobalTableData()) { |
|
|
|
|
|
|
|
// 服务器数据集不允许在设计器端修改脱敏配置
|
|
|
|
|
|
|
|
FineJOptionPane.showMessageDialog( |
|
|
|
|
|
|
|
this, |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Report_Cannot_Modify_Desensitization_Config_Of_ServerTableData"), |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Alert"), |
|
|
|
|
|
|
|
FineJOptionPane.WARNING_MESSAGE); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
TableDataDesensitizationSettingPane settingPane = new TableDataDesensitizationSettingPane((DesensitizationTableData) tableData); |
|
|
|
TableDataDesensitizationSettingPane settingPane = new TableDataDesensitizationSettingPane((DesensitizationTableData) tableData); |
|
|
|
settingPane.populateBean((DesensitizationTableData) tableData); |
|
|
|
settingPane.populateBean((DesensitizationTableData) tableData); |
|
|
|
BasicDialog dialog = settingPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(PreviewTablePane.this), new DialogActionAdapter() { |
|
|
|
BasicDialog dialog = settingPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(PreviewTablePane.this), new DialogActionAdapter() { |
|
|
@ -248,25 +261,41 @@ public class PreviewTablePane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置脱敏设置的个数 |
|
|
|
* 触发数据脱敏埋点记录 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return 数据脱敏字段数量 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private int recordDesensitization() { |
|
|
|
|
|
|
|
return getCurrentTableDataDesensitizaitionCount(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 当前tableData是否为服务器数据集或服务器存储过程 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param model |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void setDesensitizationCount(TableModel model) { |
|
|
|
public boolean isGlobalTableData() { |
|
|
|
desensitizationPane.setDesensitizationCount(isDesensitizeOpened(), |
|
|
|
return this.tableData instanceof StrategicTableData && |
|
|
|
model instanceof DesensitizedPreviewTableModel ? |
|
|
|
DesignTableDataManager.isGlobalTableData(((StrategicTableData) this.tableData).getDsName()); |
|
|
|
((DesensitizedPreviewTableModel) model).getDesensitizeColumnsCount() : |
|
|
|
|
|
|
|
0); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 根据TableData设置脱敏设置的个数 |
|
|
|
* 根据TableData设置脱敏设置的个数 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void setDesensitizationCountByTableData() { |
|
|
|
private void setDesensitizationCountByTableData() { |
|
|
|
desensitizationPane.setDesensitizationCount(isDesensitizeOpened(), |
|
|
|
desensitizationPane.setDesensitizationCount(isDesensitizeOpened(), getCurrentTableDataDesensitizaitionCount()); |
|
|
|
this.tableData instanceof DesensitizationTableData ? |
|
|
|
desensitizationPane.dealWithTableDataType(isGlobalTableData()); |
|
|
|
((DesensitizationTableData) this.tableData).getDesensitizationConfig().getDesensitizationItems().size() : |
|
|
|
} |
|
|
|
0); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取当前数据集中设置脱敏规则的个数 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private int getCurrentTableDataDesensitizaitionCount() { |
|
|
|
|
|
|
|
return this.tableData instanceof DesensitizationTableData ? |
|
|
|
|
|
|
|
((DesensitizationTableData) this.tableData).getDesensitizationConfig().getDesensitizationItems().size() : |
|
|
|
|
|
|
|
0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|