@liujitcn/kratos-admin-core 0.0.21 → 0.0.23

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 (85) hide show
  1. package/dist/package/declarations/src/api/base/language.d.ts +3 -3
  2. package/dist/package/declarations/src/components/Dict/index.vue.d.ts +4 -3
  3. package/dist/package/declarations/src/components/Dict/value.d.ts +11 -0
  4. package/dist/package/declarations/src/locales/generated.d.ts +3382 -0
  5. package/dist/package/declarations/src/locales/index.d.ts +11 -21
  6. package/dist/package/declarations/src/rpc/base/v1/config.d.ts +11 -1
  7. package/dist/package/declarations/src/rpc/base/v1/language.d.ts +7 -13
  8. package/dist/package/declarations/src/rpc/base/v1/login.d.ts +13 -1
  9. package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +1 -1
  10. package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +7 -77
  11. package/dist/package/declarations/src/rpc/system/admin/v1/base_translation.d.ts +54 -81
  12. package/dist/package/declarations/src/rpc/system/admin/v1/common.d.ts +13 -0
  13. package/dist/package/declarations/src/stores/modules/auth.d.ts +6 -6
  14. package/dist/package/declarations/src/utils/passwordCrypto.d.ts +1 -1
  15. package/dist/package/src/App.vue +2 -8
  16. package/dist/package/src/api/base/language.ts +4 -4
  17. package/dist/package/src/bootstrap.ts +1 -1
  18. package/dist/package/src/components/CronExpression/index.vue +19 -19
  19. package/dist/package/src/components/Dialog/FormDialog.vue +1 -1
  20. package/dist/package/src/components/Dict/index.vue +21 -7
  21. package/dist/package/src/components/Dict/value.ts +18 -0
  22. package/dist/package/src/components/ImportExcel/index.vue +10 -10
  23. package/dist/package/src/components/LocaleSwitch/index.vue +1 -1
  24. package/dist/package/src/components/ProForm/components/DynamicList.vue +1 -1
  25. package/dist/package/src/components/ProForm/components/KvList.vue +2 -2
  26. package/dist/package/src/components/ProForm/index.vue +2 -2
  27. package/dist/package/src/components/ProTable/components/ColSetting.vue +3 -3
  28. package/dist/package/src/components/ProTable/components/TableColumn.vue +1 -1
  29. package/dist/package/src/components/ProTable/index.vue +4 -4
  30. package/dist/package/src/components/SearchForm/components/SearchFormItem.vue +2 -2
  31. package/dist/package/src/components/SelectFilter/index.vue +1 -1
  32. package/dist/package/src/components/TreeFilter/index.vue +4 -4
  33. package/dist/package/src/components/Upload/File.vue +6 -6
  34. package/dist/package/src/components/Upload/Files.vue +7 -7
  35. package/dist/package/src/components/Upload/Img.vue +4 -4
  36. package/dist/package/src/components/Upload/Imgs.vue +5 -5
  37. package/dist/package/src/components/WangEditor/index.vue +1 -1
  38. package/dist/package/src/hooks/useDownload.ts +1 -1
  39. package/dist/package/src/hooks/useHandleData.ts +2 -2
  40. package/dist/package/src/hooks/useTheme.ts +1 -1
  41. package/dist/package/src/layouts/components/Header/components/AssemblySize.vue +1 -1
  42. package/dist/package/src/layouts/components/Header/components/Avatar.vue +5 -5
  43. package/dist/package/src/layouts/components/Header/components/Breadcrumb.vue +2 -2
  44. package/dist/package/src/layouts/components/Header/components/Fullscreen.vue +2 -2
  45. package/dist/package/src/layouts/components/Header/components/PasswordDialog.vue +1 -1
  46. package/dist/package/src/layouts/components/Header/components/SearchMenu.vue +3 -3
  47. package/dist/package/src/layouts/components/Main/index.vue +1 -0
  48. package/dist/package/src/layouts/components/Tabs/components/MoreButton.vue +5 -5
  49. package/dist/package/src/layouts/components/Tabs/index.vue +15 -1
  50. package/dist/package/src/layouts/components/ThemeDrawer/index.vue +7 -7
  51. package/dist/package/src/locales/README.md +2 -2
  52. package/dist/package/src/locales/en-US.json +142 -117
  53. package/dist/package/src/locales/es-ES.json +226 -201
  54. package/dist/package/src/locales/fr-FR.json +226 -201
  55. package/dist/package/src/locales/generated.ts +57 -0
  56. package/dist/package/src/locales/index.ts +54 -55
  57. package/dist/package/src/locales/ja-JP.json +177 -152
  58. package/dist/package/src/locales/ko-KR.json +221 -196
  59. package/dist/package/src/locales/zh-CN.json +142 -117
  60. package/dist/package/src/locales/zh-TW.json +147 -122
  61. package/dist/package/src/modules/kratosAdmin.ts +3 -17
  62. package/dist/package/src/routers/modules/dynamicRouter.ts +4 -4
  63. package/dist/package/src/routers/modules/staticRouter.ts +2 -2
  64. package/dist/package/src/rpc/base/v1/config.ts +12 -1
  65. package/dist/package/src/rpc/base/v1/language.ts +7 -13
  66. package/dist/package/src/rpc/base/v1/login.ts +14 -1
  67. package/dist/package/src/rpc/system/admin/v1/auth.ts +1 -1
  68. package/dist/package/src/rpc/system/admin/v1/base_dict.ts +7 -79
  69. package/dist/package/src/rpc/system/admin/v1/base_translation.ts +54 -81
  70. package/dist/package/src/rpc/system/admin/v1/common.ts +21 -0
  71. package/dist/package/src/stores/modules/config.ts +2 -2
  72. package/dist/package/src/stores/modules/user.ts +1 -1
  73. package/dist/package/src/styles/element.scss +2 -0
  74. package/dist/package/src/utils/color.ts +4 -4
  75. package/dist/package/src/utils/eleValidate.ts +2 -2
  76. package/dist/package/src/utils/index.ts +3 -3
  77. package/dist/package/src/utils/passwordCrypto.ts +2 -2
  78. package/dist/package/src/utils/request.ts +6 -6
  79. package/dist/package/src/views/login/components/LoginForm.vue +15 -12
  80. package/package.json +2 -2
  81. package/vite.config.ts +12 -8
  82. package/dist/package/declarations/src/rpc/base/v1/enum.d.ts +0 -43
  83. package/dist/package/declarations/src/rpc/system/common/v1/enum.d.ts +0 -67
  84. package/dist/package/src/rpc/base/v1/enum.ts +0 -54
  85. package/dist/package/src/rpc/system/common/v1/enum.ts +0 -80
