@skyfox2000/webui 1.6.8 → 1.6.10

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 (42) hide show
  1. package/lib/assets/modules/{baseLayout-CLYEvEZ4.js → baseLayout-BgD-4w61.js} +4 -4
  2. package/lib/assets/modules/{file-upload-JSdbDIS7.js → file-upload-Dpa4Fep4.js} +1 -1
  3. package/lib/assets/modules/{index-DDdkKF8p.js → index-BbsDXiOZ.js} +14 -14
  4. package/lib/assets/modules/{index-DeciUTEK.js → index-D4JdJvXa.js} +3 -3
  5. package/lib/assets/modules/{index--7cem1cg.js → index-DwvEdjTo.js} +13 -13
  6. package/lib/assets/modules/{menuTabs-B6rKn3BF.js → menuTabs-BNHQD8Vv.js} +46 -46
  7. package/lib/assets/modules/{toolIcon-h7IPQaWC.js → toolIcon-pU_oMwMV.js} +5 -5
  8. package/lib/assets/modules/{upload-template-W04BQpEb.js → upload-template-Dl5FDmMi.js} +2718 -2340
  9. package/lib/assets/modules/{uploadList-D4k7XnhK.js → uploadList-DpF-CDiS.js} +68 -68
  10. package/lib/components/content/list/index.vue.d.ts +1 -1
  11. package/lib/es/AceEditor/index.js +4 -4
  12. package/lib/es/BasicLayout/index.js +6 -6
  13. package/lib/es/Error403/index.js +3 -3
  14. package/lib/es/Error404/index.js +3 -3
  15. package/lib/es/ExcelForm/index.js +18 -18
  16. package/lib/es/MenuLayout/index.js +9 -9
  17. package/lib/es/TemplateFile/index.js +6 -6
  18. package/lib/es/UploadForm/index.js +11 -11
  19. package/lib/locales/default.en-US.d.ts +363 -0
  20. package/lib/webui.css +1 -1
  21. package/lib/webui.es.js +15 -15
  22. package/package.json +1 -1
  23. package/src/locales/default.en-US.ts +369 -0
  24. package/src/locales/en-US.json +44 -6
  25. package/src/locales/index.ts +14 -28
  26. package/src/utils/form-excel.ts +1 -1
  27. package/lib/src/components/content/toolpanel/index.vue.d.ts +0 -15
  28. package/lib/src/components/form/autoComplete/index.vue.d.ts +0 -111
  29. package/lib/src/components/form/autoComplete/index.vue.js +0 -156
  30. package/lib/src/components/form/autoComplete/index.vue.js.map +0 -1
  31. package/lib/src/components/form/cascader/index.vue.d.ts +0 -91
  32. package/lib/src/components/form/input/index.vue.d.ts +0 -29
  33. package/lib/src/components/form/radio/index.vue.d.ts +0 -115
  34. package/lib/src/components/form/select/index.vue.d.ts +0 -130
  35. package/lib/src/components/form/switch/index.vue.d.ts +0 -96
  36. package/lib/src/components/form/transfer/index.vue.d.ts +0 -33
  37. package/lib/src/components/form/treeSelect/index.vue.d.ts +0 -48
  38. package/lib/src/components/form/upload/uploadList.vue.d.ts +0 -42
  39. package/lib/src/components/form/upload/uploadList.vue.js +0 -713
  40. package/lib/src/components/form/upload/uploadList.vue.js.map +0 -1
  41. /package/lib/locales/{default.d.ts → default.zh-CN.d.ts} +0 -0
  42. /package/src/locales/{default.ts → default.zh-CN.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyfox2000/webui",
3
- "version": "1.6.8",
3
+ "version": "1.6.10",
4
4
  "description": "后台前端通用组件定义, 支持国际化",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -0,0 +1,369 @@
1
+ export const defaultEnLocale = {
2
+ "webui": {
3
+ "common": {
4
+ "confirm": "Confirm",
5
+ "cancel": "Cancel",
6
+ "yes": "Yes",
7
+ "no": "No",
8
+
9
+ "save": "Save",
10
+ "saveAs": "Save As",
11
+ "delete": "Delete",
12
+ "edit": "Edit",
13
+ "add": "Add",
14
+ "upload": "Upload",
15
+ "download": "Download",
16
+ "preview": "Preview",
17
+ "choose": "Choose",
18
+ "placeholder": "Please enter {0}",
19
+ "pleaseSelect": "Please select",
20
+ "pleaseInput": "Please input",
21
+ "all": "All",
22
+ "success": "Success",
23
+ "failed": "Failed",
24
+ "enable": "Enable",
25
+ "disable": "Disable",
26
+ "close": "Close",
27
+ "male": "Male",
28
+ "female": "Female",
29
+ "online": "Online",
30
+ "offline": "Offline",
31
+ "onlineStatus": "Online",
32
+ "offlineStatus": "Offline",
33
+ "refresh": "Refresh",
34
+ "search": "Search",
35
+ "export": "Export",
36
+ "file": "File",
37
+ "total": "Total {0} records",
38
+ "reset": "Reset",
39
+ "more": "More",
40
+ "moreActions": "More Actions",
41
+ "uploadSave": "Upload & Save",
42
+ "dataLoading": "Loading data..."
43
+ },
44
+
45
+ "components": {
46
+ "common": {
47
+ "button": {
48
+ "tooltip": "Tooltip Title"
49
+ },
50
+ "icon": {
51
+ "question": "Question",
52
+ "help": "Help"
53
+ },
54
+ "loading": {
55
+ "loading": "Loading"
56
+ },
57
+ "alert": {
58
+ "info": "Info",
59
+ "warning": "Warning",
60
+ "error": "Error"
61
+ }
62
+ },
63
+ "content": {
64
+ "dialog": {
65
+ "fileUpload": "File Upload",
66
+ "templateFileManager": "Template File Manager",
67
+ "close": "Close",
68
+ "uploadFile": "Upload File",
69
+ "chooseExcelFile": "Please select Excel file",
70
+ "chooseCsvFile": "Please select CSV file",
71
+ "chooseExcelOrCsvFile": "Please select Excel or CSV file",
72
+ "noValidationRules": "No validation rules set",
73
+ "fieldMustBeUnique": "The following {0} must be unique",
74
+ "combinationMustBeUnique": "The following combination must be unique",
75
+ "validationRules": "Data validation rules to check",
76
+ "duplicateData": "Duplicate data to validate",
77
+ "validationException": "Validation exception",
78
+ "exportFailed": "Export failed"
79
+ },
80
+
81
+ "excelForm": {
82
+ "uploadAddressNotConfigured": "File upload address not configured!",
83
+ "validationError": "Table data has validation errors, please correct before uploading!",
84
+ "pleaseSelectFileFirst": "Please select a file first!",
85
+ "fileUploadSuccess": "File uploaded successfully, starting business processing!",
86
+ "uploadFailed": "Upload processing failed:",
87
+ "unknownError": "Unknown error",
88
+ "onlyExcelAllowed": "Only Excel files can be uploaded!",
89
+ "onlyCsvAllowed": "Only CSV files can be uploaded!",
90
+ "onlyExcelOrCsvAllowed": "Only Excel or CSV files can be uploaded!",
91
+ "csvProcessingFailed": "CSV file processing failed",
92
+ "gridCtrlNotConfigured": "Grid controller not configured!",
93
+ "fileProcessingFailed": "File processing failed, please check file format!",
94
+ "loadFileFailed": "Failed to load file, please check file format!",
95
+ "fileProcessingError": "File processing error",
96
+ "dataSaveFailed": "Data save failed, please try again later!"
97
+ },
98
+
99
+ "listOperate": {
100
+ "confirmDelete": "Are you sure to delete this record?",
101
+ "more": "More"
102
+ },
103
+ "table": {
104
+ "confirmDelete": "Are you sure to delete this record?"
105
+ },
106
+ "toolpanel": {
107
+ "tool": "Tools",
108
+ "searchResult": "Search Results",
109
+ "list": "List",
110
+ "grid": "Grid",
111
+ "listView": "List View",
112
+ "gridView": "Grid View",
113
+ "expand": "Expand",
114
+ "collapse": "Collapse",
115
+ "expandPanel": "Expand Panel",
116
+ "collapsePanel": "Collapse Panel",
117
+ "searchPlaceholder": "Search tools..."
118
+ },
119
+ "formItem": {
120
+ "validationRuleNotFound": "Validation rule not found for field '{label}': {rule}"
121
+ },
122
+ "searchItem": {
123
+ "validationRuleNotFound": "Validation rule not found for field '{label}': {rule}"
124
+ }
125
+ },
126
+ "error": {
127
+ "forbidden": "Sorry, you don't have permission to access this page",
128
+ "pageNotFound": "Sorry, the page you visited does not exist",
129
+ "clickReturn": "Click to return"
130
+ },
131
+ "layout": {
132
+ "header": {
133
+ "exitPlatform": "Exit Platform",
134
+ "exitSystem": "Exit System",
135
+ "confirmExit": "Confirm Exit",
136
+ "exitConfirmMessage": "Are you sure you want to exit the system?"
137
+ },
138
+ "breadcrumb": {
139
+ "home": "Home"
140
+ }
141
+ },
142
+ "form": {
143
+ "upload": {
144
+ "selectFile": "Select File",
145
+ "selectDirectory": "Select Directory",
146
+ "uploading": "Uploading",
147
+ "uploadComplete": "Upload Complete",
148
+ "uploadFailed": "Upload Failed",
149
+ "pendingUpload": "Pending Upload",
150
+ "onlineOrOffline": "Online or Offline",
151
+ "deleteConfirm": "Are you sure to delete this file?",
152
+ "deleteSuccess": "File deleted successfully!",
153
+ "fileSizeExceeded": "File size exceeds {0}MB limit",
154
+ "maxFileCount": "Maximum {0} files can be uploaded",
155
+ "fileTypeRequired": "File must be {0}",
156
+ "maxFileSize": "Maximum file size {0}MB",
157
+ "maxFileCountMsg": "Maximum {0} files",
158
+ "dataLoading": "Loading data...",
159
+ "loadImageFailed": "Failed to load image:",
160
+ "unsupportedFileType": "Unsupported file type",
161
+ "fileSizeExceedsLimit": "File size exceeds {0}MB limit",
162
+ "maxFilesReached": "Maximum {0} files can be uploaded",
163
+ "onlineOffline": "Online or Offline",
164
+ "chooseFile": "Choose File",
165
+ "chooseDirectory": "Choose Directory",
166
+ "confirmDeleteFile": "Are you sure to delete this file?",
167
+ "fileMustBe": "File must be {0}",
168
+ "singleFileMax": "Maximum single file size {0}MB",
169
+ "maxFiles": "Maximum {0} files",
170
+ "pleaseSelectFile": "Please select a file to upload!",
171
+ "allUploadSuccess": "All files uploaded successfully!",
172
+ "partialUploadFailed": "Upload completed, some files failed to upload!",
173
+ "saveUploadSuccess": "Save successfully uploaded files!",
174
+ "partialUploadFailedCancel": "Upload completed, some files failed to upload, save cancelled!",
175
+ "allUploadFailed": "Upload completed, all files failed to upload!",
176
+ "uploadFailedError": "Upload failed",
177
+ "uploadingStatus": "Uploading",
178
+ "unauthorized": "Unauthorized or authorization expired",
179
+ "invalidJson": "Returned result is not in JSON format",
180
+ "uploadSuccessStatus": "Upload successful",
181
+ "parseJsonError": "Unable to parse returned JSON data",
182
+ "uploadFailedStatusCode": "Upload failed, status code:",
183
+ "uploadFailedNetwork": "Upload failed, network error",
184
+ "uploadCanceled": "Upload cancelled",
185
+ "fileUploadSuccess": "File uploaded successfully!",
186
+ "fileUploadFailed": "File upload failed!",
187
+ "preview": "Preview",
188
+ "delete": "Delete"
189
+ },
190
+ "select": {
191
+ "pleaseSelect": "Please select {0}",
192
+ "noData": "No data"
193
+ },
194
+ "aceEditor": {
195
+ "title": "Code Editor",
196
+ "loading": "Loading editor..."
197
+ },
198
+ "checkbox": {
199
+ "loading": "Loading data..."
200
+ },
201
+ "cascader": {
202
+ "loading": "Loading data...",
203
+ "pleaseSelect": "Please select {0}"
204
+ },
205
+ "datePicker": {
206
+ "pleaseSelect": "Please select {0}"
207
+ },
208
+ "treeSelect": {
209
+ "pleaseSelect": "Please select {0}"
210
+ },
211
+ "switch": {
212
+ "error": "Switch component must have exactly two options"
213
+ },
214
+ "radio": {
215
+ "noData": "No data",
216
+ "all": "All"
217
+ },
218
+ "autoComplete": {
219
+ "pleaseInputAndSelect": "{0} and select"
220
+ },
221
+ "propEditor": {
222
+ "configName": "Config Name",
223
+ "configValue": "Please enter config value",
224
+ "inputConfigValue": "Please enter {0}",
225
+ "addConfigRow": "Add Config Row"
226
+ },
227
+ "transfer": {
228
+ "pleaseInput": "Please enter {0}",
229
+ "noData": "No data"
230
+ },
231
+ "input": {
232
+ "pleaseInput": "Please enter {0}"
233
+ }
234
+ }
235
+ },
236
+
237
+ "stores": {
238
+ "userInfo": {
239
+ "tokenParseFailed": "Token parsing failed",
240
+ "exiting": "Exiting...",
241
+ "logoutSuccess": "Logged out successfully",
242
+ "authInfoFailed": "Failed to get authorization info",
243
+ "userInfoParseFailed": "User info parsing failed"
244
+ },
245
+ "hostInfo": {
246
+ "loading": "Loading site configuration..."
247
+ },
248
+ "appInfo": {
249
+ "loadAppListFailed": "Failed to load application list"
250
+ }
251
+ },
252
+
253
+ "utils": {
254
+ "exportTable": {
255
+ "exportFailed": "Export failed",
256
+ "fileExportFailed": "File export failed, please try again later"
257
+ },
258
+ "formValidate": {
259
+ "required": "Cannot be empty",
260
+ "numberType": "Must be a number",
261
+ "enum": "Must be one of {enum}",
262
+ "stringLen": "Length must be {len}",
263
+ "stringMin": "Length cannot be less than {min}",
264
+ "stringMax": "Length cannot be greater than {max}",
265
+ "stringRange": "Length must be between {min} and {max}",
266
+ "numberLen": "Must be {len}",
267
+ "numberMin": "Cannot be less than {min}",
268
+ "numberMax": "Cannot be greater than {max}",
269
+ "numberRange": "Must be between {min} and {max}",
270
+ "arrayLen": "Length must be {len}",
271
+ "arrayMin": "Length cannot be less than {min}",
272
+ "arrayMax": "Length cannot be greater than {max}",
273
+ "arrayRange": "Length must be between {min} and {max}",
274
+ "formatValidationError": "Error formatting validation message",
275
+ "processValidationError": "Error processing validation rules"
276
+ },
277
+ "fileUpload": {
278
+ "pleaseSelectFile": "Please select a file to upload!",
279
+ "allUploadSuccess": "All files uploaded successfully!",
280
+ "partialUploadFailed": "Upload completed, some files failed to upload!",
281
+ "saveUploadSuccess": "Save successfully uploaded files!",
282
+ "partialUploadFailedCancel": "Upload completed, some files failed to upload, save cancelled!",
283
+ "allUploadFailed": "Upload completed, all files failed to upload!",
284
+ "fileUploadSuccess": "File uploaded successfully!",
285
+ "fileUploadFailed": "File upload failed!",
286
+ "unauthorized": "Unauthorized or authorization expired",
287
+ "invalidJsonFormat": "Returned result is not in JSON format",
288
+ "jsonParseError": "Unable to parse returned JSON data",
289
+ "uploadFailed": "Upload failed, status code: ",
290
+ "networkError": "Upload failed, network error",
291
+ "uploadCancelled": "Upload cancelled"
292
+ },
293
+ "data": {
294
+ "executeSuccess": "Execution successful!",
295
+ "noDataToSave": "Error! No data to save!",
296
+ "saveSuccess": "Save successful!",
297
+ "conditionalDeleteForbidden": "Error! Unconditional data deletion is forbidden!",
298
+ "deleteSuccess": "Delete successful!",
299
+ "urlNotSet": "URL not set: {urlKey}"
300
+ },
301
+ "download": {
302
+ "downloadFailed": "File download failed!",
303
+ "fileDownloadFailed": "File download failed, please try again later",
304
+ "fileTypeNotSupported": "File type not supported for preview",
305
+ "filePreviewFailed": "File preview failed!"
306
+ },
307
+ "formExcel": {
308
+ "excelNoSheets": "Excel file does not contain worksheets",
309
+ "excelInsufficientData": "Excel file does not contain enough data",
310
+ "validationError": "Error occurred while validating table data",
311
+ "missingDuplicateFields": "Table header missing fields required for duplicate detection",
312
+ "fileNotExcel": "Uploaded file is not an Excel file",
313
+ "processFailed": "Excel file processing failed",
314
+ "validationSuccess": "Data validation successful",
315
+ "duplicateValidationPending": "Duplicate data to validate",
316
+ "validationFailed": "Data validation failed",
317
+ "validationPassed": "Data validation passed",
318
+ "duplicateDetected": "Duplicate data detected",
319
+ "duplicateCheckPassed": "Duplicate check passed"
320
+ },
321
+ "options": {
322
+ "notConfigured": "Options data not configured!",
323
+ "outFieldsFormatError": "outFields format error: {sourceKey}, must be ${index} or ${index}.${key}"
324
+ },
325
+ "form": {
326
+ "submitValidationFailed": "Validation failed when submitting form!",
327
+ "saveSuccess": "Save successful!",
328
+ "dataAlreadyExists": "Save failed! Data `{0}` already exists!",
329
+ "dataDuplicate": "Data duplicate",
330
+ "saveFailed": "Save failed"
331
+ },
332
+ "excelPreview": {
333
+ "previewUrlNotConfigured": "Preview URL or Excel controller not configured",
334
+ "fileLoadFailed": "File load failed"
335
+ },
336
+ "tools": {
337
+ "noClickHandler": "Click handler not configured!",
338
+ "refreshTable": "Refresh Table",
339
+ "expandSearch": "Expand Search Bar",
340
+ "collapseSearch": "Collapse Search Bar",
341
+ "rowHeight": "Adjust Row Height",
342
+ "templateManagement": "Template",
343
+ "showCheckbox": "Show Checkbox",
344
+ "hideCheckbox": "Hide Checkbox",
345
+ "expandRows": "Expand Rows",
346
+ "collapseRows": "Collapse Rows",
347
+ "exportExcel": "Export Excel",
348
+ "exportAllRecords": "All Records",
349
+ "exportSelectedRecords": "Selected Records",
350
+ "exportPDF": "Export PDF",
351
+ "tableHeaderSettings": "Table Header Settings",
352
+ "setFullscreen": "Set Fullscreen",
353
+ "exitFullscreen": "Exit Fullscreen"
354
+ },
355
+ "iconLoader": {
356
+ "networkError": "Network error, unable to load icon library!"
357
+ },
358
+ "formCsv": {
359
+ "csvToExcelFailed": "CSV to Excel conversion failed",
360
+ "csvProcessFailed": "CSV file processing failed",
361
+ "unknownError": "Unknown error"
362
+ },
363
+ "microOpenapis": {
364
+ "interfaceNotConfigured": "{method} interface not configured!",
365
+ "apiCallTimeout": "API call timeout: {method}"
366
+ }
367
+ }
368
+ }
369
+ };
@@ -38,7 +38,8 @@
38
38
  "reset": "Reset",
39
39
  "more": "More",
40
40
  "moreActions": "More Actions",
41
- "uploadSave": "Upload & Save"
41
+ "uploadSave": "Upload & Save",
42
+ "dataLoading": "Loading data..."
42
43
  },
