fix: 脱敏字段删除改为标记

This commit is contained in:
wisonic-s 2023-12-07 17:57:08 +08:00
parent df3a938548
commit 58f02b5eec
4 changed files with 20 additions and 5 deletions

View File

@ -193,12 +193,13 @@ public class DatasetTableFieldManage {
List<DatasetTableFieldDTO> fields = selectByDatasetGroupId(id);
Map<String, ColumnPermissionItem> desensitizationList = new HashMap<>();
Long userId = AuthUtils.getUser() == null ? null : AuthUtils.getUser().getUserId();
return permissionManage
List<DatasetTableFieldDTO> tmp = permissionManage
.filterColumnPermissions(fields, desensitizationList, id, userId)
.stream()
.filter(o -> !desensitizationList.containsKey(o.getDataeaseName()))
.sorted(Comparator.comparing(DatasetTableFieldDTO::getGroupType))
.toList();
tmp.forEach(ele -> ele.setDesensitized(desensitizationList.containsKey(ele.getDataeaseName())));
return tmp;
}

View File

@ -15,6 +15,7 @@ export interface Field {
extField: number
checked: boolean
fieldShortName: string
desensitized: boolean
}
export interface ComponentInfo {

View File

@ -836,8 +836,12 @@ defineExpose({
:key="ele.id"
:label="ele.name"
:value="ele.id"
:disabled="ele.desensitized"
>
<div
class="flex-align-center icon"
:title="ele.desensitized ? '脱敏字段,不能被设置为查询条件' : ''"
>
<div class="flex-align-center icon">
<el-icon>
<Icon
:name="`field_${fieldType[ele.deType]}`"
@ -986,8 +990,12 @@ defineExpose({
:key="ele.id"
:label="ele.name"
:value="ele.id"
:disabled="ele.desensitized"
>
<div
class="flex-align-center icon"
:title="ele.desensitized ? '脱敏字段,不能被设置为查询条件' : ''"
>
<div class="flex-align-center icon">
<el-icon>
<Icon
:name="`field_${fieldType[ele.deType]}`"

View File

@ -121,4 +121,9 @@ public class DatasetTableFieldDTO implements Serializable {
* 字段short name
*/
private String fieldShortName;
/**
* 是否脱敏
*/
private Boolean desensitized;
}