@@ -1,16 +1,10 @@
1
- import "dayjs/locale/en";
2
- import "dayjs/locale/ja";
3
- import "dayjs/locale/zh-cn";
4
- import "dayjs/locale/zh-tw";
5
- import "dayjs/locale/ko";
6
- import "dayjs/locale/fr";
7
- import "dayjs/locale/es";
8
1
  import type { AdminModule } from "../modules";
9
- import type { GetLanguageResponse } from "../rpc/base/v1/language";
10
- /** 管理端支持的语言区域。 */
11
- export declare const SUPPORTED_LOCALES: readonly ["zh-CN", "zh-TW", "en-US", "ja-JP", "ko-KR", "fr-FR", "es-ES"];
2
+ import type { OptionLanguageResponse } from "../rpc/base/v1/language";
3
+ import { type GeneratedLocale } from "./generated";
4
+ /** 管理端已打包的语言区域;运行时可切换列表由 base_language 接口决定。 */
5
+ export declare const SUPPORTED_LOCALES: ("zh-CN" | "en-US" | "es-ES" | "fr-FR" | "ja-JP" | "ko-KR" | "zh-TW")[];
12
6
  /** 管理端支持的语言区域类型。 */
13
- export type SupportedLocale = (typeof SUPPORTED_LOCALES)[number];
7
+ export type SupportedLocale = GeneratedLocale;
14
8
  /** 单个模块的扁平语言包。 */
15
9
  export type LocaleMessages = Record<string, string>;
16
10
  /** 翻译插值参数。 */
@@ -19,25 +13,21 @@ export type LocaleParams = Record<string, string | number>;
19
13
  export interface LocaleOption {
20
14
  /** 标准语言代码。 */
21
15
  language_code: SupportedLocale;
22
- /** 语言名称。 */
23
- language_name: string;
24
16
  /** 本地语言名称。 */
25
17
  native_name: string;
26
- /** 排序值。 */
27
- sort: number;
28
18
  }
29
19
  export declare const DEFAULT_LOCALE: SupportedLocale;
30
20
  export declare const LOCALE_STORAGE_KEY = "kratos-admin:locale";
31
21
  /** 管理端 Vue I18n 实例。 */
32
- export declare const adminI18n: import("vue-i18n").I18n<{}, {}, {}, "zh-CN", false>;
22
+ export declare const adminI18n: import("vue-i18n").I18n<{}, {}, {}, "zh-CN" | "en-US" | "es-ES" | "fr-FR" | "ja-JP" | "ko-KR" | "zh-TW", false>;
33
23
  /** 规范化任意语言输入到管理端白名单。 */