43
44
 
44
45
  "components": {
@@ -114,6 +115,12 @@
114
115
  "expandPanel": "Expand Panel",
115
116
  "collapsePanel": "Collapse Panel",
116
117
  "searchPlaceholder": "Search tools..."
118
+ },
119
+ "formItem": {
120
+ "validationRuleNotFound": "Validation rule not found for field '{label}': {rule}"
121
+ },
122
+ "searchItem": {
123
+ "validationRuleNotFound": "Validation rule not found for field '{label}': {rule}"
117
124
  }
118
125
  },
119
126
  "error": {
@@ -127,6 +134,9 @@
127
134
  "exitSystem": "Exit System",
128
135
  "confirmExit": "Confirm Exit",
129
136
  "exitConfirmMessage": "Are you sure you want to exit the system?"
137
+ },
138
+ "breadcrumb": {
139
+ "home": "Home"
130
140
  }
131
141
  },
132
142
  "form": {
@@ -173,14 +183,30 @@
173
183
  "uploadFailedNetwork": "Upload failed, network error",
174
184
  "uploadCanceled": "Upload cancelled",
175
185
  "fileUploadSuccess": "File uploaded successfully!",
176
- "fileUploadFailed": "File upload failed!"
186
+ "fileUploadFailed": "File upload failed!",
187
+ "preview": "Preview",
188
+ "delete": "Delete"
177
189
  },
