@liujitcn/kratos-admin-system 0.0.50 → 0.0.52

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.
Files changed (36) hide show
  1. package/README.md +3 -3
  2. package/dist/package/declarations/src/api/system/admin/v1/base_redact_output_policy.d.ts +4 -1
  3. package/dist/package/declarations/src/api/system/admin/v1/base_redact_storage_policy.d.ts +3 -1
  4. package/dist/package/declarations/src/components/tenant-project/TenantProjectManager.vue.d.ts +1 -2
  5. package/dist/package/declarations/src/components/tenant-project/tenant-project-manager-data.d.ts +10 -0
  6. package/dist/package/declarations/src/components/tenant-project/tenant-project-manager.d.ts +8 -3
  7. package/dist/package/declarations/src/index.d.ts +1 -1
  8. package/dist/package/declarations/src/locales/generated.d.ts +24 -0
  9. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_output_policy.d.ts +8 -0
  10. package/dist/package/declarations/src/rpc/system/admin/v1/base_redact_storage_policy.d.ts +25 -0
  11. package/dist/package/declarations/src/views/ai/chat/components/speech-recognition.d.ts +37 -0
  12. package/dist/package/src/api/system/admin/v1/base_redact_output_policy.ts +7 -0
  13. package/dist/package/src/api/system/admin/v1/base_redact_storage_policy.ts +7 -0
  14. package/dist/package/src/components/tenant-project/TenantProjectManager.vue +77 -60
  15. package/dist/package/src/components/tenant-project/tenant-project-manager-data.ts +39 -1
  16. package/dist/package/src/components/tenant-project/tenant-project-manager.ts +19 -4
  17. package/dist/package/src/index.ts +2 -0
  18. package/dist/package/src/locales/en-US.json +6 -0
  19. package/dist/package/src/locales/ja-JP.json +6 -0
  20. package/dist/package/src/locales/zh-CN.json +6 -0
  21. package/dist/package/src/locales/zh-TW.json +6 -0
  22. package/dist/package/src/rpc/system/admin/v1/base_redact_output_policy.ts +9 -0
  23. package/dist/package/src/rpc/system/admin/v1/base_redact_storage_policy.ts +30 -0
  24. package/dist/package/src/views/ai/chat/components/XSender.vue +18 -61
  25. package/dist/package/src/views/ai/chat/components/speech-recognition.ts +177 -0
  26. package/dist/package/src/views/base/job/index.vue +82 -158
  27. package/dist/package/src/views/base/login-policy/index.vue +12 -6
  28. package/dist/package/src/views/base/redact-output-policy/index.vue +19 -7
  29. package/dist/package/src/views/base/redact-rule/index.vue +70 -53
  30. package/dist/package/src/views/base/redact-storage-policy/index.vue +18 -7
  31. package/dist/package/src/views/base/role/index.vue +1 -1
  32. package/dist/package/src/views/base/{project-grant → tenant-project-grant}/index.vue +3 -1
  33. package/package.json +2 -2
  34. /package/dist/package/declarations/src/components/{tenant-project → tenant-project-grant}/ProjectGrantDialog.vue.d.ts +0 -0
  35. /package/dist/package/declarations/src/views/base/{project-grant → tenant-project-grant}/index.vue.d.ts +0 -0
  36. /package/dist/package/src/components/{tenant-project → tenant-project-grant}/ProjectGrantDialog.vue +0 -0
package/README.md CHANGED
@@ -49,7 +49,7 @@ packages/modules/system
49
49
  | `src/components/tenant-project/TenantProjectText.vue` | 租户项目列表展示组件,按当前租户身份自动组合名称。 |
50
50
  | `src/components/tenant-project/TenantProjectManager.vue` | 可复用的租户项目管理组件,支持追加列、业务数据加载、操作和作用域插槽。 |
51
51
  | `src/components/tenant-project/tenant-project-manager.ts` | 租户项目管理组件的扩展类型、双键上下文和数据合并辅助函数。 |
52
- | `src/components/tenant-project/ProjectGrantDialog.vue` | 岗位、角色、部门和用户的项目授权弹窗。 |
52
+ | `src/components/tenant-project-grant/ProjectGrantDialog.vue` | 岗位、角色、部门和用户的项目授权弹窗。 |
53
53
  | `src/rpc/**/*.ts` | System 页面与 API 自包含的 RPC 类型。 |
54
54
  | `src/typings/*.d.ts` | 声明 System 页面使用的 Markdown 和 Swagger 模块。 |
55
55
  | `package.json` | 声明依赖以及公开的模块入口、API 和 RPC 子路径。 |
@@ -106,7 +106,7 @@ packages/modules/system
106
106
  | `src/views/base/post/index.vue` | 岗位管理页。 |
107
107
  | `src/views/base/role/index.vue` | 角色管理页。 |
108
108
  | `src/views/base/tenant/index.vue` | 租户管理页。 |
109
- | `src/views/base/project-grant/index.vue` | 项目授权管理页。 |
109
+ | `src/views/base/tenant-project-grant/index.vue` | 项目授权管理页。 |
110
110
  | `src/views/base/user/index.vue` | 用户管理页。 |
111
111
  | `src/views/base/user/components/dept-tree.vue` | 用户页的部门树筛选组件。 |
112
112
  | `src/views/profile/` | 个人中心与安全设置页面。 |
@@ -153,7 +153,7 @@ export const adminModules = [systemAdminModule];
153
153
 
154
154
  跨模块跳转使用 Vue Router;复用 System 代码时只引用 `package.json#exports` 公开的 npm 子路径。
155
155
 