34
24
  export declare function normalizeLocale(value?: string): SupportedLocale;
35
- /** 注册模块语言包并校验七语键、占位符和命名空间。 */
25
+ /** 注册模块语言包并校验语言键、占位符和命名空间。 */
36
26
  export declare function registerLocaleMessages(modules: AdminModule[]): void;
37
27
  /** 初始化持久化语言偏好并同步日期库。 */
38
28
  export declare function initializeLocale(): SupportedLocale;
39
- /** 应用后端语言配置,并在当前语言不可用时回退到接口主语言。 */
40
- export declare function applyLanguageConfig(response: GetLanguageResponse): void;
29
+ /** 应用后端语言配置,并在当前语言不可用时回退到接口第一项。 */
30
+ export declare function applyLanguageConfig(response: OptionLanguageResponse): void;
41
31
  /** 获取当前接口配置的语言选项。 */
42
32
  export declare function getLanguageOptions(): LocaleOption[];
43
33
  /** 获取当前可切换的语言区域。 */
@@ -54,10 +44,10 @@ export declare function registerLocaleChangeHandler(handler: () => void | Promis
54
44
  export declare function t(key: string, params?: LocaleParams): string;
55
45
  /** 管理端响应式语言状态。 */
56
46
  export declare function useLocaleStore(): {
57
- locale: Readonly<globalThis.Ref<"zh-CN" | "zh-TW" | "en-US" | "ja-JP" | "ko-KR" | "fr-FR" | "es-ES", "zh-CN" | "zh-TW" | "en-US" | "ja-JP" | "ko-KR" | "fr-FR" | "es-ES">>;
47
+ locale: Readonly<globalThis.Ref<"zh-CN" | "en-US" | "es-ES" | "fr-FR" | "ja-JP" | "ko-KR" | "zh-TW", "zh-CN" | "en-US" | "es-ES" | "fr-FR" | "ja-JP" | "ko-KR" | "zh-TW">>;
58
48
  localeIndex: globalThis.ComputedRef<number>;
59
49
  languageOptions: globalThis.ComputedRef<LocaleOption[]>;
60
- supportedLocales: globalThis.ComputedRef<("zh-CN" | "zh-TW" | "en-US" | "ja-JP" | "ko-KR" | "fr-FR" | "es-ES")[]>;
50
+ supportedLocales: globalThis.ComputedRef<("zh-CN" | "en-US" | "es-ES" | "fr-FR" | "ja-JP" | "ko-KR" | "zh-TW")[]>;
61
51
  setLocale: typeof setCurrentLocale;
62
52
  t: typeof t;
63
53
  };
@@ -1,4 +1,14 @@
1
- import type { BaseConfigSite } from "./enum";
1
+ /** 系统配置位置。 */
2
+ export declare enum BaseConfigSite {
3
+ /** BASE_CONFIG_SITE_UNSPECIFIED - 未指定系统配置位置。 */
4
+ BASE_CONFIG_SITE_UNSPECIFIED = 0,
5
+ /** BASE_CONFIG_SITE_SYSTEM - 系统内使用。 */
6
+ BASE_CONFIG_SITE_SYSTEM = 1,
7
+ /** BASE_CONFIG_SITE_ADMIN - 管理端。 */
8
+ BASE_CONFIG_SITE_ADMIN = 2,
9
+ /** BASE_CONFIG_SITE_APP - 移动端。 */
10
+ BASE_CONFIG_SITE_APP = 3
11
+ }
2
12
  /** 获取系统配置条件 */
3
13
  export interface GetConfigRequest {
4
14
  /** 位置:枚举【BaseConfigSite】 */
@@ -1,26 +1,20 @@
1
- /** 查询语言请求参数。 */
2
- export interface GetLanguageRequest {
1
+ /** 查询语言选项请求参数。 */
2
+ export interface OptionLanguageRequest {
3
3
  }
4
- /** 支持的语言。 */
4
+ /** 语言选择项。 */
5
5
  export interface LanguageItem {
6
6
  /** 标准语言代码 */
7
7
  language_code: string;
8
- /** 语言名称 */
9
- language_name: string;
10
8
  /** 本地语言名称 */
11
9
  native_name: string;
12
- /** 排序,值越小越靠前 */
13
- sort: number;
14
10
  }
15
- /** 当前支持的语言查询结果。 */
16
- export interface GetLanguageResponse {
11
+ /** 当前支持的语言选项查询结果。 */
12
+ export interface OptionLanguageResponse {
17
13
  /** 当前支持的语言列表 */
18
14
  languages: LanguageItem[];
19
- /** 主语言代码 */
20
- primary_language_code: string;
21
15
  }
22
16
  /** 语言公共服务。 */
23
17
  export interface LanguageService {
24
- /** 查询当前支持的语言和主语言。 */
25
- GetLanguage(request: GetLanguageRequest): Promise<GetLanguageResponse>;
18
+ /** 查询当前支持的语言选项。 */
19
+ OptionLanguage(request: OptionLanguageRequest): Promise<OptionLanguageResponse>;
26
20
  }
@@ -1,6 +1,18 @@
1
1
  import type { PasswordCrypto } from "../../common/v1/types";
2
2
  import type { Empty } from "../../google/protobuf/empty";
3
- import type { PasswordCryptoScene } from "./enum";
3
+ /** 密码加密场景枚举。 */
4
+ export declare enum PasswordCryptoScene {
5
+ /** PASSWORD_CRYPTO_SCENE_UNSPECIFIED - 未指定密码加密场景。 */
6
+ PASSWORD_CRYPTO_SCENE_UNSPECIFIED = 0,
7
+ /** PASSWORD_CRYPTO_SCENE_LOGIN - 登录密码加密场景。 */
8
+ PASSWORD_CRYPTO_SCENE_LOGIN = 1,
9
+ /** PASSWORD_CRYPTO_SCENE_CREATE_BASE_USER - 新增后台用户密码加密场景。 */
10
+ PASSWORD_CRYPTO_SCENE_CREATE_BASE_USER = 2,
11
+ /** PASSWORD_CRYPTO_SCENE_RESET_BASE_USER_PASSWORD - 重置后台用户密码加密场景。 */
12
+ PASSWORD_CRYPTO_SCENE_RESET_BASE_USER_PASSWORD = 3,
13
+ /** PASSWORD_CRYPTO_SCENE_UPDATE_USER_PASSWORD - 个人修改密码加密场景。 */
14
+ PASSWORD_CRYPTO_SCENE_UPDATE_USER_PASSWORD = 4
15
+ }
4
16
  /** 验证码获取条件 */
5
17
  export interface CaptchaRequest {
6
18
  /** 验证码类型,random 表示随机选择当前支持的验证码类型 */
@@ -1,6 +1,6 @@
1
1
  import type { PasswordCrypto, StringValues } from "../../../common/v1/types";
2
2
  import type { Empty } from "../../../google/protobuf/empty";
3
- import type { BaseMenuType } from "../../common/v1/enum";
3
+ import type { BaseMenuType } from "./common";
4
4
  /** 登录用户菜单树查询参数 */
5
5
  export interface TreeUserMenuRequest {
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import type { Status } from "../../../common/v1/enum";
2
2
  import type { Empty } from "../../../google/protobuf/empty";
3
- import type { TranslationStatus } from "./base_translation";
3
+ import type { BaseTranslation } from "./base_translation";
4
4
  /** 字典选项查询条件 */
5
5
  export interface OptionBaseDictRequest {
6
6
  }
@@ -81,7 +81,7 @@ export interface BaseDictForm {
81
81
  /** 字典名称 */
82
82
  name: string;
83
83
  /** 非主语言翻译 */
84
- translations: BaseDictTranslation[];
84
+ translations: BaseTranslation[];
85
85
  /** 状态 */
86
86
  status: Status;
87
87
  }
@@ -105,7 +105,7 @@ export interface BaseDictItemForm {
105
105
  /** 排序 */
106
106
  sort: number;
107
107
  /** 非主语言翻译 */
108
- translations: BaseDictItemTranslation[];
108
+ translations: BaseTranslation[];
109
109
  /** 状态 */
110
110
  status: Status;
111
111
  }
@@ -161,14 +161,14 @@ export interface BaseDict {
161
161
  code: string;
162
162
  /** 字典名称 */
163
163
  name: string;
164
- /** 非主语言翻译 */
165
- translations: BaseDictTranslation[];
166
164
  /** 状态 */
167
165
  status: Status;
168
166
  /** 创建时间 */
169
167
  created_at: string;
170
168
  /** 更新时间 */
171
169
  updated_at: string;
170
+ /** 非主语言翻译 */
171
+ translations: BaseTranslation[];
172
172
  }
173
173
  /** 字典项 */
174
174
  export interface BaseDictItem {
@@ -184,84 +184,14 @@ export interface BaseDictItem {
184
184
  tag_type: string;
185
185
  /** 排序 */
186
186
  sort: number;
187
- /** 非主语言翻译 */
188
- translations: BaseDictItemTranslation[];
189
187
  /** 状态 */
190
188
  status: Status;
191
189
  /** 创建时间 */
192
190
  created_at: string;
193
191
  /** 更新时间 */
194
192
  updated_at: string;
195
- }
196
- /** 字典翻译 */
197
- export interface BaseDictTranslation {
198
- /** 主键ID */
199
- id: number;
200
- /** 字典ID */
201
- dict_id: number;
202
- /** 语言代码 */
203
- locale: string;
204
- /** 字典名称 */
205
- name: string;
206
- /** 翻译状态 */
207
- translation_status: TranslationStatus;
208
- /** 中文源文SHA-256 */
209
- source_hash: string;
210
- /** 机器翻译提供方 */
211
- translation_provider: string;
212
- /** 最近机器翻译时间 */
213
- translated_at: string;
214
- /** 审核人ID */
215
- reviewed_by: number;
216
- /** 审核时间 */
217
- reviewed_at: string;
218
- /** 创建人ID */
219
- created_by: number;
220
- /** 更新人ID */
221
- updated_by: number;
222
- /** 创建时间 */
223
- created_at: string;
224
- /** 更新时间 */
225
- updated_at: string;
226
- /** 删除时间 */
227
- deleted_at: number;
228
- /** 中文源文是否已变化 */
229
- source_changed: boolean;
230
- }
231
- /** 字典项翻译 */
232
- export interface BaseDictItemTranslation {
233
- /** 主键ID */
234
- id: number;
235
- /** 字典项ID */
236
- dict_item_id: number;
237
- /** 语言代码 */
238
- locale: string;
239
- /** 字典项标签 */
240
- label: string;
241
- /** 翻译状态 */
242
- translation_status: TranslationStatus;
243
- /** 中文源文SHA-256 */
244
- source_hash: string;
245
- /** 机器翻译提供方 */
246
- translation_provider: string;
247
- /** 最近机器翻译时间 */
248
- translated_at: string;
249
- /** 审核人ID */
250
- reviewed_by: number;
251
- /** 审核时间 */
252
- reviewed_at: string;
253
- /** 创建人ID */
254
- created_by: number;
255
- /** 更新人ID */
256
- updated_by: number;
257
- /** 创建时间 */
258
- created_at: string;
259
- /** 更新时间 */
260
- updated_at: string;
261
- /** 删除时间 */
262
- deleted_at: number;
263
- /** 中文源文是否已变化 */
264
- source_changed: boolean;
193
+ /** 非主语言翻译 */
194
+ translations: BaseTranslation[];
265
195
  }
266
196
  /** Admin字典服务 */
267
197
  export interface BaseDictService {
@@ -1,92 +1,63 @@
1
- /** 翻译状态 */
2
- export declare enum TranslationStatus {
3
- TRANSLATION_STATUS_UNSPECIFIED = 0,
4
- TRANSLATION_STATUS_PENDING = 1,
5
- TRANSLATION_STATUS_MACHINE = 2,
6
- TRANSLATION_STATUS_REVIEWED = 3
1
+ import type { Empty } from "../../../google/protobuf/empty";
2
+ /** 统一翻译表目标类型,和 base_translation.target_type 的值一一对应。 */
3
+ export declare enum TranslationTargetType {
4
+ /** TRANSLATION_TARGET_TYPE_UNSPECIFIED - 未指定统一翻译表目标类型。 */
5
+ TRANSLATION_TARGET_TYPE_UNSPECIFIED = 0,
6
+ /** TRANSLATION_TARGET_TYPE_BASE_CONFIG_VALUE - 系统配置值。 */
7
+ TRANSLATION_TARGET_TYPE_BASE_CONFIG_VALUE = 1,
8
+ /** TRANSLATION_TARGET_TYPE_BASE_CONFIG_NAME - 系统配置名称。 */
9
+ TRANSLATION_TARGET_TYPE_BASE_CONFIG_NAME = 2,
10
+ /** TRANSLATION_TARGET_TYPE_BASE_DICT - 字典名称。 */
11
+ TRANSLATION_TARGET_TYPE_BASE_DICT = 3,
12
+ /** TRANSLATION_TARGET_TYPE_BASE_DICT_ITEM - 字典项标签。 */
13
+ TRANSLATION_TARGET_TYPE_BASE_DICT_ITEM = 4,
14
+ /** TRANSLATION_TARGET_TYPE_BASE_MENU - 菜单标题。 */
15
+ TRANSLATION_TARGET_TYPE_BASE_MENU = 5
7
16
  }
8
- /** 翻译资源类型 */
9
- export declare enum TranslationResourceType {
10
- TRANSLATION_RESOURCE_TYPE_UNSPECIFIED = 0,
11
- TRANSLATION_RESOURCE_TYPE_MENU = 1,
12
- TRANSLATION_RESOURCE_TYPE_DICT = 2,
13
- TRANSLATION_RESOURCE_TYPE_DICT_ITEM = 3,
14
- TRANSLATION_RESOURCE_TYPE_CONFIG = 4
17
+ /** 翻译单个文本请求。 */
18
+ export interface DraftBaseTranslationRequest {
19
+ /** 待翻译文本 */
20
+ source: string;
21
+ /** 目标语言区域,不传时翻译所有启用的非主语言 */
22
+ locale?: string | undefined;
15
23
  }
16
- /** 系统配置翻译字段 */
17
- export declare enum BaseConfigTranslationField {
18
- BASE_CONFIG_TRANSLATION_FIELD_UNSPECIFIED = 0,
19
- BASE_CONFIG_TRANSLATION_FIELD_NAME = 1,
20
- BASE_CONFIG_TRANSLATION_FIELD_VALUE = 2
24
+ /** 翻译单个文本响应。 */
25
+ export interface DraftBaseTranslationResponse {
26
+ /** 翻译结果 */
27
+ translations: DraftBaseTranslationItem[];
21
28
  }
22
- /** 生成翻译草稿请求 */
23
- export interface GenerateTranslationDraftRequest {
24
- /** 资源类型 */
25
- resource_type: TranslationResourceType;
26
- /** 已保存资源ID */
27
- resource_id: number;
28
- /** 目标语言代码 */
29
- target_locale: string;
30
- /** 系统配置翻译字段,配置资源必填 */
31
- field: BaseConfigTranslationField;
32
- }
33
- /** 生成翻译草稿响应 */
34
- export interface GenerateTranslationDraftResponse {
35
- /** 资源类型 */
36
- resource_type: TranslationResourceType;
37
- /** 资源ID */
38
- resource_id: number;
39
- /** 语言区域 */
29
+ /** 翻译单个文本响应。 */
30
+ export interface DraftBaseTranslationItem {
31
+ /** 目标语言区域 */
40
32
  locale: string;
41
- /** 机器翻译草稿 */
33
+ /** 翻译文本 */
42
34
  translation: string;
43
- /** 翻译状态 */
44
- translation_status: TranslationStatus;
45
- /** 中文源文SHA-256 */
46
- source_hash: string;
47
- /** 机器翻译提供方 */
48
- translation_provider: string;
49
- /** 最近机器翻译时间 */
50
- translated_at: string;
51
- /** 系统配置翻译字段 */
52
- field: BaseConfigTranslationField;
53
35
  }
54
- /** 系统配置单语言翻译 */
55
- export interface BaseConfigTranslation {
36
+ /** 修改单个翻译信息请求。 */
37
+ export interface UpdateBaseTranslationRequest {
38
+ /** 翻译记录ID,大于零时优先按ID更新;ID不存在时根据目标信息更新或新增 */
39
+ id: number;
40
+ /** 翻译目标类型,ID为零时用于查询或新增 */
41
+ target_type: TranslationTargetType;
42
+ /** 目标资源ID,ID为零时用于查询或新增 */
43
+ target_id: number;
44
+ /** 目标语言区域,ID为零时用于查询或新增 */
45
+ locale: string;
46
+ /** 翻译文本 */
47
+ name: string;
48
+ }
49
+ /** 国际化翻译信息 */
50
+ export interface BaseTranslation {
56
51
  /** 翻译记录ID */
57
52
  id: number;
58
- /** 系统配置ID */
59
- config_id: number;
53
+ /** 翻译目标类型 */
54
+ target_type: TranslationTargetType;
55
+ /** 目标资源ID */
56
+ target_id: number;
60
57
  /** 语言区域 */
61
58
  locale: string;
62
- /** 翻译字段:name或value */
63
- field: BaseConfigTranslationField;
64
59
  /** 翻译文本 */
65
- text: string;
66
- /** 翻译审核状态 */
67
- translation_status: TranslationStatus;
68
- /** 中文源文SHA-256 */
69
- source_hash: string;
70
- /** 中文源文是否已变化 */
71
- source_changed: boolean;
72
- /** 机器翻译提供方 */
73
- translation_provider: string;
74
- /** 最近机器翻译时间 */
75
- translated_at: string;
76
- /** 审核人ID */
77
- reviewed_by: number;
78
- /** 审核时间 */
79
- reviewed_at: string;
80
- /** 创建人ID */
81
- created_by: number;
82
- /** 更新人ID */
83
- updated_by: number;
84
- /** 创建时间 */
85
- created_at: string;
86
- /** 更新时间 */
87
- updated_at: string;
88
- /** 删除时间 */
89
- deleted_at: number;
60
+ name: string;
90
61
  }
91
62
  /** 代码生成单语言国际化配置 */
92
63
  export interface CodeGenLocaleConfig {
@@ -95,8 +66,10 @@ export interface CodeGenLocaleConfig {
95
66
  /** 左树描述 */
96
67
  left_tree_comment: string;
97
68
  }
98
- /** Admin翻译草稿服务 */
69
+ /** 国际化翻译信息服务。 */
99
70
  export interface BaseTranslationService {
100
- /** 为单个已保存资源生成机器翻译草稿 */
101
- GenerateTranslationDraft(request: GenerateTranslationDraftRequest): Promise<GenerateTranslationDraftResponse>;
71
+ /** 翻译单个文本。 */
72
+ DraftBaseTranslation(request: DraftBaseTranslationRequest): Promise<DraftBaseTranslationResponse>;
73
+ /** 修改国际化翻译信息 */
74
+ UpdateBaseTranslation(request: UpdateBaseTranslationRequest): Promise<Empty>;
102
75
  }
@@ -0,0 +1,13 @@
1
+ /** 菜单类型。 */
2
+ export declare enum BaseMenuType {
3
+ /** BASE_MENU_TYPE_UNSPECIFIED - 未指定菜单类型。 */
4
+ BASE_MENU_TYPE_UNSPECIFIED = 0,
5
+ /** BASE_MENU_TYPE_FOLDER - 目录。 */
6
+ BASE_MENU_TYPE_FOLDER = 1,
7
+ /** BASE_MENU_TYPE_MENU - 菜单。 */
8
+ BASE_MENU_TYPE_MENU = 2,
9
+ /** BASE_MENU_TYPE_BUTTON - 按钮。 */
10
+ BASE_MENU_TYPE_BUTTON = 3,
11
+ /** BASE_MENU_TYPE_EXT_LINK - 外部链接。 */
12
+ BASE_MENU_TYPE_EXT_LINK = 4
13
+ }
@@ -24,7 +24,7 @@ export declare const useAuthStore: import("pinia").StoreDefinition<"admin-auth",
24
24
  value?: string | undefined | undefined;
25
25
  }[];
26
26
  } | undefined;
27
- type: import("../../rpc/system/common/v1/enum").BaseMenuType;
27
+ type: import("../../rpc/system/admin/v1/common").BaseMenuType;
28
28
  children: /*elided*/ any[];
29
29
  }[];
30
30
  } & import("pinia").PiniaCustomStateProperties<AuthState>) => {
@@ -53,7 +53,7 @@ export declare const useAuthStore: import("pinia").StoreDefinition<"admin-auth",
53
53
  value?: string | undefined | undefined;
54
54
  }[];
55
55
  } | undefined;
56
- type: import("../../rpc/system/common/v1/enum").BaseMenuType;
56
+ type: import("../../rpc/system/admin/v1/common").BaseMenuType;
57
57
  children: /*elided*/ any[];
58
58
  }[];
59
59
  } & import("pinia").PiniaCustomStateProperties<AuthState>) => {
@@ -74,7 +74,7 @@ export declare const useAuthStore: import("pinia").StoreDefinition<"admin-auth",
74
74
  value?: string | undefined | undefined;
75
75
  }[];
76
76
  } | undefined;
77
- type: import("../../rpc/system/common/v1/enum").BaseMenuType;
77
+ type: import("../../rpc/system/admin/v1/common").BaseMenuType;
78
78
  children: /*elided*/ any[];
79
79
  }[];
80
80
  showMenuListGet: (state: {
@@ -100,7 +100,7 @@ export declare const useAuthStore: import("pinia").StoreDefinition<"admin-auth",
100
100
  value?: string | undefined | undefined;
101
101
  }[];
102
102
  } | undefined;
103
- type: import("../../rpc/system/common/v1/enum").BaseMenuType;
103
+ type: import("../../rpc/system/admin/v1/common").BaseMenuType;
104
104
  children: /*elided*/ any[];
105
105
  }[];
106
106
  } & import("pinia").PiniaCustomStateProperties<AuthState>) => RouteItem[];