178
190
  "select": {
179
191
  "pleaseSelect": "Please select {0}",
180
192
  "noData": "No data"
181
193
  },
182
194
  "aceEditor": {
183
- "title": "Code Editor"
195
+ "title": "Code Editor",
196
+ "loading": "Loading editor..."
197
+ },
198
+ "checkbox": {
199
+ "loading": "Loading data..."
200
+ },
201
+ "cascader": {
202
+ "loading": "Loading data...",
203
+ "pleaseSelect": "Please select {0}"
204
+ },
205
+ "datePicker": {
206
+ "pleaseSelect": "Please select {0}"
207
+ },
208
+ "treeSelect": {
209
+ "pleaseSelect": "Please select {0}"
184
210
  },
185
211
  "switch": {
186
212
  "error": "Switch component must have exactly two options"
@@ -195,9 +221,14 @@
195
221
  "propEditor": {
196
222
  "configName": "Config Name",
197
223
  "configValue": "Please enter config value",
198
- "inputConfigValue": "Please enter {0}"
224
+ "inputConfigValue": "Please enter {0}",
225
+ "addConfigRow": "Add Config Row"
199
226
  },
200
227
  "transfer": {
228
+ "pleaseInput": "Please enter {0}",
229
+ "noData": "No data"
230
+ },
231
+ "input": {
201
232
  "pleaseInput": "Please enter {0}"
202
233
  }
203
234
  }
