@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.
- package/lib/assets/modules/{baseLayout-BEy-FjcZ.js → baseLayout-DfTxHOFc.js} +7 -7
- package/lib/assets/modules/file-upload-DTOdV5vM.js +211 -0
- package/lib/assets/modules/{index-BTD6d1d_.js → index-BwMaOrJT.js} +1 -1
- package/lib/assets/modules/{index-DyE2ppxB.js → index-DUBY49Au.js} +27 -27
- package/lib/assets/modules/{index-BFxnKhwl.js → index-M1qERbea.js} +99 -99
- package/lib/assets/modules/{menuTabs-DUBWuf7t.js → menuTabs-DWaBSRNr.js} +42 -42
- package/lib/assets/modules/{toolIcon-DQLIuud3.js → toolIcon-BYnHhAy-.js} +1 -1
- package/lib/assets/modules/upload-template-BKm9mFq8.js +6764 -0
- package/lib/assets/modules/uploadList-CHvr6Hp1.js +472 -0
- package/lib/es/AceEditor/index.js +3 -3
- package/lib/es/BasicLayout/index.js +2 -2
- package/lib/es/Error403/index.js +14 -15
- package/lib/es/Error404/index.js +16 -17
- package/lib/es/ExcelForm/index.js +244 -244
- package/lib/es/MenuLayout/index.js +5 -5
- package/lib/es/TemplateFile/index.js +53 -54
- package/lib/es/UploadForm/index.js +61 -63
- package/lib/locales/default.d.ts +287 -103
- package/lib/webui.css +1 -1
- package/lib/webui.es.js +1476 -1622
- package/package.json +1 -1
- package/src/components/common/icon/fullscreen.vue +1 -1
- package/src/components/content/dialog/excelForm.vue +32 -28
- package/src/components/content/dialog/index.vue +4 -3
- package/src/components/content/dialog/templateFile.vue +3 -2
- package/src/components/content/dialog/uploadForm.vue +5 -4
- package/src/components/content/drawer/index.vue +5 -3
- package/src/components/content/list/index.vue +2 -1
- package/src/components/content/list/listOperate.vue +6 -7
- package/src/components/content/search/index.vue +3 -2
- package/src/components/content/table/index.vue +2 -1
- package/src/components/content/table/tableOperate.vue +8 -9
- package/src/components/content/toolbar/icontool.vue +1 -5
- package/src/components/content/toolbar/index.vue +4 -5
- package/src/components/content/toolpanel/index.vue +20 -20
- package/src/components/error/error403.vue +2 -2
- package/src/components/error/error404.vue +2 -2
- package/src/components/form/input/index.vue +3 -1
- package/src/components/form/select/index.vue +3 -2
- package/src/components/form/textarea/index.vue +3 -1
- package/src/components/form/transfer/index.vue +2 -1
- package/src/components/form/upload/uploadList.vue +23 -19
- package/src/components/layout/header/headerExits.vue +5 -5
- package/src/components/layout/menu/menuTabs.vue +1 -1
- package/src/const/options.ts +17 -16
- package/src/locales/default.ts +297 -176
- package/src/locales/en-US.json +320 -0
- package/src/stores/appInfo.ts +2 -1
- package/src/stores/userInfo.ts +6 -5
- package/src/utils/data.ts +9 -8
- package/src/utils/download.ts +5 -4
- package/src/utils/excel-preview.ts +4 -3
- package/src/utils/export-table.ts +7 -6
- package/src/utils/file-upload.ts +15 -14
- package/src/utils/form-csv.ts +4 -3
- package/src/utils/form-excel.ts +14 -13
- package/src/utils/form-validate.ts +18 -17
- package/src/utils/form.ts +6 -5
- package/src/utils/icon-loader.ts +3 -2
- package/src/utils/options.ts +2 -1
- package/src/utils/tools.ts +18 -17
- package/lib/assets/modules/file-upload-_mcZy7EK.js +0 -211
- package/lib/assets/modules/upload-template-DZuy1BOF.js +0 -6465
- 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
|
+
}
|
package/src/stores/appInfo.ts
CHANGED
|
@@ -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
|
// 默认地址的应用
|
package/src/stores/userInfo.ts
CHANGED
|
@@ -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 = '
|
|
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('
|
|
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
|
});
|
package/src/utils/download.ts
CHANGED
|
@@ -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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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
|
|