@@ -127,7 +127,7 @@ export declare const useAuthStore: import("pinia").StoreDefinition<"admin-auth",
127
127
  value?: string | undefined | undefined;
128
128
  }[];
129
129
  } | undefined;
130
- type: import("../../rpc/system/common/v1/enum").BaseMenuType;
130
+ type: import("../../rpc/system/admin/v1/common").BaseMenuType;
131
131
  children: /*elided*/ any[];
132
132
  }[];
133
133
  } & import("pinia").PiniaCustomStateProperties<AuthState>) => RouteItem[];
@@ -154,7 +154,7 @@ export declare const useAuthStore: import("pinia").StoreDefinition<"admin-auth",
154
154
  value?: string | undefined | undefined;
155
155
  }[];
156
156
  } | undefined;
157
- type: import("../../rpc/system/common/v1/enum").BaseMenuType;
157
+ type: import("../../rpc/system/admin/v1/common").BaseMenuType;
158
158
  children: /*elided*/ any[];
159
159
  }[];
160
160
  } & import("pinia").PiniaCustomStateProperties<AuthState>) => Record<string, RouteItem[]>;
@@ -1,4 +1,4 @@
1
- import { PasswordCryptoScene } from "../rpc/base/v1/enum";
1
+ import { PasswordCryptoScene } from "../rpc/base/v1/login";
2
2
  import type { PasswordCrypto } from "../rpc/common/v1/types";