@@ -251,7 +282,13 @@
251
282
  "partialUploadFailedCancel": "Upload completed, some files failed to upload, save cancelled!",
252
283
  "allUploadFailed": "Upload completed, all files failed to upload!",
253
284
  "fileUploadSuccess": "File uploaded successfully!",
254
- "fileUploadFailed": "File upload failed!"
285
+ "fileUploadFailed": "File upload failed!",
286
+ "unauthorized": "Unauthorized or authorization expired",
287
+ "invalidJsonFormat": "Returned result is not in JSON format",
288
+ "jsonParseError": "Unable to parse returned JSON data",
289
+ "uploadFailed": "Upload failed, status code: ",
290
+ "networkError": "Upload failed, network error",
291
+ "uploadCancelled": "Upload cancelled"
255
292
  },
256
293
  "data": {
257
294
  "executeSuccess": "Execution successful!",
@@ -289,7 +326,8 @@
289
326
  "submitValidationFailed": "Validation failed when submitting form!",
290
327
  "saveSuccess": "Save successful!",
291
328
  "dataAlreadyExists": "Save failed! Data `{0}` already exists!",
292
- "saveFailed": "Save failed!"
329
+ "dataDuplicate": "Data duplicate",
330
+ "saveFailed": "Save failed"
293
331
  },
