@skyfox2000/webui 1.5.4 → 1.5.9

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 (64) hide show
  1. package/lib/assets/modules/{baseLayout-BEy-FjcZ.js → baseLayout-DfTxHOFc.js} +7 -7
  2. package/lib/assets/modules/file-upload-DTOdV5vM.js +211 -0
  3. package/lib/assets/modules/{index-BTD6d1d_.js → index-BwMaOrJT.js} +1 -1
  4. package/lib/assets/modules/{index-DyE2ppxB.js → index-DUBY49Au.js} +27 -27
  5. package/lib/assets/modules/{index-BFxnKhwl.js → index-M1qERbea.js} +99 -99
  6. package/lib/assets/modules/{menuTabs-DUBWuf7t.js → menuTabs-DWaBSRNr.js} +42 -42
  7. package/lib/assets/modules/{toolIcon-DQLIuud3.js → toolIcon-BYnHhAy-.js} +1 -1
  8. package/lib/assets/modules/upload-template-BKm9mFq8.js +6764 -0
  9. package/lib/assets/modules/uploadList-CHvr6Hp1.js +472 -0
  10. package/lib/es/AceEditor/index.js +3 -3
  11. package/lib/es/BasicLayout/index.js +2 -2
  12. package/lib/es/Error403/index.js +14 -15
  13. package/lib/es/Error404/index.js +16 -17
  14. package/lib/es/ExcelForm/index.js +244 -244
  15. package/lib/es/MenuLayout/index.js +5 -5
  16. package/lib/es/TemplateFile/index.js +53 -54
  17. package/lib/es/UploadForm/index.js +61 -63
  18. package/lib/locales/default.d.ts +287 -103
  19. package/lib/webui.css +1 -1
  20. package/lib/webui.es.js +1476 -1622
  21. package/package.json +1 -1
  22. package/src/components/common/icon/fullscreen.vue +1 -1
  23. package/src/components/content/dialog/excelForm.vue +32 -28
  24. package/src/components/content/dialog/index.vue +4 -3
  25. package/src/components/content/dialog/templateFile.vue +3 -2
  26. package/src/components/content/dialog/uploadForm.vue +5 -4
  27. package/src/components/content/drawer/index.vue +5 -3
  28. package/src/components/content/list/index.vue +2 -1
  29. package/src/components/content/list/listOperate.vue +6 -7
  30. package/src/components/content/search/index.vue +3 -2
  31. package/src/components/content/table/index.vue +2 -1
  32. package/src/components/content/table/tableOperate.vue +8 -9
  33. package/src/components/content/toolbar/icontool.vue +1 -5
  34. package/src/components/content/toolbar/index.vue +4 -5
  35. package/src/components/content/toolpanel/index.vue +20 -20
  36. package/src/components/error/error403.vue +2 -2
  37. package/src/components/error/error404.vue +2 -2
  38. package/src/components/form/input/index.vue +3 -1
  39. package/src/components/form/select/index.vue +3 -2
  40. package/src/components/form/textarea/index.vue +3 -1
  41. package/src/components/form/transfer/index.vue +2 -1
  42. package/src/components/form/upload/uploadList.vue +23 -19
  43. package/src/components/layout/header/headerExits.vue +5 -5
  44. package/src/components/layout/menu/menuTabs.vue +1 -1
  45. package/src/const/options.ts +17 -16
  46. package/src/locales/default.ts +297 -176
  47. package/src/locales/en-US.json +320 -0
  48. package/src/stores/appInfo.ts +2 -1
  49. package/src/stores/userInfo.ts +6 -5
  50. package/src/utils/data.ts +9 -8
  51. package/src/utils/download.ts +5 -4
  52. package/src/utils/excel-preview.ts +4 -3
  53. package/src/utils/export-table.ts +7 -6
  54. package/src/utils/file-upload.ts +15 -14
  55. package/src/utils/form-csv.ts +4 -3
  56. package/src/utils/form-excel.ts +14 -13
  57. package/src/utils/form-validate.ts +18 -17
  58. package/src/utils/form.ts +6 -5
  59. package/src/utils/icon-loader.ts +3 -2
  60. package/src/utils/options.ts +2 -1
  61. package/src/utils/tools.ts +18 -17
  62. package/lib/assets/modules/file-upload-_mcZy7EK.js +0 -211
  63. package/lib/assets/modules/upload-template-DZuy1BOF.js +0 -6465
  64. package/lib/assets/modules/uploadList-CCquj3c_.js +0 -466