156
- 租户项目管理组件通过 `TenantProjectManager` 公开。外部业务模块可以传入 `extraColumns`、`extraActions` 和 `loadExtraData`:追加列继续使用 `ColumnProps`,数据加载器接收当前页的 `tenant_id + project_id` 集合,单条操作回调接收同一组双键以及项目基础数据。组件也会透传表格具名插槽,并向行插槽增加 `tenantProject` 上下文;保存业务配置后可通过组件实例的 `refresh()` 刷新列表。按外部业务字段搜索或排序时,应由外部接口参与分页查询,不能只在当前页加载后过滤。
156
+ 租户项目管理组件通过 `TenantProjectManager` 公开。默认租户创建项目时在表单中选择目标租户,普通租户由服务端自动使用当前租户;默认租户查询全部项目,普通租户按项目授权范围查询。外部业务模块可以传入 `extraColumns`、`extraActions` 和 `loadExtraData`:扩展列可通过 `after` 指定插入到哪个基础字段后面,列的同名表格插槽会沿用该位置,未配置时默认插入备注后面,例如 `{ prop: "address", after: "name" }` 配合 `#address` 插槽即可把内容放到项目名称后面;数据加载器接收当前页的 `tenant_id + project_id` 集合,单条操作回调接收同一组双键以及项目基础数据。组件也会透传表格具名插槽,并向行插槽增加 `tenantProject` 上下文;保存业务配置后可通过组件实例的 `refresh()` 刷新列表。按外部业务字段搜索或排序时,应由外部接口参与分页查询,不能只在当前页加载后过滤。
157
157
 
158
158
  外部项目可以在自己的页面中包装该组件,并通过菜单将项目管理页面的 `component` 指向包装页面:
159
159
 