3
3
  export declare const PASSWORD_CRYPTO_SCENE: typeof PasswordCryptoScene;
4
4
  export type { PasswordCryptoScene };
@@ -9,18 +9,12 @@ import { reactive, computed } from "vue";
9
9
  import { useTheme } from "./hooks/useTheme";
10
10
  import { ElConfigProvider } from "element-plus";
11
11
  import { useGlobalStore } from "./stores/modules/global";
12
+ import { ELEMENT_LOCALES } from "./locales/generated";
12
13
  import { useLocaleStore } from "./locales";
13
- import en from "element-plus/es/locale/lang/en";
14
- import ja from "element-plus/es/locale/lang/ja";
15
- import zhCn from "element-plus/es/locale/lang/zh-cn";
16
- import zhTw from "element-plus/es/locale/lang/zh-tw";
17
- import ko from "element-plus/es/locale/lang/ko";
18
- import fr from "element-plus/es/locale/lang/fr";
19
- import es from "element-plus/es/locale/lang/es";
20
14
 
21
15
  const globalStore = useGlobalStore();
22
16
  const { locale } = useLocaleStore();
23
- const elementLocale = computed(() => ({ "zh-CN": zhCn, "zh-TW": zhTw, "en-US": en, "ja-JP": ja, "ko-KR": ko, "fr-FR": fr, "es-ES": es })[locale.value]);
17
+ const elementLocale = computed(() => ELEMENT_LOCALES[locale.value]);
24
18
 