@@ -0,0 +1,320 @@
1
+ {
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
+ "male": "Male",
27
+ "female": "Female",
28
+ "online": "Online",
29
+ "offline": "Offline",
30
+ "onlineStatus": "Online",
31
+ "offlineStatus": "Offline",
32
+ "refresh": "Refresh",
33
+ "search": "Search",
34
+ "export": "Export",
35
+ "file": "File",
36
+ "total": "Total {0} records",
37
+ "reset": "Reset",
38
+ "more": "More",
39
+ "moreActions": "More Actions",
40
+ "uploadSave": "Upload & Save"
41
+ },
42
+
43
+ "components": {
44
+ "common": {
45
+ "button": {
46
+ "tooltip": "Tooltip Title"
47
+ },
48
+ "icon": {
49
+ "question": "Question",
50
+ "help": "Help"
51
+ },
52
+ "loading": {
53
+ "loading": "Loading"
54
+ },
55
+ "alert": {
56
+ "info": "Info",
57
+ "warning": "Warning",
58
+ "error": "Error"
59
+ }
60
+ },
61
+ "content": {
62
+ "dialog": {
63
+ "fileUpload": "File Upload",
64
+ "templateFileManager": "Template File Manager",
65
+ "close": "Close",
66
+ "uploadFile": "Upload File",
67
+ "chooseExcelFile": "Please select Excel file",
68
+ "chooseCsvFile": "Please select CSV file",
69
+ "chooseExcelOrCsvFile": "Please select Excel or CSV file",
70
+ "noValidationRules": "No validation rules set",
71
+ "fieldMustBeUnique": "The following {0} must be unique",
72
+ "combinationMustBeUnique": "The following combination must be unique",
73
+ "validationRules": "Data validation rules to check",
74
+ "duplicateData": "Duplicate data to validate",
75
+ "validationException": "Validation exception",
76
+ "batchImportUser": "Batch Import Users"
77
+ },
78
+
79
+ "excelForm": {
80
+ "uploadAddressNotConfigured": "File upload address not configured!",
81
+ "validationError": "Table data has validation errors, please correct before uploading!",
82
+ "pleaseSelectFileFirst": "Please select a file first!",
83
+ "fileUploadSuccess": "File uploaded successfully, starting business processing!",
84
+ "uploadFailed": "Upload processing failed:",
85
+ "unknownError": "Unknown error",
86
+ "onlyExcelAllowed": "Only Excel files can be uploaded!",
87
+ "onlyCsvAllowed": "Only CSV files can be uploaded!",
88
+ "onlyExcelOrCsvAllowed": "Only Excel or CSV files can be uploaded!",
89
+ "csvProcessingFailed": "CSV file processing failed",
90
+ "gridCtrlNotConfigured": "Grid controller not configured!",
91
+ "fileProcessingFailed": "File processing failed, please check file format!",
92
+ "loadFileFailed": "Failed to load file, please check file format!",
93
+ "fileProcessingError": "File processing error",
94
+ "dataSaveFailed": "Data save failed, please try again later!"
95
+ },
96
+
97
+ "listOperate": {
98
+ "confirmDelete": "Are you sure to delete this record?",
99
+ "more": "More"
100
+ },
101
+ "toolpanel": {
102
+ "tool": "Tools",
103
+ "searchResult": "Search Results",
104
+ "list": "List",
105
+ "grid": "Grid",
106
+ "listView": "List View",
107
+ "gridView": "Grid View",
108
+ "expand": "Expand",
109
+ "collapse": "Collapse",
110
+ "expandPanel": "Expand Panel",
111
+ "collapsePanel": "Collapse Panel",
112
+ "searchPlaceholder": "Search tools..."
113
+ }
114
+ },
115
+ "error": {
116
+ "forbidden": "Sorry, you don't have permission to access this page",
117
+ "pageNotFound": "Sorry, the page you visited does not exist",
118
+ "clickReturn": "Click to return"
119
+ },
120
+ "layout": {
121
+ "header": {
122
+ "exitPlatform": "Exit Platform",
123
+ "exitSystem": "Exit System",
124
+ "confirmExit": "Confirm Exit",
125
+ "exitConfirmMessage": "Are you sure you want to exit the system?"
126
+ }
127
+ },
128
+ "form": {
129
+ "upload": {
130
+ "selectFile": "Select File",
131
+ "selectDirectory": "Select Directory",
132
+ "uploading": "Uploading",
133
+ "uploadComplete": "Upload Complete",
134
+ "uploadFailed": "Upload Failed",
135
+ "pendingUpload": "Pending Upload",
136
+ "onlineOrOffline": "Online or Offline",
137
+ "deleteConfirm": "Are you sure to delete this file?",
138
+ "deleteSuccess": "File deleted successfully!",
139
+ "fileSizeExceeded": "File size exceeds {0}MB limit",
140
+ "maxFileCount": "Maximum {0} files can be uploaded",
141
+ "fileTypeRequired": "File must be {0}",
142
+ "maxFileSize": "Maximum file size {0}MB",
143
+ "maxFileCountMsg": "Maximum {0} files",
144
+ "dataLoading": "Loading data...",
145
+ "loadImageFailed": "Failed to load image:",
146
+ "unsupportedFileType": "Unsupported file type",
147
+ "fileSizeExceedsLimit": "File size exceeds {0}MB limit",
148
+ "maxFilesReached": "Maximum {0} files can be uploaded",
149
+ "onlineOffline": "Online or Offline",
150
+ "chooseFile": "Choose File",
151
+ "chooseDirectory": "Choose Directory",
152
+ "confirmDeleteFile": "Are you sure to delete this file?",
153
+ "fileMustBe": "File must be {0}",
154
+ "singleFileMax": "Maximum single file size {0}MB",
155
+ "maxFiles": "Maximum {0} files",
156
+ "pleaseSelectFile": "Please select a file to upload!",
157
+ "allUploadSuccess": "All files uploaded successfully!",
158
+ "partialUploadFailed": "Upload completed, some files failed to upload!",
159
+ "saveUploadSuccess": "Save successfully uploaded files!",
160
+ "partialUploadFailedCancel": "Upload completed, some files failed to upload, save cancelled!",
161
+ "allUploadFailed": "Upload completed, all files failed to upload!",
162
+ "uploadFailedError": "Upload failed",
163
+ "uploadingStatus": "Uploading",
164
+ "unauthorized": "Unauthorized or authorization expired",
165
+ "invalidJson": "Returned result is not in JSON format",
166
+ "uploadSuccessStatus": "Upload successful",
167
+ "parseJsonError": "Unable to parse returned JSON data",
168
+ "uploadFailedStatusCode": "Upload failed, status code:",
169
+ "uploadFailedNetwork": "Upload failed, network error",
170
+ "uploadCanceled": "Upload cancelled",
171
+ "fileUploadSuccess": "File uploaded successfully!",
172
+ "fileUploadFailed": "File upload failed!"
173
+ },
174
+ "select": {
175
+ "pleaseSelect": "Please select {0}",
176
+ "noData": "No data"
177
+ },
178
+ "aceEditor": {
179
+ "title": "Code Editor"
180
+ },
181
+ "switch": {
182
+ "error": "Switch component must have exactly two options"
183
+ },
184
+ "radioStatus": {
185
+ "all": "All"
186
+ },
187
+ "radio": {
188
+ "noData": "No data",
189
+ "all": "All"
190
+ },
191
+ "autoComplete": {
192
+ "pleaseInputAndSelect": "{0} and select"
193
+ },
194
+ "propEditor": {
195
+ "configName": "Config Name",
196
+ "configValue": "Please enter config value",
197
+ "inputConfigValue": "Please enter {0}"
198
+ },
199
+ "transfer": {
200
+ "pleaseInput": "Please enter {0}"
201
+ }
202
+ }
203
+ },
204
+
205
+ "stores": {
206
+ "userInfo": {
207
+ "tokenParseFailed": "Token parsing failed",
208
+ "exiting": "Exiting...",
209
+ "logoutSuccess": "Logged out successfully",
210
+ "authInfoFailed": "Failed to get authorization info",
211
+ "userInfoParseFailed": "User info parsing failed"
212
+ },
213
+ "appInfo": {
214
+ "loadAppListFailed": "Failed to load application list"
215
+ }
216
+ },
217
+
218
+ "utils": {
219
+ "exportTable": {
220
+ "exportFailed": "Export failed",
221
+ "fileExportFailed": "File export failed, please try again later"
222
+ },
223
+ "formValidate": {
224
+ "required": "Cannot be empty",
225
+ "numberType": "Must be a number",
226
+ "enum": "Must be one of {enum}",
227
+ "stringLen": "Length must be {len}",
228
+ "stringMin": "Length cannot be less than {min}",
229
+ "stringMax": "Length cannot be greater than {max}",
230
+ "stringRange": "Length must be between {min} and {max}",
231
+ "numberLen": "Must be {len}",
232
+ "numberMin": "Cannot be less than {min}",
233
+ "numberMax": "Cannot be greater than {max}",
234
+ "numberRange": "Must be between {min} and {max}",
235
+ "arrayLen": "Length must be {len}",
236
+ "arrayMin": "Length cannot be less than {min}",
237
+ "arrayMax": "Length cannot be greater than {max}",
238
+ "arrayRange": "Length must be between {min} and {max}",
239
+ "formatValidationError": "Error formatting validation message",
240
+ "processValidationError": "Error processing validation rules"
241
+ },
242
+ "fileUpload": {
243
+ "pleaseSelectFile": "Please select a file to upload!",
244
+ "allUploadSuccess": "All files uploaded successfully!",
245
+ "partialUploadFailed": "Upload completed, some files failed to upload!",
246
+ "saveUploadSuccess": "Save successfully uploaded files!",
247
+ "partialUploadFailedCancel": "Upload completed, some files failed to upload, save cancelled!",
248
+ "allUploadFailed": "Upload completed, all files failed to upload!",
249
+ "fileUploadSuccess": "File uploaded successfully!",
250
+ "fileUploadFailed": "File upload failed!"
251
+ },
252
+ "data": {
253
+ "executeSuccess": "Execution successful!",
254
+ "noDataToSave": "Error! No data to save!",
255
+ "saveSuccess": "Save successful!",
256
+ "conditionalDeleteForbidden": "Error! Unconditional data deletion is forbidden!",
257
+ "deleteSuccess": "Delete successful!"
258
+ },
259
+ "download": {
260
+ "downloadFailed": "File download failed!",
261
+ "fileDownloadFailed": "File download failed, please try again later",
262
+ "fileTypeNotSupported": "File type not supported for preview",
263
+ "filePreviewFailed": "File preview failed!"
264
+ },
265
+ "formExcel": {
266
+ "excelNoSheets": "Excel file does not contain worksheets",
267
+ "excelInsufficientData": "Excel file does not contain enough data",
268
+ "validationError": "Error occurred while validating table data",
269
+ "missingDuplicateFields": "Table header missing fields required for duplicate detection",
270
+ "fileNotExcel": "Uploaded file is not an Excel file",
271
+ "processFailed": "Excel file processing failed",
272
+ "validationSuccess": "Data validation successful",
273
+ "duplicateValidationPending": "Duplicate data to validate",
274
+ "validationFailed": "Data validation failed",
275
+ "validationPassed": "Data validation passed",
276
+ "duplicateDetected": "Duplicate data detected",
277
+ "duplicateCheckPassed": "Duplicate check passed"
278
+ },
279
+ "options": {
280
+ "notConfigured": "Options data not configured!"
281
+ },
282
+ "form": {
283
+ "submitValidationFailed": "Validation failed when submitting form!",
284
+ "saveSuccess": "Save successful!",
285
+ "dataAlreadyExists": "Save failed! Data `{0}` already exists!",
286
+ "saveFailed": "Save failed!"
287
+ },
288
+ "excelPreview": {
289
+ "previewUrlNotConfigured": "Preview URL or Excel controller not configured",
290
+ "fileLoadFailed": "File load failed"
291
+ },
292
+ "tools": {
293
+ "noClickHandler": "Click handler not configured!",
294
+ "refreshTable": "Refresh Table",
295
+ "expandSearch": "Expand Search Bar",
296
+ "collapseSearch": "Collapse Search Bar",
297
+ "rowHeight": "Adjust Row Height",
298
+ "showCheckbox": "Show Checkbox",
299
+ "hideCheckbox": "Hide Checkbox",
300
+ "expandRows": "Expand Rows",
301
+ "collapseRows": "Collapse Rows",
302
+ "exportExcel": "Export Excel",
303
+ "exportAllRecords": "All Records",
304
+ "exportSelectedRecords": "Selected Records",
305
+ "exportPDF": "Export PDF",
306
+ "tableHeaderSettings": "Table Header Settings",
307
+ "setFullscreen": "Set Fullscreen",
308
+ "exitFullscreen": "Exit Fullscreen"
309
+ },
310
+ "iconLoader": {
311
+ "networkError": "Network error, unable to load icon library!"
312
+ },
313
+ "formCsv": {
314
+ "csvToExcelFailed": "CSV to Excel conversion failed",
315
+ "csvProcessFailed": "CSV file processing failed",
316
+ "unknownError": "Unknown error"
317
+ }
318
+ }
319
+ }
320
+ }
@@ -18,6 +18,7 @@ import { LoginExpiredError, useUserInfo } from './userInfo';
18
18
  import { ApiResponse, httpPost, IUrlInfo, ResStatus } from '@skyfox2000/fapi';