294
332
  "excelPreview": {
295
333
  "previewUrlNotConfigured": "Preview URL or Excel controller not configured",
@@ -1,5 +1,12 @@
1
1
  import { createI18n } from "vue-i18n";
2
- import { defaultLocale } from "./default";
2
+ import { defaultLocale as defaultZhLocale } from "./default.zh-CN";
3
+ import { defaultEnLocale } from "./default.en-US";
4
+
5
+ // 内置语言包映射
6
+ const builtInLocales: Record<string, any> = {
7
+ "zh-CN": defaultZhLocale,
8
+ "en-US": defaultEnLocale,
9
+ };
3
10
 
4
11
  // 定义语言包类型
5
12
  export interface LocaleMessages {
@@ -67,7 +74,6 @@ function getStoredLocale(): string {
67
74
  export const i18n = createI18n({
68
75
  legacy: false, // 使用Composition API模式
69
76
  locale: getStoredLocale(), // 从localStorage获取语言设置
70
- fallbackLocale: "en-US", // 回退语言
71
77
  messages: loadedMessages,
72
78
  silentTranslationWarn: true, // 禁用翻译警告
73
79
  fallbackWarn: false, // 禁用回退警告
@@ -241,8 +247,9 @@ function deepClone<T>(obj: T): T {
241
247
  * 确保异步加载完成后再继续执行
242
248
  */
243
249
  async function loadLocale(locale: string): Promise<void> {
244
- // 1. 首先加载defaultLocale作为基础
245
- const baseMessages = deepClone(defaultLocale);
250
+ // 1. 首先加载对应语言的内置翻译作为基础
251
+ const builtInLocale = builtInLocales[locale] || builtInLocales["zh-CN"];
252
+ const baseMessages = deepClone(builtInLocale);
246
253
 
247
254
  // 2. 获取本地缓存(如果有)
248
255
  const cachedMessages = getCachedLocale(locale);
@@ -342,35 +349,14 @@ export function getAvailableLanguages(): Array<{ label: string; key: string }> {
342
349
  }));
343
350
  }
344
351
 
345
- // 翻译函数 - 优化回退逻辑
352
+ // 翻译函数 - 无回退,缺失时直接返回key
346
353
  export function $t(key: string, params?: Record<string, any>): string {
347
354
  try {
348
355
  // @ts-ignore
349
356
  const result = i18n.global.t(key, params);
350
- // 如果返回的是翻译键本身,说明没有找到翻译
357
+ // 如果返回的是翻译键本身,说明没有找到翻译,直接返回key
351
358
  if (result === key) {
352
-
353
-
354
- // 检查当前messages是否为空
355
- const currentMessages = i18n.global.getLocaleMessage(i18n.global.locale.value);
356
- const isMessagesEmpty = !currentMessages || Object.keys(currentMessages).length === 0;
357
-
358
- if (isMessagesEmpty) {
359
- // 从localStorage缓存获取翻译内容
360
- const cachedMessages = getCachedLocale(i18n.global.locale.value);
361
- if (cachedMessages) {
362
- // 使用缓存恢复整个语言包
363
- const updatedMessages = deepMerge({}, cachedMessages);
364
- i18n.global.setLocaleMessage(i18n.global.locale.value, updatedMessages);
365
- cacheLocale(i18n.global.locale.value, updatedMessages);
366
-
367
-
368
-
369
- // 重新获取翻译
370
- const retryResult = i18n.global.t(key, params || {});
371
- return retryResult === key ? key : retryResult;
372
- }
373
- }
359
+ return key;
374
360
  }
375
361
  return result;
376
362
  } catch (error) {
@@ -273,7 +273,7 @@ export const checkExcelDuplicates = async (
273
273
  } else if (result?.errno == LoginExpiredError) {
274
274
  const userInfoStore = useUserInfo();
275
275
  userInfoStore.logout(false);
276
- throw new Error('登录已过期');
276
+ throw new Error('Login expired');
277
277
  } else {
278
278
  throw new Error(result?.msg);
279
279
  }
@@ -1,15 +0,0 @@
1
- import type { ToolPanelProps } from './types';
2
- declare const __VLS_export: import("vue").DefineComponent<ToolPanelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToolPanelProps> & Readonly<{}>, {
3
- showSearch: boolean;
4
- width: {
5
- expanded: string;
6
- collapsed: string;
7
- };
8
- mode: import("@/components/").DisplayMode;
9
- collapsed: import("@/components/").PanelCollapsed;
10
- allowGroupCollapse: boolean;
11
- rowCount: number;
12
- showModeToggle: boolean;
13
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
- declare const _default: typeof __VLS_export;
15
- export default _default;