@liujitcn/kratos-admin-system 0.0.32 → 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package/declarations/src/api/system/admin/v1/base_redact_output_policy.d.ts +19 -0
- package/dist/package/declarations/src/api/system/{base_redact_rule.d.ts → admin/v1/base_redact_rule.d.ts} +1 -1
- package/dist/package/declarations/src/api/system/admin/v1/base_redact_storage_policy.d.ts +19 -0
- package/dist/package/declarations/src/locales/generated.d.ts +292 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_output_policy.d.ts +135 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_rule.d.ts +0 -4
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_storage_policy.d.ts +114 -0
- package/dist/package/src/api/system/admin/v1/base_redact_output_policy.ts +51 -0
- package/dist/package/src/api/system/{base_redact_rule.ts → admin/v1/base_redact_rule.ts} +1 -1
- package/dist/package/src/api/system/admin/v1/base_redact_storage_policy.ts +51 -0
- package/dist/package/src/locales/en-US.json +74 -1
- package/dist/package/src/locales/ja-JP.json +74 -1
- package/dist/package/src/locales/zh-CN.json +74 -1
- package/dist/package/src/locales/zh-TW.json +74 -1
- package/dist/package/src/rpc/base/v1/ai_message.ts +1 -1
- package/dist/package/src/rpc/base/v1/ai_session.ts +1 -1
- package/dist/package/src/rpc/base/v1/ai_tool.ts +1 -1
- package/dist/package/src/rpc/base/v1/config.ts +1 -1
- package/dist/package/src/rpc/base/v1/login.ts +1 -1
- package/dist/package/src/rpc/base/v1/notification.ts +1 -1
- package/dist/package/src/rpc/base/v1/oauth.ts +1 -1
- package/dist/package/src/rpc/base/v1/oauth_client.ts +1 -1
- package/dist/package/src/rpc/base/v1/sse.ts +1 -1
- package/dist/package/src/rpc/common/v1/analytics.ts +1 -1
- package/dist/package/src/rpc/common/v1/common.ts +1 -1
- package/dist/package/src/rpc/common/v1/enum.ts +1 -1
- package/dist/package/src/rpc/common/v1/types.ts +1 -1
- package/dist/package/src/rpc/google/protobuf/empty.ts +1 -1
- package/dist/package/src/rpc/google/protobuf/timestamp.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/auth.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_api.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_api_log.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_area.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_config.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_dashboard.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_data_access_log.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_dept.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_dict.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_dict_item.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_file.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_i18n.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_job.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_job_log.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_language.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_log.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_login_log.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_login_policy.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_menu.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_message.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_message_category.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_migration.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_operation_log.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_permission_log.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_policy_evaluation_log.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_post.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_redact_common.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_redact_output_policy.ts +157 -0
- package/dist/package/src/rpc/system/admin/v1/base_redact_rule.ts +1 -5
- package/dist/package/src/rpc/system/admin/v1/base_redact_storage_policy.ts +137 -0
- package/dist/package/src/rpc/system/admin/v1/base_role.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_session.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_table_archive.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_table_archive_record.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_table_archive_restore.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_table_backup.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_table_backup_record.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_table_backup_restore.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_table_source.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_tenant.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_third_account.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/base_user.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/cache.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/code_gen.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/code_gen_column.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/code_gen_proto.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/code_gen_table.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/common.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/oauth_client.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/ops_monitoring.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/project_document.ts +1 -1
- package/dist/package/src/rpc/system/admin/v1/runtime_log.ts +1 -1
- package/dist/package/src/rpc/system/common/v1/common.ts +1 -1
- package/dist/package/src/rpc/system/config/v1/system_config.ts +1 -1
- package/dist/package/src/views/base/redact-output-policy/index.vue +324 -0
- package/dist/package/src/views/base/redact-rule/index.vue +339 -29
- package/dist/package/src/views/base/redact-storage-policy/index.vue +276 -0
- package/package.json +2 -2
- package/dist/package/declarations/src/api/system/base_redact_field.d.ts +0 -20
- package/dist/package/declarations/src/api/system/base_redact_policy.d.ts +0 -19
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_field.d.ts +0 -161
- package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_policy.d.ts +0 -150
- package/dist/package/src/api/system/base_redact_field.ts +0 -25
- package/dist/package/src/api/system/base_redact_policy.ts +0 -24
- package/dist/package/src/rpc/system/admin/v1/base_redact_field.ts +0 -182
- package/dist/package/src/rpc/system/admin/v1/base_redact_policy.ts +0 -174
- package/dist/package/src/views/base/redact-field/index.vue +0 -59
- package/dist/package/src/views/base/redact-policy/index.vue +0 -92
- /package/dist/package/declarations/src/views/base/{redact-field → redact-output-policy}/index.vue.d.ts +0 -0
- /package/dist/package/declarations/src/views/base/{redact-policy → redact-storage-policy}/index.vue.d.ts +0 -0
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import type { Status } from "../../../common/v1/enum";
|
|
2
|
-
import type { Empty } from "../../../google/protobuf/empty";
|
|
3
|
-
import type { BaseRedactDirection } from "./base_redact_common";
|
|
4
|
-
/** 脱敏策略模式。 */
|
|
5
|
-
export declare enum BaseRedactPolicyMode {
|
|
6
|
-
/** BASE_REDACT_POLICY_MODE_UNSPECIFIED - 未指定模式。 */
|
|
7
|
-
BASE_REDACT_POLICY_MODE_UNSPECIFIED = 0,
|
|
8
|
-
/** BASE_REDACT_POLICY_MODE_RULE - 使用规则模板处理。 */
|
|
9
|
-
BASE_REDACT_POLICY_MODE_RULE = 1,
|
|
10
|
-
/** BASE_REDACT_POLICY_MODE_HIDE - 替换为字段零值。 */
|
|
11
|
-
BASE_REDACT_POLICY_MODE_HIDE = 2,
|
|
12
|
-
/** BASE_REDACT_POLICY_MODE_FULL - 保留字段原值。 */
|
|
13
|
-
BASE_REDACT_POLICY_MODE_FULL = 3
|
|
14
|
-
}
|
|
15
|
-
/** 脱敏策略分页查询条件。 */
|
|
16
|
-
export interface PageBaseRedactPolicyRequest {
|
|
17
|
-
/** Proto消息完整名称 */
|
|
18
|
-
message_ref: string;
|
|
19
|
-
/** 字段路径 */
|
|
20
|
-
field_path: string;
|
|
21
|
-
/** 场景编码 */
|
|
22
|
-
scene_code: string;
|
|
23
|
-
/** 接口操作 */
|
|
24
|
-
operation: string;
|
|
25
|
-
/** 脱敏方向 */
|
|
26
|
-
direction?: BaseRedactDirection | undefined;
|
|
27
|
-
/** 策略模式 */
|
|
28
|
-
mode?: BaseRedactPolicyMode | undefined;
|
|
29
|
-
/** 状态 */
|
|
30
|
-
status?: Status | undefined;
|
|
31
|
-
/** 当前页码 */
|
|
32
|
-
page_num: number;
|
|
33
|
-
/** 每页数量 */
|
|
34
|
-
page_size: number;
|
|
35
|
-
}
|
|
36
|
-
/** 脱敏策略分页响应。 */
|
|
37
|
-
export interface PageBaseRedactPolicyResponse {
|
|
38
|
-
/** 脱敏策略列表 */
|
|
39
|
-
base_redact_policies: BaseRedactPolicy[];
|
|
40
|
-
/** 总数 */
|
|
41
|
-
total: number;
|
|
42
|
-
}
|
|
43
|
-
/** 脱敏策略详情查询条件。 */
|
|
44
|
-
export interface GetBaseRedactPolicyRequest {
|
|
45
|
-
id: number;
|
|
46
|
-
}
|
|
47
|
-
/** 脱敏策略表单。 */
|
|
48
|
-
export interface BaseRedactPolicyForm {
|
|
49
|
-
/** 策略绑定ID */
|
|
50
|
-
id: number;
|
|
51
|
-
/** 字段目录ID */
|
|
52
|
-
field_id: number;
|
|
53
|
-
/** 规则模板ID */
|
|
54
|
-
rule_id: number;
|
|
55
|
-
/** 场景编码 */
|
|
56
|
-
scene_code: string;
|
|
57
|
-
/** 接口操作 */
|
|
58
|
-
operation: string;
|
|
59
|
-
/** 脱敏方向 */
|
|
60
|
-
direction: BaseRedactDirection;
|
|
61
|
-
/** 策略模式 */
|
|
62
|
-
mode: BaseRedactPolicyMode;
|
|
63
|
-
/** 优先级 */
|
|
64
|
-
priority: number;
|
|
65
|
-
/** 状态 */
|
|
66
|
-
status: Status;
|
|
67
|
-
/** 策略版本 */
|
|
68
|
-
version: number;
|
|
69
|
-
/** 备注 */
|
|
70
|
-
remark: string;
|
|
71
|
-
}
|
|
72
|
-
/** 创建脱敏策略请求参数。 */
|
|
73
|
-
export interface CreateBaseRedactPolicyRequest {
|
|
74
|
-
base_redact_policy: BaseRedactPolicyForm | undefined;
|
|
75
|
-
}
|
|
76
|
-
/** 更新脱敏策略请求参数。 */
|
|
77
|
-
export interface UpdateBaseRedactPolicyRequest {
|
|
78
|
-
base_redact_policy: BaseRedactPolicyForm | undefined;
|
|
79
|
-
}
|
|
80
|
-
/** 删除脱敏策略请求参数。 */
|
|
81
|
-
export interface DeleteBaseRedactPolicyRequest {
|
|
82
|
-
id: string;
|
|
83
|
-
}
|
|
84
|
-
/** 设置脱敏策略状态请求参数。 */
|
|
85
|
-
export interface SetBaseRedactPolicyStatusRequest {
|
|
86
|
-
/** 策略绑定ID */
|
|
87
|
-
id: number;
|
|
88
|
-
/** 状态 */
|
|
89
|
-
status: Status;
|
|
90
|
-
}
|
|
91
|
-
/** 脱敏策略。 */
|
|
92
|
-
export interface BaseRedactPolicy {
|
|
93
|
-
/** 策略绑定ID */
|
|
94
|
-
id: number;
|
|
95
|
-
/** 字段目录ID */
|
|
96
|
-
field_id: number;
|
|
97
|
-
/** Proto消息完整名称 */
|
|
98
|
-
message_ref: string;
|
|
99
|
-
/** 字段路径 */
|
|
100
|
-
field_path: string;
|
|
101
|
-
/** Proto字段类型 */
|
|
102
|
-
field_kind: string;
|
|
103
|
-
/** 敏感字段类型 */
|
|
104
|
-
sensitivity_type: string;
|
|
105
|
-
/** 规则模板ID */
|
|
106
|
-
rule_id: number;
|
|
107
|
-
/** 规则编码 */
|
|
108
|
-
rule_code: string;
|
|
109
|
-
/** 规则名称 */
|
|
110
|
-
rule_name: string;
|
|
111
|
-
/** 规则类型 */
|
|
112
|
-
rule_type: string;
|
|
113
|
-
/** 规则参数 */
|
|
114
|
-
rule: string;
|
|
115
|
-
/** 场景编码 */
|
|
116
|
-
scene_code: string;
|
|
117
|
-
/** 接口操作 */
|
|
118
|
-
operation: string;
|
|
119
|
-
/** 脱敏方向 */
|
|
120
|
-
direction: BaseRedactDirection;
|
|
121
|
-
/** 策略模式 */
|
|
122
|
-
mode: BaseRedactPolicyMode;
|
|
123
|
-
/** 优先级 */
|
|
124
|
-
priority: number;
|
|
125
|
-
/** 状态 */
|
|
126
|
-
status: Status;
|
|
127
|
-
/** 策略版本 */
|
|
128
|
-
version: number;
|
|
129
|
-
/** 备注 */
|
|
130
|
-
remark: string;
|
|
131
|
-
/** 创建时间 */
|
|
132
|
-
created_at: string;
|
|
133
|
-
/** 更新时间 */
|
|
134
|
-
updated_at: string;
|
|
135
|
-
}
|
|
136
|
-
/** Admin脱敏策略绑定服务。 */
|
|
137
|
-
export interface BaseRedactPolicyService {
|
|
138
|
-
/** 查询脱敏策略分页列表。 */
|
|
139
|
-
PageBaseRedactPolicy(request: PageBaseRedactPolicyRequest): Promise<PageBaseRedactPolicyResponse>;
|
|
140
|
-
/** 查询脱敏策略详情。 */
|
|
141
|
-
GetBaseRedactPolicy(request: GetBaseRedactPolicyRequest): Promise<BaseRedactPolicyForm>;
|
|
142
|
-
/** 创建脱敏策略。 */
|
|
143
|
-
CreateBaseRedactPolicy(request: CreateBaseRedactPolicyRequest): Promise<Empty>;
|
|
144
|
-
/** 更新脱敏策略。 */
|
|
145
|
-
UpdateBaseRedactPolicy(request: UpdateBaseRedactPolicyRequest): Promise<Empty>;
|
|
146
|
-
/** 删除脱敏策略。 */
|
|
147
|
-
DeleteBaseRedactPolicy(request: DeleteBaseRedactPolicyRequest): Promise<Empty>;
|
|
148
|
-
/** 设置脱敏策略状态。 */
|
|
149
|
-
SetBaseRedactPolicyStatus(request: SetBaseRedactPolicyStatusRequest): Promise<Empty>;
|
|
150
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import service from "@liujitcn/kratos-admin-core/request";
|
|
2
|
-
import type { BaseRedactFieldForm, BaseRedactFieldService, DeleteBaseRedactFieldRequest, GetBaseRedactFieldRequest, OptionBaseRedactFieldRequest, PageBaseRedactFieldRequest, PageBaseRedactFieldResponse, SetBaseRedactFieldStatusRequest, UpdateBaseRedactFieldRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_redact_field";
|
|
3
|
-
import type { SelectOptionResponse } from "@liujitcn/kratos-admin-system/rpc/common/v1/common";
|
|
4
|
-
import type { Empty } from "@liujitcn/kratos-admin-system/rpc/google/protobuf/empty";
|
|
5
|
-
|
|
6
|
-
const BASE_REDACT_FIELD_URL = "/v1/admin/base/redact-field";
|
|
7
|
-
|
|
8
|
-
/** Admin脱敏字段目录服务。 */
|
|
9
|
-
export class BaseRedactFieldServiceImpl implements BaseRedactFieldService {
|
|
10
|
-
/** 查询脱敏字段选项。 */
|
|
11
|
-
OptionBaseRedactField(request: OptionBaseRedactFieldRequest = { keyword: "", operation: "" }): Promise<SelectOptionResponse> { return service<OptionBaseRedactFieldRequest, SelectOptionResponse>({ url: `${BASE_REDACT_FIELD_URL}/option`, method: "get", params: request }); }
|
|
12
|
-
/** 查询脱敏字段分页列表。 */
|
|
13
|
-
PageBaseRedactField(request: PageBaseRedactFieldRequest): Promise<PageBaseRedactFieldResponse> { return service<PageBaseRedactFieldRequest, PageBaseRedactFieldResponse>({ url: BASE_REDACT_FIELD_URL, method: "get", params: request }); }
|
|
14
|
-
/** 查询脱敏字段详情。 */
|
|
15
|
-
GetBaseRedactField(request: GetBaseRedactFieldRequest): Promise<BaseRedactFieldForm> { return service<GetBaseRedactFieldRequest, BaseRedactFieldForm>({ url: `${BASE_REDACT_FIELD_URL}/${request.id}`, method: "get" }); }
|
|
16
|
-
/** 更新脱敏字段。 */
|
|
17
|
-
UpdateBaseRedactField(request: UpdateBaseRedactFieldRequest): Promise<Empty> { return service<BaseRedactFieldForm | undefined, Empty>({ url: `${BASE_REDACT_FIELD_URL}/${request.base_redact_field?.id ?? ""}`, method: "put", data: request.base_redact_field }); }
|
|
18
|
-
/** 删除脱敏字段。 */
|
|
19
|
-
DeleteBaseRedactField(request: DeleteBaseRedactFieldRequest): Promise<Empty> { return service<DeleteBaseRedactFieldRequest, Empty>({ url: `${BASE_REDACT_FIELD_URL}/${request.id}`, method: "delete" }); }
|
|
20
|
-
/** 设置脱敏字段状态。 */
|
|
21
|
-
SetBaseRedactFieldStatus(request: SetBaseRedactFieldStatusRequest): Promise<Empty> { return service<SetBaseRedactFieldStatusRequest, Empty>({ url: `${BASE_REDACT_FIELD_URL}/${request.id}/status`, method: "put", data: request }); }
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** defBaseRedactFieldService 脱敏字段目录服务实例。 */
|
|
25
|
-
export const defBaseRedactFieldService = new BaseRedactFieldServiceImpl();
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import service from "@liujitcn/kratos-admin-core/request";
|
|
2
|
-
import type { BaseRedactPolicyForm, BaseRedactPolicyService, CreateBaseRedactPolicyRequest, DeleteBaseRedactPolicyRequest, GetBaseRedactPolicyRequest, PageBaseRedactPolicyRequest, PageBaseRedactPolicyResponse, SetBaseRedactPolicyStatusRequest, UpdateBaseRedactPolicyRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_redact_policy";
|
|
3
|
-
import type { Empty } from "@liujitcn/kratos-admin-system/rpc/google/protobuf/empty";
|
|
4
|
-
|
|
5
|
-
const BASE_REDACT_POLICY_URL = "/v1/admin/base/redact-policy";
|
|
6
|
-
|
|
7
|
-
/** Admin脱敏策略绑定服务。 */
|
|
8
|
-
export class BaseRedactPolicyServiceImpl implements BaseRedactPolicyService {
|
|
9
|
-
/** 查询脱敏策略分页列表。 */
|
|
10
|
-
PageBaseRedactPolicy(request: PageBaseRedactPolicyRequest): Promise<PageBaseRedactPolicyResponse> { return service<PageBaseRedactPolicyRequest, PageBaseRedactPolicyResponse>({ url: BASE_REDACT_POLICY_URL, method: "get", params: request }); }
|
|
11
|
-
/** 查询脱敏策略详情。 */
|
|
12
|
-
GetBaseRedactPolicy(request: GetBaseRedactPolicyRequest): Promise<BaseRedactPolicyForm> { return service<GetBaseRedactPolicyRequest, BaseRedactPolicyForm>({ url: `${BASE_REDACT_POLICY_URL}/${request.id}`, method: "get" }); }
|
|
13
|
-
/** 创建脱敏策略。 */
|
|
14
|
-
CreateBaseRedactPolicy(request: CreateBaseRedactPolicyRequest): Promise<Empty> { return service<BaseRedactPolicyForm | undefined, Empty>({ url: BASE_REDACT_POLICY_URL, method: "post", data: request.base_redact_policy }); }
|
|
15
|
-
/** 更新脱敏策略。 */
|
|
16
|
-
UpdateBaseRedactPolicy(request: UpdateBaseRedactPolicyRequest): Promise<Empty> { return service<BaseRedactPolicyForm | undefined, Empty>({ url: `${BASE_REDACT_POLICY_URL}/${request.base_redact_policy?.id ?? ""}`, method: "put", data: request.base_redact_policy }); }
|
|
17
|
-
/** 删除脱敏策略。 */
|
|
18
|
-
DeleteBaseRedactPolicy(request: DeleteBaseRedactPolicyRequest): Promise<Empty> { return service<DeleteBaseRedactPolicyRequest, Empty>({ url: `${BASE_REDACT_POLICY_URL}/${request.id}`, method: "delete" }); }
|
|
19
|
-
/** 设置脱敏策略状态。 */
|
|
20
|
-
SetBaseRedactPolicyStatus(request: SetBaseRedactPolicyStatusRequest): Promise<Empty> { return service<SetBaseRedactPolicyStatusRequest, Empty>({ url: `${BASE_REDACT_POLICY_URL}/${request.id}/status`, method: "put", data: request }); }
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/** defBaseRedactPolicyService 脱敏策略绑定服务实例。 */
|
|
24
|
-
export const defBaseRedactPolicyService = new BaseRedactPolicyServiceImpl();
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.8
|
|
4
|
-
// protoc unknown
|
|
5
|
-
// source: system/admin/v1/base_redact_field.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
import type { SelectOptionResponse } from "../../../common/v1/common";
|
|
9
|
-
import type { Status } from "../../../common/v1/enum";
|
|
10
|
-
import type { Empty } from "../../../google/protobuf/empty";
|
|
11
|
-
import type { BaseRedactDirection } from "./base_redact_common";
|
|
12
|
-
|
|
13
|
-
/** 字段数据库存储方式。 */
|
|
14
|
-
export enum BaseRedactStorageMode {
|
|
15
|
-
/** BASE_REDACT_STORAGE_MODE_UNSPECIFIED - 未配置存储方式,服务端拒绝启用字段存储保护。 */
|
|
16
|
-
BASE_REDACT_STORAGE_MODE_UNSPECIFIED = 0,
|
|
17
|
-
/** BASE_REDACT_STORAGE_MODE_PLAIN - 主表保存明文。 */
|
|
18
|
-
BASE_REDACT_STORAGE_MODE_PLAIN = 1,
|
|
19
|
-
/** BASE_REDACT_STORAGE_MODE_MASK - 主表保存脱敏值,旁表保存加密原文。 */
|
|
20
|
-
BASE_REDACT_STORAGE_MODE_MASK = 2,
|
|
21
|
-
/** BASE_REDACT_STORAGE_MODE_HASH - 主表保存不可逆哈希。 */
|
|
22
|
-
BASE_REDACT_STORAGE_MODE_HASH = 3,
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** 敏感字段查询方式。 */
|
|
26
|
-
export enum BaseRedactSearchMode {
|
|
27
|
-
/** BASE_REDACT_SEARCH_MODE_UNSPECIFIED - 未配置查询方式。 */
|
|
28
|
-
BASE_REDACT_SEARCH_MODE_UNSPECIFIED = 0,
|
|
29
|
-
/** BASE_REDACT_SEARCH_MODE_NONE - 不支持敏感字段查询。 */
|
|
30
|
-
BASE_REDACT_SEARCH_MODE_NONE = 1,
|
|
31
|
-
/** BASE_REDACT_SEARCH_MODE_DIGEST - 使用 HMAC 摘要进行精确查询。 */
|
|
32
|
-
BASE_REDACT_SEARCH_MODE_DIGEST = 2,
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/** 脱敏字段选项查询条件。 */
|
|
36
|
-
export interface OptionBaseRedactFieldRequest {
|
|
37
|
-
/** 字段关键字 */
|
|
38
|
-
keyword: string;
|
|
39
|
-
/** 接口操作 */
|
|
40
|
-
operation: string;
|
|
41
|
-
/** 脱敏方向 */
|
|
42
|
-
direction?: BaseRedactDirection | undefined;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** 脱敏字段分页查询条件。 */
|
|
46
|
-
export interface PageBaseRedactFieldRequest {
|
|
47
|
-
/** Proto消息完整名称 */
|
|
48
|
-
message_ref: string;
|
|
49
|
-
/** 字段路径 */
|
|
50
|
-
field_path: string;
|
|
51
|
-
/** 敏感字段类型 */
|
|
52
|
-
sensitivity_type: string;
|
|
53
|
-
/** 字段来源 */
|
|
54
|
-
source: string;
|
|
55
|
-
/** 状态 */
|
|
56
|
-
status?:
|
|
57
|
-
| Status
|
|
58
|
-
| undefined;
|
|
59
|
-
/** 当前页码 */
|
|
60
|
-
page_num: number;
|
|
61
|
-
/** 每页数量 */
|
|
62
|
-
page_size: number;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** 脱敏字段分页响应。 */
|
|
66
|
-
export interface PageBaseRedactFieldResponse {
|
|
67
|
-
/** 字段列表 */
|
|
68
|
-
base_redact_fields: BaseRedactField[];
|
|
69
|
-
/** 总数 */
|
|
70
|
-
total: number;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** 脱敏字段详情查询条件。 */
|
|
74
|
-
export interface GetBaseRedactFieldRequest {
|
|
75
|
-
id: number;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/** 脱敏字段表单。 */
|
|
79
|
-
export interface BaseRedactFieldForm {
|
|
80
|
-
/** 字段目录ID */
|
|
81
|
-
id: number;
|
|
82
|
-
/** Proto消息完整名称 */
|
|
83
|
-
message_ref: string;
|
|
84
|
-
/** 字段路径 */
|
|
85
|
-
field_path: string;
|
|
86
|
-
/** Proto字段类型 */
|
|
87
|
-
field_kind: string;
|
|
88
|
-
/** 敏感字段类型 */
|
|
89
|
-
sensitivity_type: string;
|
|
90
|
-
/** 字段来源 */
|
|
91
|
-
source: string;
|
|
92
|
-
/** 数据实体标识 */
|
|
93
|
-
entity_ref: string;
|
|
94
|
-
/** 数据库表名 */
|
|
95
|
-
table_name: string;
|
|
96
|
-
/** 数据库字段名 */
|
|
97
|
-
column_name: string;
|
|
98
|
-
/** 业务主键字段 */
|
|
99
|
-
record_key_field: string;
|
|
100
|
-
/** 数据库存储方式 */
|
|
101
|
-
storage_mode: BaseRedactStorageMode;
|
|
102
|
-
/** 存储脱敏规则ID */
|
|
103
|
-
storage_rule_id: number;
|
|
104
|
-
/** 敏感字段查询方式 */
|
|
105
|
-
search_mode: BaseRedactSearchMode;
|
|
106
|
-
/** 状态 */
|
|
107
|
-
status: Status;
|
|
108
|
-
/** 备注 */
|
|
109
|
-
remark: string;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/** 更新脱敏字段请求参数。 */
|
|
113
|
-
export interface UpdateBaseRedactFieldRequest {
|
|
114
|
-
base_redact_field: BaseRedactFieldForm | undefined;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/** 删除脱敏字段请求参数。 */
|
|
118
|
-
export interface DeleteBaseRedactFieldRequest {
|
|
119
|
-
id: string;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/** 设置脱敏字段状态请求参数。 */
|
|
123
|
-
export interface SetBaseRedactFieldStatusRequest {
|
|
124
|
-
/** 字段目录ID */
|
|
125
|
-
id: number;
|
|
126
|
-
/** 状态 */
|
|
127
|
-
status: Status;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/** 脱敏字段目录。 */
|
|
131
|
-
export interface BaseRedactField {
|
|
132
|
-
/** 字段目录ID */
|
|
133
|
-
id: number;
|
|
134
|
-
/** Proto消息完整名称 */
|
|
135
|
-
message_ref: string;
|
|
136
|
-
/** 字段路径 */
|
|
137
|
-
field_path: string;
|
|
138
|
-
/** Proto字段类型 */
|
|
139
|
-
field_kind: string;
|
|
140
|
-
/** 敏感字段类型 */
|
|
141
|
-
sensitivity_type: string;
|
|
142
|
-
/** 字段来源 */
|
|
143
|
-
source: string;
|
|
144
|
-
/** 数据实体标识 */
|
|
145
|
-
entity_ref: string;
|
|
146
|
-
/** 数据库表名 */
|
|
147
|
-
table_name: string;
|
|
148
|
-
/** 数据库字段名 */
|
|
149
|
-
column_name: string;
|
|
150
|
-
/** 业务主键字段 */
|
|
151
|
-
record_key_field: string;
|
|
152
|
-
/** 数据库存储方式 */
|
|
153
|
-
storage_mode: BaseRedactStorageMode;
|
|
154
|
-
/** 存储脱敏规则ID */
|
|
155
|
-
storage_rule_id: number;
|
|
156
|
-
/** 敏感字段查询方式 */
|
|
157
|
-
search_mode: BaseRedactSearchMode;
|
|
158
|
-
/** 状态 */
|
|
159
|
-
status: Status;
|
|
160
|
-
/** 备注 */
|
|
161
|
-
remark: string;
|
|
162
|
-
/** 创建时间 */
|
|
163
|
-
created_at: string;
|
|
164
|
-
/** 更新时间 */
|
|
165
|
-
updated_at: string;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/** Admin脱敏字段目录服务。 */
|
|
169
|
-
export interface BaseRedactFieldService {
|
|
170
|
-
/** 查询脱敏字段选项。 */
|
|
171
|
-
OptionBaseRedactField(request: OptionBaseRedactFieldRequest): Promise<SelectOptionResponse>;
|
|
172
|
-
/** 查询脱敏字段分页列表。 */
|
|
173
|
-
PageBaseRedactField(request: PageBaseRedactFieldRequest): Promise<PageBaseRedactFieldResponse>;
|
|
174
|
-
/** 查询脱敏字段详情。 */
|
|
175
|
-
GetBaseRedactField(request: GetBaseRedactFieldRequest): Promise<BaseRedactFieldForm>;
|
|
176
|
-
/** 更新脱敏字段。 */
|
|
177
|
-
UpdateBaseRedactField(request: UpdateBaseRedactFieldRequest): Promise<Empty>;
|
|
178
|
-
/** 删除脱敏字段。 */
|
|
179
|
-
DeleteBaseRedactField(request: DeleteBaseRedactFieldRequest): Promise<Empty>;
|
|
180
|
-
/** 设置脱敏字段状态。 */
|
|
181
|
-
SetBaseRedactFieldStatus(request: SetBaseRedactFieldStatusRequest): Promise<Empty>;
|
|
182
|
-
}
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.8
|
|
4
|
-
// protoc unknown
|
|
5
|
-
// source: system/admin/v1/base_redact_policy.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
import type { Status } from "../../../common/v1/enum";
|
|
9
|
-
import type { Empty } from "../../../google/protobuf/empty";
|
|
10
|
-
import type { BaseRedactDirection } from "./base_redact_common";
|
|
11
|
-
|
|
12
|
-
/** 脱敏策略模式。 */
|
|
13
|
-
export enum BaseRedactPolicyMode {
|
|
14
|
-
/** BASE_REDACT_POLICY_MODE_UNSPECIFIED - 未指定模式。 */
|
|
15
|
-
BASE_REDACT_POLICY_MODE_UNSPECIFIED = 0,
|
|
16
|
-
/** BASE_REDACT_POLICY_MODE_RULE - 使用规则模板处理。 */
|
|
17
|
-
BASE_REDACT_POLICY_MODE_RULE = 1,
|
|
18
|
-
/** BASE_REDACT_POLICY_MODE_HIDE - 替换为字段零值。 */
|
|
19
|
-
BASE_REDACT_POLICY_MODE_HIDE = 2,
|
|
20
|
-
/** BASE_REDACT_POLICY_MODE_FULL - 保留字段原值。 */
|
|
21
|
-
BASE_REDACT_POLICY_MODE_FULL = 3,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** 脱敏策略分页查询条件。 */
|
|
25
|
-
export interface PageBaseRedactPolicyRequest {
|
|
26
|
-
/** Proto消息完整名称 */
|
|
27
|
-
message_ref: string;
|
|
28
|
-
/** 字段路径 */
|
|
29
|
-
field_path: string;
|
|
30
|
-
/** 场景编码 */
|
|
31
|
-
scene_code: string;
|
|
32
|
-
/** 接口操作 */
|
|
33
|
-
operation: string;
|
|
34
|
-
/** 脱敏方向 */
|
|
35
|
-
direction?:
|
|
36
|
-
| BaseRedactDirection
|
|
37
|
-
| undefined;
|
|
38
|
-
/** 策略模式 */
|
|
39
|
-
mode?:
|
|
40
|
-
| BaseRedactPolicyMode
|
|
41
|
-
| undefined;
|
|
42
|
-
/** 状态 */
|
|
43
|
-
status?:
|
|
44
|
-
| Status
|
|
45
|
-
| undefined;
|
|
46
|
-
/** 当前页码 */
|
|
47
|
-
page_num: number;
|
|
48
|
-
/** 每页数量 */
|
|
49
|
-
page_size: number;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** 脱敏策略分页响应。 */
|
|
53
|
-
export interface PageBaseRedactPolicyResponse {
|
|
54
|
-
/** 脱敏策略列表 */
|
|
55
|
-
base_redact_policies: BaseRedactPolicy[];
|
|
56
|
-
/** 总数 */
|
|
57
|
-
total: number;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** 脱敏策略详情查询条件。 */
|
|
61
|
-
export interface GetBaseRedactPolicyRequest {
|
|
62
|
-
id: number;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** 脱敏策略表单。 */
|
|
66
|
-
export interface BaseRedactPolicyForm {
|
|
67
|
-
/** 策略绑定ID */
|
|
68
|
-
id: number;
|
|
69
|
-
/** 字段目录ID */
|
|
70
|
-
field_id: number;
|
|
71
|
-
/** 规则模板ID */
|
|
72
|
-
rule_id: number;
|
|
73
|
-
/** 场景编码 */
|
|
74
|
-
scene_code: string;
|
|
75
|
-
/** 接口操作 */
|
|
76
|
-
operation: string;
|
|
77
|
-
/** 脱敏方向 */
|
|
78
|
-
direction: BaseRedactDirection;
|
|
79
|
-
/** 策略模式 */
|
|
80
|
-
mode: BaseRedactPolicyMode;
|
|
81
|
-
/** 优先级 */
|
|
82
|
-
priority: number;
|
|
83
|
-
/** 状态 */
|
|
84
|
-
status: Status;
|
|
85
|
-
/** 策略版本 */
|
|
86
|
-
version: number;
|
|
87
|
-
/** 备注 */
|
|
88
|
-
remark: string;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/** 创建脱敏策略请求参数。 */
|
|
92
|
-
export interface CreateBaseRedactPolicyRequest {
|
|
93
|
-
base_redact_policy: BaseRedactPolicyForm | undefined;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/** 更新脱敏策略请求参数。 */
|
|
97
|
-
export interface UpdateBaseRedactPolicyRequest {
|
|
98
|
-
base_redact_policy: BaseRedactPolicyForm | undefined;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/** 删除脱敏策略请求参数。 */
|
|
102
|
-
export interface DeleteBaseRedactPolicyRequest {
|
|
103
|
-
id: string;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/** 设置脱敏策略状态请求参数。 */
|
|
107
|
-
export interface SetBaseRedactPolicyStatusRequest {
|
|
108
|
-
/** 策略绑定ID */
|
|
109
|
-
id: number;
|
|
110
|
-
/** 状态 */
|
|
111
|
-
status: Status;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/** 脱敏策略。 */
|
|
115
|
-
export interface BaseRedactPolicy {
|
|
116
|
-
/** 策略绑定ID */
|
|
117
|
-
id: number;
|
|
118
|
-
/** 字段目录ID */
|
|
119
|
-
field_id: number;
|
|
120
|
-
/** Proto消息完整名称 */
|
|
121
|
-
message_ref: string;
|
|
122
|
-
/** 字段路径 */
|
|
123
|
-
field_path: string;
|
|
124
|
-
/** Proto字段类型 */
|
|
125
|
-
field_kind: string;
|
|
126
|
-
/** 敏感字段类型 */
|
|
127
|
-
sensitivity_type: string;
|
|
128
|
-
/** 规则模板ID */
|
|
129
|
-
rule_id: number;
|
|
130
|
-
/** 规则编码 */
|
|
131
|
-
rule_code: string;
|
|
132
|
-
/** 规则名称 */
|
|
133
|
-
rule_name: string;
|
|
134
|
-
/** 规则类型 */
|
|
135
|
-
rule_type: string;
|
|
136
|
-
/** 规则参数 */
|
|
137
|
-
rule: string;
|
|
138
|
-
/** 场景编码 */
|
|
139
|
-
scene_code: string;
|
|
140
|
-
/** 接口操作 */
|
|
141
|
-
operation: string;
|
|
142
|
-
/** 脱敏方向 */
|
|
143
|
-
direction: BaseRedactDirection;
|
|
144
|
-
/** 策略模式 */
|
|
145
|
-
mode: BaseRedactPolicyMode;
|
|
146
|
-
/** 优先级 */
|
|
147
|
-
priority: number;
|
|
148
|
-
/** 状态 */
|
|
149
|
-
status: Status;
|
|
150
|
-
/** 策略版本 */
|
|
151
|
-
version: number;
|
|
152
|
-
/** 备注 */
|
|
153
|
-
remark: string;
|
|
154
|
-
/** 创建时间 */
|
|
155
|
-
created_at: string;
|
|
156
|
-
/** 更新时间 */
|
|
157
|
-
updated_at: string;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/** Admin脱敏策略绑定服务。 */
|
|
161
|
-
export interface BaseRedactPolicyService {
|
|
162
|
-
/** 查询脱敏策略分页列表。 */
|
|
163
|
-
PageBaseRedactPolicy(request: PageBaseRedactPolicyRequest): Promise<PageBaseRedactPolicyResponse>;
|
|
164
|
-
/** 查询脱敏策略详情。 */
|
|
165
|
-
GetBaseRedactPolicy(request: GetBaseRedactPolicyRequest): Promise<BaseRedactPolicyForm>;
|
|
166
|
-
/** 创建脱敏策略。 */
|
|
167
|
-
CreateBaseRedactPolicy(request: CreateBaseRedactPolicyRequest): Promise<Empty>;
|
|
168
|
-
/** 更新脱敏策略。 */
|
|
169
|
-
UpdateBaseRedactPolicy(request: UpdateBaseRedactPolicyRequest): Promise<Empty>;
|
|
170
|
-
/** 删除脱敏策略。 */
|
|
171
|
-
DeleteBaseRedactPolicy(request: DeleteBaseRedactPolicyRequest): Promise<Empty>;
|
|
172
|
-
/** 设置脱敏策略状态。 */
|
|
173
|
-
SetBaseRedactPolicyStatus(request: SetBaseRedactPolicyStatusRequest): Promise<Empty>;
|
|
174
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="table-box page-box">
|
|
3
|
-
<ProTable ref="table" row-key="id" :columns="columns" :header-actions="headerActions" :request-api="requestTable" />
|
|
4
|
-
<FormDialog v-model="dialog.visible" ref="dialogRef" :title="t(dialog.titleKey)" width="620px" :model="form" :fields="fields" :rules="rules" @confirm="submit" @close="resetForm" />
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script setup lang="ts">
|
|
9
|
-
import { computed, reactive, ref } from "vue";
|
|
10
|
-
import { ElMessage, ElMessageBox } from "element-plus";
|
|
11
|
-
import { Delete, EditPen } from "@element-plus/icons-vue";
|
|
12
|
-
import type { ColumnProps, HeaderActionProps, ProTableInstance } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
|
|
13
|
-
import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
|
|
14
|
-
import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
|
|
15
|
-
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
16
|
-
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
17
|
-
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
18
|
-
import { t } from "@liujitcn/kratos-admin-core";
|
|
19
|
-
import { defBaseRedactFieldService } from "@liujitcn/kratos-admin-system/api/system/base_redact_field";
|
|
20
|
-
import { defBaseRedactRuleService } from "@liujitcn/kratos-admin-system/api/system/base_redact_rule";
|
|
21
|
-
import type { BaseRedactField, BaseRedactFieldForm, PageBaseRedactFieldRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_redact_field";
|
|
22
|
-
import { BaseRedactSearchMode, BaseRedactStorageMode } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_redact_field";
|
|
23
|
-
import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
24
|
-
|
|
25
|
-
defineOptions({ name: "BaseRedactField", inheritAttrs: false });
|
|
26
|
-
const { BUTTONS } = useAuthButtons();
|
|
27
|
-
const table = ref<ProTableInstance>();
|
|
28
|
-
const dialogRef = ref<InstanceType<typeof FormDialog>>();
|
|
29
|
-
const ruleOptions = ref<ProFormOption[]>([]);
|
|
30
|
-
const dialog = reactive({ visible: false, titleKey: "common.action.edit_resource" });
|
|
31
|
-
const form = reactive<BaseRedactFieldForm>({ id: 0, message_ref: "", field_path: "", field_kind: "string", sensitivity_type: "", source: "PROTO", entity_ref: "", table_name: "", column_name: "", record_key_field: "", storage_mode: BaseRedactStorageMode.BASE_REDACT_STORAGE_MODE_UNSPECIFIED, storage_rule_id: 0, search_mode: BaseRedactSearchMode.BASE_REDACT_SEARCH_MODE_UNSPECIFIED, status: Status.STATUS_ENABLE, remark: "" });
|
|
32
|
-
const statusOptions = computed<ProFormOption[]>(() => [{ label: t("common.status.enabled"), value: Status.STATUS_ENABLE }, { label: t("common.status.disabled"), value: Status.STATUS_DISABLE }]);
|
|
33
|
-
const storageSupported = computed(() => form.message_ref === "system.admin.v1.BaseUser" && form.field_path === "phone");
|
|
34
|
-
const storageModeOptions = computed<ProFormOption[]>(() => { const options: ProFormOption[] = [{ label: t("system.base.redact_policy.storage_mode.unspecified"), value: BaseRedactStorageMode.BASE_REDACT_STORAGE_MODE_UNSPECIFIED }]; if (storageSupported.value) options.push({ label: t("system.base.redact_policy.storage_mode.plain"), value: BaseRedactStorageMode.BASE_REDACT_STORAGE_MODE_PLAIN }, { label: t("system.base.redact_policy.storage_mode.mask"), value: BaseRedactStorageMode.BASE_REDACT_STORAGE_MODE_MASK }); return options; });
|
|
35
|
-
const searchModeOptions = computed<ProFormOption[]>(() => { const options: ProFormOption[] = [{ label: t("system.base.redact_policy.search_mode.unspecified"), value: BaseRedactSearchMode.BASE_REDACT_SEARCH_MODE_UNSPECIFIED }]; if (storageSupported.value) options.push({ label: t("system.base.redact_policy.search_mode.none"), value: BaseRedactSearchMode.BASE_REDACT_SEARCH_MODE_NONE }, { label: t("system.base.redact_policy.search_mode.digest"), value: BaseRedactSearchMode.BASE_REDACT_SEARCH_MODE_DIGEST }); return options; });
|
|
36
|
-
const fields = computed<ProFormField[]>(() => [{ prop: "message_ref", label: t("system.base.redact_policy.field.message_ref"), component: "input", props: { disabled: true } }, { prop: "field_path", label: t("system.base.redact_policy.field.field_path"), component: "input", props: { disabled: true } }, { prop: "field_kind", label: t("system.base.redact_policy.field.field_kind"), component: "input", props: { disabled: true } }, { prop: "sensitivity_type", label: t("system.base.redact_policy.field.sensitivity_type"), component: "input" }, { prop: "entity_ref", label: t("system.base.redact_policy.field.entity_ref"), component: "input" }, { prop: "table_name", label: t("system.base.redact_policy.field.table_name"), component: "input" }, { prop: "column_name", label: t("system.base.redact_policy.field.column_name"), component: "input" }, { prop: "record_key_field", label: t("system.base.redact_policy.field.record_key_field"), component: "input" }, { prop: "storage_mode", label: t("system.base.redact_policy.field.storage_mode"), component: "select", options: storageModeOptions.value }, { prop: "storage_rule_id", label: t("system.base.redact_policy.field.storage_rule"), component: "select", props: { filterable: true, clearable: true }, options: ruleOptions.value, visible: () => form.storage_mode === BaseRedactStorageMode.BASE_REDACT_STORAGE_MODE_MASK }, { prop: "search_mode", label: t("system.base.redact_policy.field.search_mode"), component: "select", options: searchModeOptions.value }, { prop: "status", label: t("common.field.status"), component: "radio-group", options: statusOptions.value }, { prop: "remark", label: t("common.field.remark"), component: "textarea" }]);
|
|
37
|
-
const rules = computed(() => ({ message_ref: [{ required: true, message: t("system.base.redact_policy.validation.message_ref"), trigger: "blur" }], field_path: [{ required: true, message: t("system.base.redact_policy.validation.field_path"), trigger: "blur" }] }));
|
|
38
|
-
const columns = computed<ColumnProps[]>(() => [{ type: "selection", width: 55 }, { prop: "message_ref", label: t("system.base.redact_policy.field.message_ref"), minWidth: 220, search: { el: "input" } }, { prop: "field_path", label: t("system.base.redact_policy.field.field_path"), minWidth: 140, search: { el: "input" } }, { prop: "field_kind", label: t("system.base.redact_policy.field.field_kind"), width: 110 }, { prop: "sensitivity_type", label: t("system.base.redact_policy.field.sensitivity_type"), width: 140 }, { prop: "source", label: t("system.base.redact_policy.field.source"), width: 110, search: { el: "select", enum: [{ label: "PROTO", value: "PROTO" }, { label: "DATABASE", value: "DATABASE" }] } }, { prop: "storage_mode", label: t("system.base.redact_policy.field.storage_mode"), width: 120, enum: storageModeOptions.value, isFilterEnum: true }, { prop: "search_mode", label: t("system.base.redact_policy.field.search_mode"), width: 120, enum: searchModeOptions.value, isFilterEnum: true }, { prop: "status", label: t("common.field.status"), width: 100, cellType: "status", statusProps: { activeValue: Status.STATUS_ENABLE, inactiveValue: Status.STATUS_DISABLE, activeText: t("common.status.enabled"), inactiveText: t("common.status.disabled"), disabled: () => !BUTTONS.value["base:redact-field:status"], beforeChange: scope => changeStatus(scope.row as BaseRedactField) } }, { prop: "operation", label: t("common.field.operation"), width: 140, fixed: "right", cellType: "actions", actions: [{ label: t("common.action.edit"), type: "primary", link: true, icon: EditPen, hidden: () => !BUTTONS.value["base:redact-field:update"], onClick: scope => openDialog((scope.row as BaseRedactField).id) }, { label: t("common.action.delete"), type: "danger", link: true, icon: Delete, hidden: () => !BUTTONS.value["base:redact-field:delete"], onClick: scope => deleteItems(scope.row as BaseRedactField) }] }]);
|
|
39
|
-
const headerActions = computed<HeaderActionProps[]>(() => [{ label: t("common.action.delete"), type: "danger", icon: Delete, hidden: () => !BUTTONS.value["base:redact-field:delete"], disabled: scope => !scope.selectedList.length, onClick: scope => deleteItems(scope.selectedList as BaseRedactField[]) }]);
|
|
40
|
-
|
|
41
|
-
/** 请求字段分页列表。 */
|
|
42
|
-
async function requestTable(params: PageBaseRedactFieldRequest) { const data = await defBaseRedactFieldService.PageBaseRedactField(buildPageRequest(params)); return { data: { list: data.base_redact_fields ?? [], total: data.total } }; }
|
|
43
|
-
/** 加载存储脱敏规则选项。 */
|
|
44
|
-
async function loadRuleOptions() { const result = await defBaseRedactRuleService.OptionBaseRedactRule({ keyword: "" }); ruleOptions.value = result.list ?? []; }
|
|
45
|
-
/** 打开字段编辑弹窗。 */
|
|
46
|
-
async function openDialog(id: number) { resetForm(); await loadRuleOptions(); dialog.titleKey = "common.action.edit_resource"; dialog.visible = true; Object.assign(form, await defBaseRedactFieldService.GetBaseRedactField({ id })); }
|
|
47
|
-
/** 重置字段表单。 */
|
|
48
|
-
function resetForm() { dialog.visible = false; dialogRef.value?.resetFields(); Object.assign(form, { id: 0, message_ref: "", field_path: "", field_kind: "string", sensitivity_type: "", source: "PROTO", entity_ref: "", table_name: "", column_name: "", record_key_field: "", storage_mode: BaseRedactStorageMode.BASE_REDACT_STORAGE_MODE_UNSPECIFIED, storage_rule_id: 0, search_mode: BaseRedactSearchMode.BASE_REDACT_SEARCH_MODE_UNSPECIFIED, status: Status.STATUS_ENABLE, remark: "" }); }
|
|
49
|
-
/** 提交字段表单。 */
|
|
50
|
-
function submit() { dialogRef.value?.validate()?.then(async valid => { if (!valid) return; const payload = JSON.parse(JSON.stringify(form)) as BaseRedactFieldForm; if (payload.storage_mode !== BaseRedactStorageMode.BASE_REDACT_STORAGE_MODE_MASK) payload.storage_rule_id = 0; await defBaseRedactFieldService.UpdateBaseRedactField({ base_redact_field: payload }); ElMessage.success(t("common.message.update_success", { resource: t("system.base.redact_policy.tabs.field") })); resetForm(); table.value?.getTableList(); }); }
|
|
51
|
-
/** 切换字段状态。 */
|
|
52
|
-
async function changeStatus(row: BaseRedactField) { const next = row.status === Status.STATUS_ENABLE ? Status.STATUS_DISABLE : Status.STATUS_ENABLE; try { await ElMessageBox.confirm(t("common.dialog.status_change", { action: t(next === Status.STATUS_ENABLE ? "common.status.enabled" : "common.status.disabled"), resource: t("system.base.redact_policy.tabs.field"), field: t("system.base.redact_policy.field.message_ref"), value: row.message_ref })); await defBaseRedactFieldService.SetBaseRedactFieldStatus({ id: row.id, status: next }); table.value?.getTableList(); return true; } catch { return false; } }
|
|
53
|
-
/** 删除字段目录。 */
|
|
54
|
-
function deleteItems(selected?: BaseRedactField | BaseRedactField[] | number | string | Array<number | string>) { const items = Array.isArray(selected) ? selected.filter((item): item is BaseRedactField => typeof item === "object") : selected && typeof selected === "object" ? [selected] : []; const ids = items.length ? items.map(item => item.id) : normalizeSelectedIds(selected as number | string | Array<number | string>); if (!ids.length) { ElMessage.warning(t("common.message.select_delete_item")); return; } ElMessageBox.confirm(t("common.dialog.delete_selected", { resource: t("system.base.redact_policy.tabs.field") }), t("common.title.warning"), { type: "warning" }).then(async () => { await defBaseRedactFieldService.DeleteBaseRedactField({ id: ids.join(",") }); ElMessage.success(t("common.message.delete_success", { resource: t("system.base.redact_policy.tabs.field") })); table.value?.getTableList(); }); }
|
|
55
|
-
</script>
|
|
56
|
-
|
|
57
|
-
<style scoped lang="scss">
|
|
58
|
-
.page-box { padding: 20px; }
|
|
59
|
-
</style>
|