19
19
  import message from 'vue-m-message';
20
20
  import { MicroOpenApis } from '@/utils/micro-openapis';
21
+ import { $t } from '@/locales/index';
21
22
 
22
23
  // const APPINFO_STORE_KEY = 'appInfoStore';
23
24
 
@@ -251,7 +252,7 @@ export const useAppInfo = defineStore('appInfo', {
251
252
  async toDefaultApp(url?: string) {
252
253
  if (this.appList.length === 0) await this.loadAppList();
253
254
  if (this.appList.length === 0) {
254
- message.error('加载应用列表失败');
255
+ message.error($t('webui.stores.appInfo.loadAppListFailed'));
255
256
  return;
256
257
  }
257
258
  // 默认地址的应用
@@ -5,8 +5,9 @@ import { isMicroApp, LoginInfo, UserInfo } from '@skyfox2000/microbase';
5
5
  import { ref } from 'vue';
6
6
  import { useAppInfo } from './appInfo';
7
7
  import { MicroOpenApis } from '@/utils/micro-openapis';
8
+ import { $t } from '@/locales/index';
8
9
 
9
- const TokenError = 'Token解析失败';
10
+ const TokenError = $t('webui.stores.userInfo.tokenParseFailed');
10
11
  export const LoginExpiredError = 1400;
11
12
 
12
13
  /** 登录相关接口 */
@@ -33,7 +34,7 @@ const LoginUrlList: {
33
34
  api: 'PLATFORM_API',
34
35
  authorize: true,
35
36
  url: '/api/LoginSrv/logout',
36
- loadingText: '正在退出...',
37
+ loadingText: $t('webui.stores.userInfo.exiting'),
37
38
  },
38
39
  };
39
40
 
@@ -78,7 +79,7 @@ const getRolePermitsApi = <T>(appId: string): Promise<T | null | undefined> => {
78
79
  userInfoStore.logout(false);
79
80
  return;
80
81
  }
81
- message.error('获取授权信息失败,' + result?.msg!);
82
+ message.error($t('webui.stores.userInfo.authInfoFailed') + ',' + result?.msg!);
82
83
  return null;
83
84
  });