25
19
  // init theme
26
20
  const { initTheme } = useTheme();
@@ -1,13 +1,13 @@
1
1
  import service from "../../utils/request";
2
- import type { GetLanguageRequest, GetLanguageResponse, LanguageService } from "../../rpc/base/v1/language";
2
+ import type { LanguageService, OptionLanguageRequest, OptionLanguageResponse } from "../../rpc/base/v1/language";
3
3
 
4
4
  const LANGUAGE_URL = "/v1/base/language";
5
5
 
6
6
  /** 语言公共服务。 */
7
7
  export class LanguageServiceImpl implements LanguageService {
8
- /** 查询当前支持的语言和主语言。 */
9
- GetLanguage(request: GetLanguageRequest): Promise<GetLanguageResponse> {
10
- return service<GetLanguageRequest, GetLanguageResponse>({
8
+ /** 查询当前支持的语言选项。 */
9
+ OptionLanguage(request: OptionLanguageRequest): Promise<OptionLanguageResponse> {
10
+ return service<OptionLanguageRequest, OptionLanguageResponse>({
11
11
  url: LANGUAGE_URL,
12
12
  method: "get",
13
13
  params: request,
@@ -49,7 +49,7 @@ export async function bootstrapAdminApp(options: AdminBootstrapOptions = {}) {
49
49
  registerLocaleMessages(modules);
50
50
  initializeLocale();
51
51
  try {
52
- applyLanguageConfig(await defLanguageService.GetLanguage({}));
52
+ applyLanguageConfig(await defLanguageService.OptionLanguage({}));
53
53
  } catch {
54
54
  // 语言公共接口失败时继续使用静态语言包和系统语言。
55
55
  }