@@ -1,4 +1,5 @@
1
- import type { BaseRedactOutputPolicyForm, BaseRedactOutputPolicyService, CreateBaseRedactOutputPolicyRequest, DeleteBaseRedactOutputPolicyRequest, GetBaseRedactOutputPolicyRequest, PageBaseRedactOutputPolicyRequest, PageBaseRedactOutputPolicyResponse, SetBaseRedactOutputPolicyStatusRequest, UpdateBaseRedactOutputPolicyRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_redact_output_policy";
1
+ import type { BaseRedactOutputPolicyForm, BaseRedactOutputPolicyService, CreateBaseRedactOutputPolicyRequest, DeleteBaseRedactOutputPolicyRequest, GetBaseRedactOutputFieldDocRequest, GetBaseRedactOutputPolicyRequest, PageBaseRedactOutputPolicyRequest, PageBaseRedactOutputPolicyResponse, SetBaseRedactOutputPolicyStatusRequest, UpdateBaseRedactOutputPolicyRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_redact_output_policy";
2
+ import type { BaseApiDoc } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_api";
2
3
  import type { Empty } from "@liujitcn/kratos-admin-system/rpc/google/protobuf/empty";
3
4
  /** 管理端出库脱敏策略服务。 */
4
5
  export declare class BaseRedactOutputPolicyServiceImpl implements BaseRedactOutputPolicyService {
@@ -14,6 +15,8 @@ export declare class BaseRedactOutputPolicyServiceImpl implements BaseRedactOutp
14
15
  DeleteBaseRedactOutputPolicy(request: DeleteBaseRedactOutputPolicyRequest): Promise<Empty>;
15
16
  /** 设置出库脱敏策略状态。 */
16
17
  SetBaseRedactOutputPolicyStatus(request: SetBaseRedactOutputPolicyStatusRequest): Promise<Empty>;
18
+ /** 查询可出库脱敏的响应字段文档。 */
19
+ GetBaseRedactOutputFieldDoc(request: GetBaseRedactOutputFieldDocRequest): Promise<BaseApiDoc>;
17
20
  }
18
21
  /** defBaseRedactOutputPolicyService 出库脱敏策略服务实例。 */
19
22
  export declare const defBaseRedactOutputPolicyService: BaseRedactOutputPolicyServiceImpl;
@@ -1,4 +1,4 @@
1
- import type { BaseRedactStoragePolicyForm, BaseRedactStoragePolicyService, CreateBaseRedactStoragePolicyRequest, DeleteBaseRedactStoragePolicyRequest, GetBaseRedactStoragePolicyRequest, PageBaseRedactStoragePolicyRequest, PageBaseRedactStoragePolicyResponse, SetBaseRedactStoragePolicyStatusRequest, UpdateBaseRedactStoragePolicyRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_redact_storage_policy";
1
+ import type { BaseRedactStoragePolicyForm, BaseRedactStoragePolicyService, CreateBaseRedactStoragePolicyRequest, DeleteBaseRedactStoragePolicyRequest, GetBaseRedactStoragePolicyRequest, ListBaseRedactStorageColumnRequest, ListBaseRedactStorageColumnResponse, PageBaseRedactStoragePolicyRequest, PageBaseRedactStoragePolicyResponse, SetBaseRedactStoragePolicyStatusRequest, UpdateBaseRedactStoragePolicyRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_redact_storage_policy";
2
2
  import type { Empty } from "@liujitcn/kratos-admin-system/rpc/google/protobuf/empty";
3
3
  /** 管理端入库脱敏策略服务。 */
4
4
  export declare class BaseRedactStoragePolicyServiceImpl implements BaseRedactStoragePolicyService {
@@ -14,6 +14,8 @@ export declare class BaseRedactStoragePolicyServiceImpl implements BaseRedactSto
14
14
  DeleteBaseRedactStoragePolicy(request: DeleteBaseRedactStoragePolicyRequest): Promise<Empty>;
15
15
  /** 设置入库脱敏策略状态。 */
16
16
  SetBaseRedactStoragePolicyStatus(request: SetBaseRedactStoragePolicyStatusRequest): Promise<Empty>;
17
+ /** 查询可入库脱敏的字符串字段列表。 */
18
+ ListBaseRedactStorageColumn(request: ListBaseRedactStorageColumnRequest): Promise<ListBaseRedactStorageColumnResponse>;
17
19
  }
18
20
  /** defBaseRedactStoragePolicyService 入库脱敏策略服务实例。 */
19
21
  export declare const defBaseRedactStoragePolicyService: BaseRedactStoragePolicyServiceImpl;
@@ -1,4 +1,3 @@
1
- import type { ColumnProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
2
1
  import { type TenantProjectAction, type TenantProjectManagerProps } from "./tenant-project-manager";
3
2
  /** 刷新项目表格。 */
4
3
  declare function refreshTable(): Promise<void>;
@@ -16,7 +15,7 @@ declare const __VLS_base: import("vue").DefineComponent<TenantProjectManagerProp
16
15
  }, string, import("vue").PublicProps, Readonly<TenantProjectManagerProps> & Readonly<{
17
16
  "onExtra-data-error"?: ((error: unknown) => any) | undefined;
18
17
  }>, {
19
- extraColumns: ColumnProps[];
18
+ extraColumns: import("./tenant-project-manager").TenantProjectExtraColumn[];
20
19
  extraActions: TenantProjectAction[];
21
20
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
21
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,4 +1,9 @@
1
1
  import type { BaseTenantProject } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_tenant_project";
2
+ /** 租户项目表格列的最小结构,用于在不依赖表格组件的情况下排列扩展列。 */
3
+ type TenantProjectColumnLike = {
4
+ prop?: string;
5
+ type?: string;
6
+ };
2
7
  /** 租户项目业务数据查询键。 */
3
8
  export interface TenantProjectKey {
4
9
  /** 租户 ID。 */
@@ -8,7 +13,12 @@ export interface TenantProjectKey {
8
13
  }
9
14
  /** 租户项目扩展数据,外层键由租户 ID 和项目 ID 组成。 */
10
15
  export type TenantProjectExtraData = Record<string, Record<string, unknown>>;
16
+ /** 按基础字段位置排列租户项目管理的扩展列。 */
17
+ export declare function arrangeTenantProjectColumns<T extends TenantProjectColumnLike>(baseColumns: T[], extraColumns: Array<T & {
18
+ after?: string;
19
+ }>): T[];
11
20
  /** 创建租户项目扩展数据的稳定键。 */
12
21
  export declare function tenantProjectKey(tenantId: number, projectId: number): string;
13
22
  /** 将外部业务字段合并到项目行,同时保护公共项目字段。 */
14
23
  export declare function mergeTenantProjectExtraData(project: BaseTenantProject, extra?: Record<string, unknown>): BaseTenantProject & Record<string, unknown>;
24
+ export {};
@@ -1,7 +1,7 @@
1
1
  import type { BaseTenantProject, PageBaseTenantProjectRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_tenant_project";
2
2
  import type { ColumnProps, TableActionProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
3
3
  import type { TenantProjectExtraData, TenantProjectKey } from "./tenant-project-manager-data";
4
- export { mergeTenantProjectExtraData, tenantProjectKey, type TenantProjectExtraData, type TenantProjectKey } from "./tenant-project-manager-data";
4
+ export { arrangeTenantProjectColumns, mergeTenantProjectExtraData, tenantProjectKey, type TenantProjectExtraData, type TenantProjectKey } from "./tenant-project-manager-data";
5
5
  /** 租户项目单条业务上下文。 */
6
6
  export interface TenantProjectContext<TData extends Record<string, unknown> = Record<string, unknown>> extends TenantProjectKey {
7
7
  /** 公共项目基础数据。 */
@@ -29,10 +29,15 @@ export type TenantProjectAction = Omit<TableActionProps, "disabled" | "hidden" |
29
29
  /** 执行项目扩展操作。 */
30
30
  onClick: (context: TenantProjectContext, params?: Record<string, any>) => void | Promise<void>;
31
31
  };
32
+ /** 租户项目管理的扩展列配置。 */
33
+ export type TenantProjectExtraColumn = ColumnProps & {
34
+ /** 插入到指定基础字段后面,未配置时默认插入备注字段后面。 */
35
+ after?: string;
36
+ };
32
37
  /** 租户项目管理组件属性。 */
33
38
  export interface TenantProjectManagerProps {
34
- /** 追加到基础列表的表格列。 */
35
- extraColumns?: ColumnProps[];
39
+ /** 追加到基础列表的表格列,可通过 after 指定插入位置。 */
40
+ extraColumns?: TenantProjectExtraColumn[];
36
41
  /** 追加到基础操作列的业务操作。 */
37
42
  extraActions?: TenantProjectAction[];
38
43
  /** 加载当前页外部业务字段。 */
@@ -1,5 +1,5 @@
1
1
  export { ADMIN_AI_EXTENSION, getAdminAiExtension } from "./ai";
2
2
  export type { AdminAiExtension } from "./ai";
3
3
  export { default as TenantProjectManager } from "./components/tenant-project/TenantProjectManager.vue";
4
- export { mergeTenantProjectExtraData, tenantProjectKey, type TenantProjectAction, type TenantProjectContext, type TenantProjectExtraData, type TenantProjectExtraDataLoadContext, type TenantProjectExtraDataLoader, type TenantProjectKey, type TenantProjectManagerProps } from "./components/tenant-project/tenant-project-manager";
4
+ export { mergeTenantProjectExtraData, arrangeTenantProjectColumns, tenantProjectKey, type TenantProjectAction, type TenantProjectContext, type TenantProjectExtraColumn, type TenantProjectExtraData, type TenantProjectExtraDataLoadContext, type TenantProjectExtraDataLoader, type TenantProjectKey, type TenantProjectManagerProps } from "./components/tenant-project/tenant-project-manager";
5
5
  export { systemAdminModule } from "./module";
@@ -808,6 +808,7 @@ export declare const LOCALE_MESSAGES: {
808
808
  "system.base.redact_rule.description.fixed_length_mask": string;
809
809
  "system.base.redact_rule.description.hash_digest": string;
810
810
  "system.base.redact_rule.description.ip_mask": string;
811
+ "system.base.redact_rule.description.string_mask": string;
811
812
  "system.base.redact_rule.description.phone_mask": string;
812
813
  "system.base.redact_rule.description.regex_replace": string;
813
814
  "system.base.redact_rule.description.stable_uuid": string;
@@ -822,6 +823,7 @@ export declare const LOCALE_MESSAGES: {
822
823
  "system.base.redact_rule.parameter.char": string;
823
824
  "system.base.redact_rule.parameter.keep_first": string;
824
825
  "system.base.redact_rule.parameter.keep_last": string;
826
+ "system.base.redact_rule.parameter.min_mask": string;
825
827
  "system.base.redact_rule.parameter.keep_local_first": string;
826
828
  "system.base.redact_rule.parameter.keep_octets": string;
827
829
  "system.base.redact_rule.parameter.length": string;
@@ -835,6 +837,7 @@ export declare const LOCALE_MESSAGES: {
835
837
  "system.base.redact_rule.template.fixed_length_mask": string;
836
838
  "system.base.redact_rule.template.hash_digest": string;
837
839
  "system.base.redact_rule.template.ip_mask": string;
840
+ "system.base.redact_rule.template.string_mask": string;
838
841
  "system.base.redact_rule.template.phone_mask": string;
839
842
  "system.base.redact_rule.template.regex_replace": string;
840
843
  "system.base.redact_rule.template.stable_uuid": string;
@@ -842,6 +845,9 @@ export declare const LOCALE_MESSAGES: {
842
845
  "system.base.redact_rule.template.url_mask": string;
843
846
  "system.base.redact_rule.title": string;
844
847
  "system.base.redact_rule.validation.parameters": string;
848
+ "system.base.redact_rule.validation.code": string;
849
+ "system.base.redact_rule.validation.name": string;
850
+ "system.base.redact_rule.validation.rule_type": string;
845
851
  "system.base.redact_storage_policy.field.column_name": string;
846
852
  "system.base.redact_storage_policy.field.parameters": string;
847
853
  "system.base.redact_storage_policy.field.rule": string;
@@ -2374,6 +2380,7 @@ export declare const LOCALE_MESSAGES: {
2374
2380
  "system.base.redact_rule.description.fixed_length_mask": string;
2375
2381
  "system.base.redact_rule.description.hash_digest": string;
2376
2382
  "system.base.redact_rule.description.ip_mask": string;
2383
+ "system.base.redact_rule.description.string_mask": string;
2377
2384
  "system.base.redact_rule.description.phone_mask": string;
2378
2385
  "system.base.redact_rule.description.regex_replace": string;
2379
2386
  "system.base.redact_rule.description.stable_uuid": string;
@@ -2388,6 +2395,7 @@ export declare const LOCALE_MESSAGES: {
2388
2395
  "system.base.redact_rule.parameter.char": string;
2389
2396
  "system.base.redact_rule.parameter.keep_first": string;
2390
2397
  "system.base.redact_rule.parameter.keep_last": string;
2398
+ "system.base.redact_rule.parameter.min_mask": string;
2391
2399
  "system.base.redact_rule.parameter.keep_local_first": string;
2392
2400
  "system.base.redact_rule.parameter.keep_octets": string;
2393
2401
  "system.base.redact_rule.parameter.length": string;
@@ -2401,6 +2409,7 @@ export declare const LOCALE_MESSAGES: {
2401
2409
  "system.base.redact_rule.template.fixed_length_mask": string;
2402
2410
  "system.base.redact_rule.template.hash_digest": string;
2403
2411
  "system.base.redact_rule.template.ip_mask": string;
2412
+ "system.base.redact_rule.template.string_mask": string;
2404
2413
  "system.base.redact_rule.template.phone_mask": string;
2405
2414
  "system.base.redact_rule.template.regex_replace": string;
2406
2415
  "system.base.redact_rule.template.stable_uuid": string;
@@ -2408,6 +2417,9 @@ export declare const LOCALE_MESSAGES: {
2408
2417
  "system.base.redact_rule.template.url_mask": string;
2409
2418
  "system.base.redact_rule.title": string;
2410
2419
  "system.base.redact_rule.validation.parameters": string;
2420
+ "system.base.redact_rule.validation.code": string;
2421
+ "system.base.redact_rule.validation.name": string;
2422
+ "system.base.redact_rule.validation.rule_type": string;
2411
2423
  "system.base.redact_storage_policy.field.column_name": string;
2412
2424
  "system.base.redact_storage_policy.field.parameters": string;
2413
2425
  "system.base.redact_storage_policy.field.rule": string;
@@ -3940,6 +3952,7 @@ export declare const LOCALE_MESSAGES: {
3940
3952
  "system.base.redact_rule.description.fixed_length_mask": string;
3941
3953
  "system.base.redact_rule.description.hash_digest": string;
3942
3954
  "system.base.redact_rule.description.ip_mask": string;
3955
+ "system.base.redact_rule.description.string_mask": string;
3943
3956
  "system.base.redact_rule.description.phone_mask": string;
3944
3957
  "system.base.redact_rule.description.regex_replace": string;
3945
3958
  "system.base.redact_rule.description.stable_uuid": string;
@@ -3954,6 +3967,7 @@ export declare const LOCALE_MESSAGES: {
3954
3967
  "system.base.redact_rule.parameter.char": string;
3955
3968
  "system.base.redact_rule.parameter.keep_first": string;
3956
3969
  "system.base.redact_rule.parameter.keep_last": string;
3970
+ "system.base.redact_rule.parameter.min_mask": string;
3957
3971
  "system.base.redact_rule.parameter.keep_local_first": string;
3958
3972
  "system.base.redact_rule.parameter.keep_octets": string;
3959
3973
  "system.base.redact_rule.parameter.length": string;
@@ -3967,6 +3981,7 @@ export declare const LOCALE_MESSAGES: {
3967
3981
  "system.base.redact_rule.template.fixed_length_mask": string;
3968
3982
  "system.base.redact_rule.template.hash_digest": string;
3969
3983
  "system.base.redact_rule.template.ip_mask": string;
3984
+ "system.base.redact_rule.template.string_mask": string;
3970
3985
  "system.base.redact_rule.template.phone_mask": string;
3971
3986
  "system.base.redact_rule.template.regex_replace": string;
3972
3987
  "system.base.redact_rule.template.stable_uuid": string;
@@ -3974,6 +3989,9 @@ export declare const LOCALE_MESSAGES: {
3974
3989
  "system.base.redact_rule.template.url_mask": string;
3975
3990
  "system.base.redact_rule.title": string;
3976
3991
  "system.base.redact_rule.validation.parameters": string;
3992
+ "system.base.redact_rule.validation.code": string;
3993
+ "system.base.redact_rule.validation.name": string;
3994
+ "system.base.redact_rule.validation.rule_type": string;
3977
3995
  "system.base.redact_storage_policy.field.column_name": string;
3978
3996
  "system.base.redact_storage_policy.field.parameters": string;
3979
3997
  "system.base.redact_storage_policy.field.rule": string;
@@ -5506,6 +5524,7 @@ export declare const LOCALE_MESSAGES: {
5506
5524
  "system.base.redact_rule.description.fixed_length_mask": string;
5507
5525
  "system.base.redact_rule.description.hash_digest": string;
5508
5526
  "system.base.redact_rule.description.ip_mask": string;
5527
+ "system.base.redact_rule.description.string_mask": string;
5509
5528
  "system.base.redact_rule.description.phone_mask": string;
5510
5529
  "system.base.redact_rule.description.regex_replace": string;
5511
5530
  "system.base.redact_rule.description.stable_uuid": string;
@@ -5520,6 +5539,7 @@ export declare const LOCALE_MESSAGES: {
5520
5539
  "system.base.redact_rule.parameter.char": string;
5521
5540
  "system.base.redact_rule.parameter.keep_first": string;
5522
5541
  "system.base.redact_rule.parameter.keep_last": string;
5542
+ "system.base.redact_rule.parameter.min_mask": string;
5523
5543
  "system.base.redact_rule.parameter.keep_local_first": string;
5524
5544
  "system.base.redact_rule.parameter.keep_octets": string;
5525
5545
  "system.base.redact_rule.parameter.length": string;
@@ -5533,6 +5553,7 @@ export declare const LOCALE_MESSAGES: {
5533
5553
  "system.base.redact_rule.template.fixed_length_mask": string;
5534
5554
  "system.base.redact_rule.template.hash_digest": string;
5535
5555
  "system.base.redact_rule.template.ip_mask": string;
5556
+ "system.base.redact_rule.template.string_mask": string;
5536
5557
  "system.base.redact_rule.template.phone_mask": string;
5537
5558
  "system.base.redact_rule.template.regex_replace": string;
5538
5559
  "system.base.redact_rule.template.stable_uuid": string;
@@ -5540,6 +5561,9 @@ export declare const LOCALE_MESSAGES: {
5540
5561
  "system.base.redact_rule.template.url_mask": string;
5541
5562
  "system.base.redact_rule.title": string;
5542
5563
  "system.base.redact_rule.validation.parameters": string;
5564
+ "system.base.redact_rule.validation.code": string;
5565
+ "system.base.redact_rule.validation.name": string;
5566
+ "system.base.redact_rule.validation.rule_type": string;
5543
5567
  "system.base.redact_storage_policy.field.column_name": string;
5544
5568
  "system.base.redact_storage_policy.field.parameters": string;
5545
5569
  "system.base.redact_storage_policy.field.rule": string;
@@ -1,5 +1,6 @@
1
1
  import type { Status } from "../../../common/v1/enum";
2
2
  import type { Empty } from "../../../google/protobuf/empty";
3
+ import type { BaseApiDoc } from "./base_api";
3
4
  /** 出库脱敏策略处理模式。 */
4
5
  export declare enum BaseRedactOutputPolicyMode {
5
6
  /** BASE_REDACT_OUTPUT_POLICY_MODE_UNSPECIFIED - 未指定模式。 */
@@ -118,6 +119,11 @@ export interface BaseRedactOutputPolicy {
118
119
  /** 更新时间 */
119
120
  updated_at: string;
120
121
  }
122
+ /** 查询可出库脱敏字段请求。 */
123
+ export interface GetBaseRedactOutputFieldDocRequest {
124
+ /** 接口ID */
125
+ api_id: number;
126
+ }
121
127
  /** Admin出库脱敏策略服务。 */
122
128
  export interface BaseRedactOutputPolicyService {
123
129
  /** 查询出库脱敏策略分页列表。 */
@@ -132,4 +138,6 @@ export interface BaseRedactOutputPolicyService {
132
138
  DeleteBaseRedactOutputPolicy(request: DeleteBaseRedactOutputPolicyRequest): Promise<Empty>;
133
139
  /** 设置出库脱敏策略状态。 */
134
140
  SetBaseRedactOutputPolicyStatus(request: SetBaseRedactOutputPolicyStatusRequest): Promise<Empty>;
141
+ /** 查询可出库脱敏的响应字段文档。 */
142
+ GetBaseRedactOutputFieldDoc(request: GetBaseRedactOutputFieldDocRequest): Promise<BaseApiDoc>;
135
143
  }
@@ -97,6 +97,29 @@ export interface BaseRedactStoragePolicy {
97
97
  /** 更新时间 */
98
98
  updated_at: string;
99
99
  }
100
+ /** 查询可入库脱敏字段请求。 */
101
+ export interface ListBaseRedactStorageColumnRequest {
102
+ /** 数据源名称 */
103
+ source_name: string;
104
+ /** 数据库表名 */
105
+ table_name: string;
106
+ }
107
+ /** 可入库脱敏字段。 */
108
+ export interface BaseRedactStorageColumn {
109
+ /** 字段名 */
110
+ name: string;
111
+ /** 字段注释 */
112
+ comment: string;
113
+ /** 数据库类型 */
114
+ db_type: string;
115
+ /** 数据库完整类型 */
116
+ column_type: string;
117
+ }
118
+ /** 可入库脱敏字段列表响应。 */
119
+ export interface ListBaseRedactStorageColumnResponse {
120
+ /** 可脱敏字段列表 */
121
+ columns: BaseRedactStorageColumn[];
122
+ }
100
123
  /** Admin入库脱敏策略服务。 */
101
124
  export interface BaseRedactStoragePolicyService {
102
125
  /** 查询入库脱敏策略分页列表。 */
@@ -111,4 +134,6 @@ export interface BaseRedactStoragePolicyService {
111
134
  DeleteBaseRedactStoragePolicy(request: DeleteBaseRedactStoragePolicyRequest): Promise<Empty>;
112
135
  /** 设置入库脱敏策略状态。 */
113
136
  SetBaseRedactStoragePolicyStatus(request: SetBaseRedactStoragePolicyStatusRequest): Promise<Empty>;
137
+ /** 查询可入库脱敏的字符串字段列表。 */
138
+ ListBaseRedactStorageColumn(request: ListBaseRedactStorageColumnRequest): Promise<ListBaseRedactStorageColumnResponse>;
114
139
  }
@@ -0,0 +1,37 @@
1
+ /** 语音识别结果的最小结构,便于在不同浏览器实现间复用。 */
2
+ export type SpeechResultList = ArrayLike<{
3
+ 0?: {
4
+ transcript: string;
5
+ };
6
+ isFinal?: boolean;
7
+ length: number;
8
+ }>;
9
+ /** 语音识别错误的最小结构,兼容浏览器事件和不支持错误。 */
10
+ export type SpeechRecognitionError = {
11
+ code?: number;
12
+ error?: string;
13
+ message?: string;
14
+ };
15
+ type SpeechRecognitionOptions = {
16
+ /** 识别错误回调。 */
17
+ onError?: (error: SpeechRecognitionError) => void;
18
+ /** 识别开始回调。 */
19
+ onStart?: () => void;
20
+ /** 识别结束回调。 */
21
+ onEnd?: (text: string) => void;
22
+ /** 识别结果回调。 */
23
+ onResult?: (text: string) => void;
24
+ };
25
+ /** 增量累积语音识别结果,避免连续模式下 interim 结果重复计入已确认文本。 */
26
+ export declare function accumulateSpeechResultText(results: SpeechResultList, resultIndex: number, previousFinalText: string): {
27
+ finalText: string;
28
+ text: string;
29
+ };
30
+ /** 创建浏览器语音识别实例,并统一结果、状态和卸载处理。 */
31
+ export declare function useSpeechRecognition({ onError, onStart, onEnd, onResult }?: SpeechRecognitionOptions): {
32
+ loading: globalThis.Ref<boolean, boolean>;
33
+ start: () => void;
34
+ stop: () => void;
35
+ value: globalThis.Ref<string, string>;
36
+ };
37
+ export {};
@@ -4,12 +4,14 @@ import type {
4
4
  BaseRedactOutputPolicyService,
5
5
  CreateBaseRedactOutputPolicyRequest,
6
6
  DeleteBaseRedactOutputPolicyRequest,
7
+ GetBaseRedactOutputFieldDocRequest,
7
8
  GetBaseRedactOutputPolicyRequest,
8
9
  PageBaseRedactOutputPolicyRequest,
9
10
  PageBaseRedactOutputPolicyResponse,
10
11
  SetBaseRedactOutputPolicyStatusRequest,
11
12
  UpdateBaseRedactOutputPolicyRequest
12
13
  } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_redact_output_policy";
14
+ import type { BaseApiDoc } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_api";
13
15
  import type { Empty } from "@liujitcn/kratos-admin-system/rpc/google/protobuf/empty";
14
16
 
15
17
  const BASE_REDACT_OUTPUT_POLICY_URL = "/v1/admin/base/redact-output-policy";
@@ -45,6 +47,11 @@ export class BaseRedactOutputPolicyServiceImpl implements BaseRedactOutputPolicy
45
47
  SetBaseRedactOutputPolicyStatus(request: SetBaseRedactOutputPolicyStatusRequest): Promise<Empty> {
46
48
  return service<SetBaseRedactOutputPolicyStatusRequest, Empty>({ url: `${BASE_REDACT_OUTPUT_POLICY_URL}/${request.id}/status`, method: "put", data: request });
47
49
  }
50
+
51
+ /** 查询可出库脱敏的响应字段文档。 */
52
+ GetBaseRedactOutputFieldDoc(request: GetBaseRedactOutputFieldDocRequest): Promise<BaseApiDoc> {
53
+ return service<GetBaseRedactOutputFieldDocRequest, BaseApiDoc>({ url: `${BASE_REDACT_OUTPUT_POLICY_URL}/fields/${request.api_id}`, method: "get" });
54
+ }
48
55
  }
49
56
 
50
57
  /** defBaseRedactOutputPolicyService 出库脱敏策略服务实例。 */
@@ -5,6 +5,8 @@ import type {
5
5
  CreateBaseRedactStoragePolicyRequest,
6
6
  DeleteBaseRedactStoragePolicyRequest,
7
7
  GetBaseRedactStoragePolicyRequest,
8
+ ListBaseRedactStorageColumnRequest,
9
+ ListBaseRedactStorageColumnResponse,
8
10
  PageBaseRedactStoragePolicyRequest,
9
11
  PageBaseRedactStoragePolicyResponse,
10
12
  SetBaseRedactStoragePolicyStatusRequest,
@@ -45,6 +47,11 @@ export class BaseRedactStoragePolicyServiceImpl implements BaseRedactStoragePoli
45
47
  SetBaseRedactStoragePolicyStatus(request: SetBaseRedactStoragePolicyStatusRequest): Promise<Empty> {
46
48
  return service<SetBaseRedactStoragePolicyStatusRequest, Empty>({ url: `${BASE_REDACT_STORAGE_POLICY_URL}/${request.id}/status`, method: "put", data: request });
47
49
  }
50
+
51
+ /** 查询可入库脱敏的字符串字段列表。 */
52
+ ListBaseRedactStorageColumn(request: ListBaseRedactStorageColumnRequest): Promise<ListBaseRedactStorageColumnResponse> {
53
+ return service<ListBaseRedactStorageColumnRequest, ListBaseRedactStorageColumnResponse>({ url: `${BASE_REDACT_STORAGE_POLICY_URL}/columns`, method: "get", params: request });
54
+ }
48
55
  }
49
56
 
50
57
  /** defBaseRedactStoragePolicyService 入库脱敏策略服务实例。 */
@@ -31,17 +31,28 @@
31
31
  import { computed, onMounted, reactive, ref, useSlots } from "vue";
32
32
  import { ElMessage, ElMessageBox } from "element-plus";
33
33
  import { CirclePlus, Delete, EditPen } from "@element-plus/icons-vue";
34
- import type { ColumnProps, HeaderActionProps, ProTableInstance, RenderScope, TableActionProps } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
34
+ import type {
35
+ ColumnProps,
36
+ HeaderActionProps,
37
+ ProTableInstance,
38
+ RenderScope,
39
+ TableActionProps
40
+ } from "@liujitcn/kratos-admin-core/components/ProTable/interface";
35
41
  import ProTable from "@liujitcn/kratos-admin-core/components/ProTable";
36
42
  import FormDialog from "@liujitcn/kratos-admin-core/components/Dialog/FormDialog.vue";
37
43
  import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
38
44
  import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
39
45
  import { defBaseTenantProjectService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_tenant_project";
40
- import type { BaseTenantProject, BaseTenantProjectForm, PageBaseTenantProjectRequest } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_tenant_project";
46
+ import type {
47
+ BaseTenantProject,
48
+ BaseTenantProjectForm,
49
+ PageBaseTenantProjectRequest
50
+ } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_tenant_project";
41
51
  import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
42
52
  import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
43
53
  import { useTenantScope } from "@liujitcn/kratos-admin-core/tenant";
44
54
  import { t } from "@liujitcn/kratos-admin-core";
55
+ import { arrangeTenantProjectColumns } from "./tenant-project-manager-data";
45
56
  import {
46
57
  mergeTenantProjectExtraData,
47
58
  tenantProjectKey,
@@ -66,9 +77,9 @@ const emit = defineEmits<{
66
77
  "extra-data-error": [error: unknown];
67
78
  }>();
68
79
 
69
- /** 项目表单状态,新增时租户由默认租户管理员选择。 */
80
+ /** 项目表单状态,默认租户创建时必须选择目标租户。 */
70
81
  type BaseTenantProjectFormState = Omit<BaseTenantProjectForm, "tenant_id"> & {
71
- /** 租户ID。 */
82
+ /** 项目所属租户。 */
72
83
  tenant_id?: number;
73
84
  };
74
85
 
@@ -91,7 +102,7 @@ const statusOptions = computed<ProFormOption[]>(() => [
91
102
  const formData = reactive<BaseTenantProjectFormState>({
92
103
  /** 项目ID。 */
93
104
  id: 0,
94
- /** 租户ID。 */
105
+ /** 项目所属租户。 */
95
106
  tenant_id: undefined,
96
107
  /** 项目名称。 */
97
108
  name: "",
@@ -218,57 +229,60 @@ function resolveProjectBoolean(value: boolean | ((context: TenantProjectContext)
218
229
  }
219
230
 
220
231
  /** 项目表格列配置。 */
221
- const columns = computed<ColumnProps[]>(() => [
222
- { type: "selection", width: 55 },
223
- ...tenantColumns({ label: t("common.field.tenant"), order: 1 }),
224
- { prop: "name", label: t("system.base.tenant_project.field.name"), minWidth: 180, search: { el: "input" } },
225
- { prop: "code", label: t("system.base.tenant_project.field.code"), minWidth: 140, search: { el: "input" } },
226
- { prop: "sort", label: t("common.field.sort"), minWidth: 90, align: "right" },
227
- {
228
- prop: "status",
229
- label: t("common.field.status"),
230
- minWidth: 100,
231
- search: { el: "select" },
232
- cellType: "status",
233
- statusProps: {
234
- activeValue: Status.STATUS_ENABLE,
235
- inactiveValue: Status.STATUS_DISABLE,
236
- activeText: t("common.status.enabled"),
237
- inactiveText: t("common.status.disabled"),
238
- disabled: () => !BUTTONS.value["base:tenant:project:status"],
239
- beforeChange: scope => handleBeforeSetStatus(scope.row as BaseTenantProject)
240
- }
241
- },
242
- { prop: "remark", label: t("common.field.remark"), minWidth: 160 },
243
- ...props.extraColumns,
244
- { prop: "created_at", align: "center", label: t("common.field.created_at"), minWidth: 180 },
245
- { prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180, align: "center" },
246
- {
247
- prop: "operation",
248
- label: t("common.field.operation"),
249
- cellType: "actions",
250
- actions: [
251
- ...props.extraActions.map(toTableAction),
252
- {
253
- label: t("common.action.edit"),
254
- type: "primary",
255
- link: true,
256
- icon: EditPen,
257
- hidden: () => !BUTTONS.value["base:tenant:project:update"],
258
- params: scope => ({ projectId: scope.row.id }),
259
- onClick: (scope, params) => handleOpenDialog((params?.projectId as number | undefined) ?? (scope.row as BaseTenantProject).id)
260
- },
261
- {
262
- label: t("common.action.delete"),
263
- type: "danger",
264
- link: true,
265
- icon: Delete,
266
- hidden: () => !BUTTONS.value["base:tenant:project:delete"],
267
- onClick: scope => handleDelete(scope.row as BaseTenantProject)
232
+ const columns = computed<ColumnProps[]>(() => {
233
+ const baseColumns: ColumnProps[] = [
234
+ { type: "selection", width: 55 },
235
+ ...tenantColumns({ label: t("common.field.tenant"), order: 1 }),
236
+ { prop: "name", label: t("system.base.tenant_project.field.name"), minWidth: 180, search: { el: "input" } },
237
+ { prop: "code", label: t("system.base.tenant_project.field.code"), minWidth: 140, search: { el: "input" } },
238
+ { prop: "sort", label: t("common.field.sort"), minWidth: 90, align: "right" },
239
+ {
240
+ prop: "status",
241
+ label: t("common.field.status"),
242
+ minWidth: 100,
243
+ search: { el: "select" },
244
+ cellType: "status",
245
+ statusProps: {
246
+ activeValue: Status.STATUS_ENABLE,
247
+ inactiveValue: Status.STATUS_DISABLE,
248
+ activeText: t("common.status.enabled"),
249
+ inactiveText: t("common.status.disabled"),
250
+ disabled: () => !isDefaultTenant.value || !BUTTONS.value["base:tenant:project:status"],
251
+ beforeChange: scope => handleBeforeSetStatus(scope.row as BaseTenantProject)
268
252
  }
269
- ]
270
- }
271
- ]);
253
+ },
254
+ { prop: "remark", label: t("common.field.remark"), minWidth: 160 },
255
+ { prop: "created_at", align: "center", label: t("common.field.created_at"), minWidth: 180 },
256
+ { prop: "updated_at", label: t("common.field.updated_at"), minWidth: 180, align: "center" },
257
+ {
258
+ prop: "operation",
259
+ label: t("common.field.operation"),
260
+ cellType: "actions",
261
+ actions: [
262
+ ...props.extraActions.map(toTableAction),
263
+ {
264
+ label: t("common.action.edit"),
265
+ type: "primary",
266
+ link: true,
267
+ icon: EditPen,
268
+ hidden: () => !isDefaultTenant.value || !BUTTONS.value["base:tenant:project:update"],
269
+ params: scope => ({ projectId: scope.row.id }),
270
+ onClick: (scope, params) =>
271
+ handleOpenDialog((params?.projectId as number | undefined) ?? (scope.row as BaseTenantProject).id)
272
+ },
273
+ {
274
+ label: t("common.action.delete"),
275
+ type: "danger",
276
+ link: true,
277
+ icon: Delete,
278
+ hidden: () => !isDefaultTenant.value || !BUTTONS.value["base:tenant:project:delete"],
279
+ onClick: scope => handleDelete(scope.row as BaseTenantProject)
280
+ }
281
+ ]
282
+ }
283
+ ];
284
+ return arrangeTenantProjectColumns(baseColumns, props.extraColumns);
285
+ });
272
286
 
273
287
  /** 项目顶部按钮配置。 */
274
288
  const headerActions = computed<HeaderActionProps[]>(() => [
@@ -276,14 +290,14 @@ const headerActions = computed<HeaderActionProps[]>(() => [
276
290
  label: t("common.action.create"),
277
291
  type: "success",
278
292
  icon: CirclePlus,
279
- hidden: () => !BUTTONS.value["base:tenant:project:create"],
293
+ hidden: () => !isDefaultTenant.value || !BUTTONS.value["base:tenant:project:create"],
280
294
  onClick: () => handleOpenDialog()
281
295
  },
282
296
  {
283
297
  label: t("common.action.delete"),
284
298
  type: "danger",
285
299
  icon: Delete,
286
- hidden: () => !BUTTONS.value["base:tenant:project:delete"],
300
+ hidden: () => !isDefaultTenant.value || !BUTTONS.value["base:tenant:project:delete"],
287
301
  disabled: scope => !scope.selectedList.length,
288
302
  onClick: scope => handleDelete(scope.selectedList as BaseTenantProject[])
289
303
  }
@@ -365,10 +379,13 @@ function resetForm() {
365
379
  function handleSubmit() {
366
380
  formDialogRef.value?.validate()?.then(valid => {
367
381
  if (!valid) return;
368
- const submitData = JSON.parse(JSON.stringify(formData)) as BaseTenantProjectForm;
382
+ const submitData = JSON.parse(JSON.stringify(formData)) as Partial<BaseTenantProjectForm>;
383
+ const tenantId = toRequestTenantId(formData.tenant_id);
384
+ if (tenantId === undefined) delete submitData.tenant_id;
385
+ else submitData.tenant_id = tenantId;
369
386
  const request = submitData.id
370
- ? defBaseTenantProjectService.UpdateBaseTenantProject({ base_tenant_project: submitData })
371
- : defBaseTenantProjectService.CreateBaseTenantProject({ base_tenant_project: submitData });
387
+ ? defBaseTenantProjectService.UpdateBaseTenantProject({ base_tenant_project: submitData as BaseTenantProjectForm })
388
+ : defBaseTenantProjectService.CreateBaseTenantProject({ base_tenant_project: submitData as BaseTenantProjectForm });
372
389
  request.then(() => {
373
390
  ElMessage.success(
374
391
  t(submitData.id ? "common.message.update_success" : "common.message.create_success", {