84
85
  };
@@ -206,7 +207,7 @@ export const useUserInfo = defineStore('userInfo', {
206
207
  };
207
208
  userLevel.value = loginInfo.UserInfo!.UserLevel;
208
209
  } else {
209
- message.error('用户信息解析失败');
210
+ message.error($t('webui.stores.userInfo.userInfoParseFailed'));
210
211
  return;
211
212
  }
212
213
 
@@ -395,7 +396,7 @@ export const useUserInfo = defineStore('userInfo', {
395
396
  if (exit) {
396
397
  // 跳转到登录页
397
398
  setTimeout(async () => {
398
- message.success('已退出登录');
399
+ message.success($t('webui.stores.userInfo.logoutSuccess'));
399
400
  }, 1000);
400
401
  }
401
402
  setTimeout(async () => {
package/src/utils/data.ts CHANGED
@@ -4,6 +4,7 @@ import message from 'vue-m-message';
4
4
  import { isEmpty } from './isEmpty';
5
5
  import { combineParams } from '@skyfox2000/microbase';
6
6
  import { LoginExpiredError, useUserInfo } from '@/stores/userInfo';
7
+ import { $t } from '@/locales/index';
7
8
 
8
9
  /**
9
10
  * 合并URL信息
@@ -114,12 +115,12 @@ export const doExecute = <T>(control: AnyControl, options: ExecuteOptions<T>): P
114
115
  if (!options.params) options.params = {};
115
116
  if (!options.params!.Query) options.params!.Query = {};
116
117
 
117
- options.loadingText = options.loadingText === false ? false : options.loadingText || '开始执行...';
118
+ options.loadingText = options.loadingText === false ? false : options.loadingText || $t('webui.utils.data.startExecute');
118
119
  options.url = combineUrl(control, options);
119
120
 
120
121
  return doPost<T>(control, options).then((result) => {
121
122
  if (result?.status === ResStatus.SUCCESS) {
122
- if (!options.hideErrorToast) message.success('执行成功!');
123
+ if (!options.hideErrorToast) message.success($t('webui.utils.data.executeSuccess'));
123
124
  }
124
125
  return result as ApiResponse<T> | null;
125
126
  });
@@ -139,14 +140,14 @@ export const doSave = <T>(
139
140
  if (!options.params) options.params = {};
140
141
  if (!options.params!.Query) options.params!.Query = {};
141
142
  if (!options.params!.Data) {
142
- message.error('错误!无保存数据!');
143
+ message.error($t('webui.utils.data.noSaveData'));
143
144
  return Promise.resolve(null);
144
145
  }
145
146
 
146
147
  const execOptions: ExecuteOptions<T> = {
147
148
  ...(options as ExecuteOptions<T>),
148
149
  urlKey: options.urlKey || 'save',
149
- loadingText: options.loadingText === false ? false : options.loadingText || '数据保存中...',
150
+ loadingText: options.loadingText === false ? false : options.loadingText || $t('webui.utils.data.savingData'),
150
151
  };
151
152
 
152
153
  // 如果有主键,添加到查询条件中
@@ -157,7 +158,7 @@ export const doSave = <T>(
157
158
 
158
159
  return doPost(control, execOptions).then((result) => {
159
160
  if (result?.status === ResStatus.SUCCESS) {
160
- if (!options.hideErrorToast) message.success('保存成功!');
161
+ if (!options.hideErrorToast) message.success($t('webui.utils.data.saveSuccess'));
161
162
  }
162
163
  return result as ApiResponse<T> | null;
163
164
  });
@@ -182,7 +183,7 @@ export const doDelete = <T>(
182
183
  const execOptions: ExecuteOptions<T> = {
183
184
  ...(options as ExecuteOptions<T>),
184
185
  urlKey: 'delete',
185
- loadingText: options.loadingText === false ? false : options.loadingText || '数据删除中...',
186
+ loadingText: options.loadingText === false ? false : options.loadingText || $t('webui.utils.data.deletingData'),
186
187
  };
187
188
 
188
189
  // 处理记录
@@ -193,7 +194,7 @@ export const doDelete = <T>(
193
194
  }
194
195
 
195
196
  if (isEmpty(execOptions.params!.Query) || isEmpty(execOptions.params!.Query![primaryKey])) {
196
- message.error('错误!禁止无条件删除数据!');
197
+ message.error($t('webui.utils.data.forbidDeleteWithoutCondition'));
197
198
  return Promise.resolve(null);
198
199
  }
199
200
  const url = combineUrl(control, execOptions);
@@ -201,7 +202,7 @@ export const doDelete = <T>(
201
202
 
202
203
  return doPost(control, execOptions).then((result) => {
203
204
  if (result?.status === ResStatus.SUCCESS) {
204
- if (!options.hideErrorToast) message.success('删除成功!');
205
+ if (!options.hideErrorToast) message.success($t('webui.utils.data.deleteSuccess'));
205
206
  }
206
207
  return result as ApiResponse<T> | null;
207
208
  });
@@ -4,6 +4,7 @@ import { ApiResponse, httpPost, IUrlInfo, ReqParams, ResStatus } from '@skyfox20
4
4
  import message from 'vue-m-message';
5
5
  import { combineParams } from '@skyfox2000/microbase';
6
6
  import { LoginExpiredError, useUserInfo } from '@/stores/userInfo';
7
+ import { $t } from '@/locales/index';
7
8
 
8
9
  /** 通用 Blob 下载方法
9
10
  *
@@ -73,14 +74,14 @@ export const donwloadFromMinio = <T>(url: IUrlInfo, params?: ReqParams, pageCtrl
73
74
  userInfoStore.logout(false);
74
75
  return;
75
76
  } else {
76
- message.error('下载文件失败!');
77
+ message.error($t('webui.utils.download.downloadFailed'));
77
78
  }
78
79
  return undefined;
79
80
  });
80
81
  } catch (error) {
81
82
  console.error('下载失败:', error);
82
83
  // throw new Error('文件导出失败,请稍后重试');
83
- message.error('文件下载失败,请稍后重试');
84
+ message.error($t('webui.utils.download.fileDownloadFailedRetry'));
84
85
  }
85
86
  };
86
87
 
@@ -91,7 +92,7 @@ export const previewFromMinio = (url: IUrlInfo, fileName: string, params?: ReqPa
91
92
  if (CanPreviewFileExt.includes(fileExt!)) {
92
93
  console.log(url);
93
94
  } else {
94
- message.error('文件类型不支持预览');
95
+ message.error($t('webui.utils.download.fileTypeNotSupported'));
95
96
  return false;
96
97
  }
97
98
 
@@ -113,7 +114,7 @@ export const previewFromMinio = (url: IUrlInfo, fileName: string, params?: ReqPa
113
114
  userInfoStore.logout(false);
114
115
  return;
115
116
  } else {
116
- message.error('文件预览失败!');
117
+ message.error($t('webui.utils.download.previewFailed'));
117
118
  }
118
119
  return undefined;
119
120
  });
@@ -7,6 +7,7 @@ import { csvToExcelView } from './excel-view';
7
7
  import { AnyData, ResStatus, IUrlInfo, httpGet, ApiResponse } from '@skyfox2000/fapi';
8
8
  import { doQuery } from '@/index';
9
9
  import message from 'vue-m-message';
10
+ import { $t } from '@/locales/index';
10
11
 
11
12
  /**
12
13
  * 判断是否为CSV格式的内容
@@ -138,7 +139,7 @@ export const loadPreviewFile = async (
138
139
  excelCtrl: any,
139
140
  ): Promise<{ success: boolean; blobUrl?: string; fileName?: string }> => {
140
141
  if (!previewUrl || !excelCtrl) {
141
- message.error('预览URL或Excel控制器未配置');
142
+ message.error($t('webui.utils.excelPreview.previewUrlNotConfigured'));
142
143
  return { success: false };
143
144
  }
144
145
 
@@ -178,12 +179,12 @@ export const loadPreviewFile = async (
178
179
  // 处理返回的文件数据
179
180
  return await handleFileData(data, false);
180
181
  } else {
181
- throw new Error(result?.msg || '文件加载失败');
182
+ throw new Error(result?.msg || $t('webui.utils.excelPreview.fileLoadFailed'));
182
183
  }
183
184
  }
184
185
  } catch (error: any) {
185
186
  console.error('预览文件加载错误:', error);
186
- message.error('文件加载失败:' + (error?.message || '未知错误'));
187
+ message.error($t('webui.utils.excelPreview.fileLoadFailed') + ':' + (error?.message || '未知错误'));
187
188
  throw error;
188
189
  }
189
190
  };
@@ -4,6 +4,7 @@ import dayjs from 'dayjs';
4
4
  import message from 'vue-m-message';
5
5
  import { downloadBlob } from './download';
6
6
  import { LoginExpiredError, useUserInfo } from '@/stores/userInfo';
7
+ import { $t } from '@/locales/index';
7
8
 
8
9
  // 下载当前选择行
9
10
  // 表头相同
@@ -92,8 +93,8 @@ const downloadCSV = async <T extends Record<string, any>>(
92
93
  const blob = new Blob([`\uFEFF${csvContent}`], { type: 'text/csv' });
93
94
  downloadBlob(blob, fileName);
94
95
  } catch (error) {
95
- console.error('导出失败:', error);
96
- message.error('文件导出失败,请稍后重试');
96
+ console.error($t('webui.utils.exportTable.exportFailed') + ':', error);
97
+ message.error($t('webui.utils.exportTable.fileExportFailed'));
97
98
  }
98
99
  };
99
100
 
@@ -124,8 +125,8 @@ export const exportSelectedRows = async <T extends Record<string, any>>(
124
125
  // 5. 生成 CSV 内容并下载
125
126
  await downloadCSV(processedFileName, fields, processedData);
126
127
  } catch (error) {
127
- console.error('导出失败:', error);
128
- message.error('文件导出失败,请稍后重试');
128
+ console.error($t('webui.utils.exportTable.exportFailed') + ':', error);
129
+ message.error($t('webui.utils.exportTable.fileExportFailed'));
129
130
  }
130
131
  };
131
132
 
@@ -182,8 +183,8 @@ export const exportResults = async <T extends Record<string, any>>(
182
183
  return undefined;
183
184
  });
184
185
  } catch (error) {
185
- console.error('导出失败:', error);
186
- message.error('文件导出失败,请稍后重试');
186
+ console.error($t('webui.utils.exportTable.exportFailed') + ':', error);
187
+ message.error($t('webui.utils.exportTable.fileExportFailed'));
187
188
  }
188
189
  };
189
190