@skyfox2000/webui 1.6.6 → 1.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/lib/assets/modules/{baseLayout-Q_-85t5x.js → baseLayout-CLYEvEZ4.js} +3 -3
  2. package/lib/assets/modules/{file-upload-C3fQyOcW.js → file-upload-JSdbDIS7.js} +1 -1
  3. package/lib/assets/modules/{index-BxppYXRI.js → index--7cem1cg.js} +2 -2
  4. package/lib/assets/modules/{index-CQ1CKyZE.js → index-DDdkKF8p.js} +2 -2
  5. package/lib/assets/modules/{index-DD-b_Aw7.js → index-DeciUTEK.js} +1 -1
  6. package/lib/assets/modules/{menuTabs-BRD9IqUS.js → menuTabs-B6rKn3BF.js} +2 -2
  7. package/lib/assets/modules/{toolIcon-CXETWWwt.js → toolIcon-h7IPQaWC.js} +1 -1
  8. package/lib/assets/modules/{upload-template-wBTe_VKy.js → upload-template-W04BQpEb.js} +5 -5
  9. package/lib/assets/modules/{uploadList-BIql2SCu.js → uploadList-D4k7XnhK.js} +4 -4
  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 +1 -1
  13. package/lib/es/Error404/index.js +1 -1
  14. package/lib/es/ExcelForm/index.js +4 -4
  15. package/lib/es/MenuLayout/index.js +2 -2
  16. package/lib/es/TemplateFile/index.js +4 -4
  17. package/lib/es/UploadForm/index.js +4 -4
  18. package/lib/src/components/content/toolpanel/index.vue.d.ts +15 -0
  19. package/lib/src/components/form/autoComplete/index.vue.d.ts +111 -0
  20. package/lib/src/components/form/autoComplete/index.vue.js +156 -0
  21. package/lib/src/components/form/autoComplete/index.vue.js.map +1 -0
  22. package/lib/src/components/form/cascader/index.vue.d.ts +91 -0
  23. package/lib/src/components/form/input/index.vue.d.ts +29 -0
  24. package/lib/src/components/form/radio/index.vue.d.ts +115 -0
  25. package/lib/src/components/form/select/index.vue.d.ts +130 -0
  26. package/lib/src/components/form/switch/index.vue.d.ts +96 -0
  27. package/lib/src/components/form/transfer/index.vue.d.ts +33 -0
  28. package/lib/src/components/form/treeSelect/index.vue.d.ts +48 -0
  29. package/lib/src/components/form/upload/uploadList.vue.d.ts +42 -0
  30. package/lib/src/components/form/upload/uploadList.vue.js +713 -0
  31. package/lib/src/components/form/upload/uploadList.vue.js.map +1 -0
  32. package/lib/webui.es.js +13 -13
  33. package/package.json +3 -3
  34. package/src/components/form/autoComplete/index.vue +2 -1
  35. package/src/components/form/upload/uploadList.vue +1 -1
  36. package/src/locales/index.ts +4 -2
@@ -0,0 +1,713 @@
1
+ import { Button, ToolIcon, Tooltip } from '../../common';
2
+ import { computed, ref, watch } from 'vue';
3
+ import message from 'vue-m-message';
4
+ import { Upload, Progress, Tag, Popconfirm } from 'ant-design-vue';
5
+ import { UploadStatus, donwloadFromMinio, path, Switch, previewFromMinio } from '@/index';
6
+ import { useInputFactory } from '@/utils/form-validate';
7
+ import { httpPost, ResStatus } from '@skyfox2000/fapi';
8
+ import { fastUpload } from '@/utils/file-upload';
9
+ import { $t } from '@/locales/index';
10
+ const props = withDefaults(defineProps(), {
11
+ autoUpload: false,
12
+ fileList: () => [],
13
+ placeholder: '',
14
+ maxFileSize: 20,
15
+ maxCount: 5,
16
+ maxCountTip: false,
17
+ maxFileSizeTip: true,
18
+ fileExtTip: true,
19
+ showActionText: true,
20
+ showOnlineSwitch: false,
21
+ showDelete: true,
22
+ showFolderUpload: false,
23
+ });
24
+ const inputFactory = useInputFactory();
25
+ const { errInfo } = inputFactory;
26
+ const displayList = ref(props.fileList);
27
+ const uploadList = ref([]);
28
+ const emit = defineEmits(['update:file-list']);
29
+ const acceptString = computed(() => (props.fileExt?.length ? props.fileExt.map((ext) => `.${ext}`).join(',') : ''));
30
+ const validateFile = (file) => {
31
+ if (props.fileExt && props.fileExt.length > 0) {
32
+ const extension = file.name.split('.').pop()?.toLowerCase() || '';
33
+ if (!props.fileExt.includes(extension)) {
34
+ message.error($t('webui.components.form.upload.unsupportedFileType'));
35
+ return false;
36
+ }
37
+ }
38
+ if (file.size / 1024 / 1024 > props.maxFileSize) {
39
+ message.error($t('webui.components.form.upload.fileSizeExceeded', [props.maxFileSize]));
40
+ return false;
41
+ }
42
+ return true;
43
+ };
44
+ const isMaxCountReached = () => {
45
+ return props.maxCount > 1 && displayList.value.length >= props.maxCount;
46
+ };
47
+ const prepareFileInfo = (file) => {
48
+ const fileInfo = file;
49
+ if (!fileInfo.params)
50
+ fileInfo.params = {};
51
+ let relativePath = fileInfo.name;
52
+ if (fileInfo.webkitRelativePath) {
53
+ relativePath = fileInfo.webkitRelativePath;
54
+ }
55
+ if (fileInfo.webkitRelativePath) {
56
+ fileInfo.name = fileInfo.webkitRelativePath;
57
+ fileInfo.fileName = fileInfo.webkitRelativePath.split('/').pop();
58
+ }
59
+ fileInfo.params.FileKey = fileInfo.name;
60
+ if (props.parentPath) {
61
+ fileInfo.params.FileKey = path.join('/', props.parentPath, fileInfo.name);
62
+ }
63
+ fileInfo.status = UploadStatus.Pending;
64
+ if (fileInfo.webkitRelativePath) {
65
+ fileInfo.relativePath = relativePath;
66
+ }
67
+ return fileInfo;
68
+ };
69
+ const beforeUpload = (file) => {
70
+ return validateFile(file) && props.autoUpload;
71
+ };
72
+ const handleFileSelect = async (newFiles) => {
73
+ if (newFiles.length === 0)
74
+ return;
75
+ const tempFiles = [...displayList.value];
76
+ let hasError = false;
77
+ for (const file of newFiles) {
78
+ if (!validateFile(file)) {
79
+ hasError = true;
80
+ continue;
81
+ }
82
+ const fileInfo = prepareFileInfo(file);
83
+ if (props.maxCount === 1) {
84
+ tempFiles.length = 0;
85
+ tempFiles.push(fileInfo);
86
+ break;
87
+ }
88
+ if (isMaxCountReached()) {
89
+ message.error($t('webui.components.form.upload.maxFileCount', [props.maxCount]));
90
+ hasError = true;
91
+ break;
92
+ }
93
+ const existingIndex = tempFiles.findIndex(f => (f.name === fileInfo.name));
94
+ if (existingIndex > -1) {
95
+ tempFiles[existingIndex] = fileInfo;
96
+ }
97
+ else {
98
+ tempFiles.push(fileInfo);
99
+ }
100
+ }
101
+ if (!hasError || tempFiles.length > 0) {
102
+ displayList.value = tempFiles;
103
+ }
104
+ uploadList.value = [];
105
+ };
106
+ const updateUploadList = (newFiles) => {
107
+ uploadList.value = newFiles;
108
+ handleFileSelect(newFiles);
109
+ };
110
+ const uploadProps = computed(() => ({
111
+ accept: acceptString.value,
112
+ multiple: props.maxCount !== 1,
113
+ fileList: uploadList.value,
114
+ 'onUpdate:fileList': updateUploadList,
115
+ beforeUpload: beforeUpload,
116
+ listType: 'text',
117
+ showUploadList: false,
118
+ customRequest: async () => {
119
+ if (props.autoUpload && props.uploadUrl) {
120
+ for (const file of displayList.value) {
121
+ if (file.percent === 0 && file.status === UploadStatus.Pending) {
122
+ await fastUpload(props.uploadUrl, file);
123
+ }
124
+ }
125
+ }
126
+ },
127
+ }));
128
+ const folderUploadProps = computed(() => ({
129
+ accept: acceptString.value,
130
+ multiple: true,
131
+ directory: true,
132
+ webkitdirectory: true,
133
+ fileList: [],
134
+ 'onUpdate:fileList': (newFiles) => handleFileSelect(newFiles),
135
+ beforeUpload: () => false,
136
+ listType: 'text',
137
+ showUploadList: false,
138
+ customRequest: () => { },
139
+ }));
140
+ watch(() => props.fileList, (newVal) => {
141
+ displayList.value = newVal;
142
+ }, { deep: true, immediate: true });
143
+ watch(() => displayList.value, (newVal) => {
144
+ emit('update:file-list', newVal);
145
+ }, { deep: true });
146
+ watch(() => props.parentPath, (newVal) => {
147
+ if (newVal) {
148
+ displayList.value.forEach((file) => {
149
+ file.params.FileKey = path.join('/', newVal, file.fileName);
150
+ });
151
+ }
152
+ });
153
+ const downloadFile = (index) => {
154
+ const minioFile = displayList.value[index].minioFile;
155
+ const url = {
156
+ api: props.downloadUrl.api,
157
+ authorize: props.downloadUrl.authorize,
158
+ url: props.downloadUrl.url,
159
+ params: {
160
+ Query: {
161
+ FileKey: minioFile.Key,
162
+ },
163
+ },
164
+ };
165
+ donwloadFromMinio(url);
166
+ };
167
+ const onlineOrOffline = (file) => {
168
+ if (file.minioFile) {
169
+ file.minioFile.Status = file.status;
170
+ }
171
+ };
172
+ const previewFile = (index) => {
173
+ const minioFile = displayList.value[index].minioFile;
174
+ const url = {
175
+ api: props.previewUrl.api,
176
+ authorize: props.previewUrl.authorize,
177
+ url: props.previewUrl.url,
178
+ params: {
179
+ Query: {
180
+ FileKey: minioFile.Key,
181
+ },
182
+ },
183
+ };
184
+ previewFromMinio(url, minioFile.FileName);
185
+ };
186
+ const removeFile = (index) => {
187
+ const file = displayList.value[index];
188
+ if (props.deleteUrl && file.minioFile && file.minioFile.Key) {
189
+ httpPost(props.deleteUrl, {
190
+ Query: {
191
+ FileKey: file.minioFile.Key,
192
+ },
193
+ }).then((res) => {
194
+ if (res && res.status === ResStatus.SUCCESS) {
195
+ message.success($t('webui.components.form.upload.deleteSuccess'));
196
+ displayList.value.splice(index, 1);
197
+ }
198
+ });
199
+ }
200
+ else {
201
+ displayList.value.splice(index, 1);
202
+ }
203
+ delIndex.value = -1;
204
+ };
205
+ const delIndex = ref(-1);
206
+ const confirmDelFile = (index, status) => {
207
+ delIndex.value = index;
208
+ if (status === UploadStatus.Pending) {
209
+ removeFile(index);
210
+ return;
211
+ }
212
+ };
213
+ const confirmIndex = (index) => {
214
+ return index === delIndex.value;
215
+ };
216
+ const getPlaceholder = () => {
217
+ const typeMsg = props.fileExt && props.fileExt.length && props.fileExtTip ? $t('webui.components.form.upload.fileTypeRequired', [props.fileExt.join('/')]) : '';
218
+ const sizeMsg = props.maxFileSize !== 0 && props.maxFileSizeTip ? $t('webui.components.form.upload.singleFileMax', [props.maxFileSize]) : '';
219
+ const countMsg = props.maxCount !== 0 && props.maxCountTip ? $t('webui.components.form.upload.maxFiles', [props.maxCount]) : '';
220
+ return [sizeMsg, typeMsg, countMsg].filter(Boolean).join(',');
221
+ };
222
+ const getStatusColor = (status) => {
223
+ switch (status) {
224
+ case UploadStatus.Uploading:
225
+ return 'blue';
226
+ case UploadStatus.Success:
227
+ return 'green';
228
+ case UploadStatus.Error:
229
+ return 'red';
230
+ case UploadStatus.Online:
231
+ return 'green';
232
+ case UploadStatus.Offline:
233
+ return 'pink';
234
+ default:
235
+ return 'cyan';
236
+ }
237
+ };
238
+ const getStatus = (status) => {
239
+ switch (status) {
240
+ case UploadStatus.Uploading:
241
+ return $t('webui.components.form.upload.uploading');
242
+ case UploadStatus.Success:
243
+ return $t('webui.components.form.upload.uploadComplete');
244
+ case UploadStatus.Error:
245
+ return $t('webui.components.form.upload.uploadFailed');
246
+ case UploadStatus.Online:
247
+ return $t('webui.common.online');
248
+ case UploadStatus.Offline:
249
+ return $t('webui.common.offline');
250
+ default:
251
+ return $t('webui.components.form.upload.pendingUpload');
252
+ }
253
+ };
254
+ const __VLS_defaults = {
255
+ autoUpload: false,
256
+ fileList: () => [],
257
+ placeholder: '',
258
+ maxFileSize: 20,
259
+ maxCount: 5,
260
+ maxCountTip: false,
261
+ maxFileSizeTip: true,
262
+ fileExtTip: true,
263
+ showActionText: true,
264
+ showOnlineSwitch: false,
265
+ showDelete: true,
266
+ showFolderUpload: false,
267
+ };
268
+ const __VLS_ctx = {
269
+ ...{},
270
+ ...{},
271
+ ...{},
272
+ ...{},
273
+ ...{},
274
+ };
275
+ let __VLS_components;
276
+ let __VLS_intrinsics;
277
+ let __VLS_directives;
278
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
279
+ ...{ class: "w-full border border-solid border-gray-100 mt-1 rounded-md py-5" },
280
+ ...{ class: ([__VLS_ctx.errInfo?.errClass]) },
281
+ });
282
+ ;
283
+ ;
284
+ ;
285
+ ;
286
+ ;
287
+ ;
288
+ ;
289
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
290
+ ...{ class: "flex items-center justify-between w-full" },
291
+ });
292
+ ;
293
+ ;
294
+ ;
295
+ ;
296
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
297
+ ...{ class: "w-35 mx-3 flex gap-2" },
298
+ });
299
+ ;
300
+ ;
301
+ ;
302
+ ;
303
+ let __VLS_0;
304
+ Upload;
305
+ const __VLS_1 = __VLS_asFunctionalComponent1(__VLS_0, new __VLS_0({
306
+ ref: "fileUploader",
307
+ ...(__VLS_ctx.uploadProps),
308
+ }));
309
+ const __VLS_2 = __VLS_1({
310
+ ref: "fileUploader",
311
+ ...(__VLS_ctx.uploadProps),
312
+ }, ...__VLS_functionalComponentArgsRest(__VLS_1));
313
+ __VLS_asFunctionalDirective(__VLS_directives.vAuth, {})(null, { ...__VLS_directiveBindingRestFields, value: ({ role: ['Super', 'Admin'], permit: ':uploadlist:upload' }) }, null, null);
314
+ var __VLS_5 = {};
315
+ const { default: __VLS_7 } = __VLS_3.slots;
316
+ let __VLS_8;
317
+ Button;
318
+ const __VLS_9 = __VLS_asFunctionalComponent1(__VLS_8, new __VLS_8({
319
+ ...{ class: ([__VLS_ctx.errInfo?.errClass + '-text']) },
320
+ }));
321
+ const __VLS_10 = __VLS_9({
322
+ ...{ class: ([__VLS_ctx.errInfo?.errClass + '-text']) },
323
+ }, ...__VLS_functionalComponentArgsRest(__VLS_9));
324
+ const { default: __VLS_13 } = __VLS_11.slots;
325
+ (__VLS_ctx.$t('webui.components.form.upload.selectFile'));
326
+ [errInfo, errInfo, uploadProps, vAuth, $t,];
327
+ var __VLS_11;
328
+ [];
329
+ var __VLS_3;
330
+ if (__VLS_ctx.showFolderUpload) {
331
+ let __VLS_14;
332
+ Upload;
333
+ const __VLS_15 = __VLS_asFunctionalComponent1(__VLS_14, new __VLS_14({
334
+ ref: "fileFolderUploader",
335
+ webkitdirectory: (true),
336
+ directory: (true),
337
+ ...(__VLS_ctx.folderUploadProps),
338
+ }));
339
+ const __VLS_16 = __VLS_15({
340
+ ref: "fileFolderUploader",
341
+ webkitdirectory: (true),
342
+ directory: (true),
343
+ ...(__VLS_ctx.folderUploadProps),
344
+ }, ...__VLS_functionalComponentArgsRest(__VLS_15));
345
+ __VLS_asFunctionalDirective(__VLS_directives.vAuth, {})(null, { ...__VLS_directiveBindingRestFields, value: ({ role: ['Super', 'Admin'], permit: ':uploadlist:upload' }) }, null, null);
346
+ var __VLS_19 = {};
347
+ const { default: __VLS_21 } = __VLS_17.slots;
348
+ let __VLS_22;
349
+ Button;
350
+ const __VLS_23 = __VLS_asFunctionalComponent1(__VLS_22, new __VLS_22({
351
+ ...{ class: ([__VLS_ctx.errInfo?.errClass + '-text']) },
352
+ }));
353
+ const __VLS_24 = __VLS_23({
354
+ ...{ class: ([__VLS_ctx.errInfo?.errClass + '-text']) },
355
+ }, ...__VLS_functionalComponentArgsRest(__VLS_23));
356
+ const { default: __VLS_27 } = __VLS_25.slots;
357
+ (__VLS_ctx.$t('webui.components.form.upload.selectDirectory'));
358
+ [errInfo, vAuth, $t, showFolderUpload, folderUploadProps,];
359
+ var __VLS_25;
360
+ [];
361
+ var __VLS_17;
362
+ }
363
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
364
+ ...{ class: "flex-1 text-sm text-gray-500" },
365
+ ...{ class: ([__VLS_ctx.errInfo?.errClass + '-text']) },
366
+ });
367
+ ;
368
+ ;
369
+ ;
370
+ (__VLS_ctx.getPlaceholder());
371
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
372
+ ...{ class: "mt-4 px-3" },
373
+ });
374
+ ;
375
+ ;
376
+ for (const [file, index] of __VLS_vFor((__VLS_ctx.displayList))) {
377
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
378
+ key: ((props.parentPath || '') + (file.relativePath || file.name || index)),
379
+ ...{ class: "mb-2 pb-1" },
380
+ });
381
+ ;
382
+ ;
383
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
384
+ ...{ class: "flex items-center justify-between" },
385
+ });
386
+ ;
387
+ ;
388
+ ;
389
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
390
+ ...{ class: "flex items-center" },
391
+ });
392
+ ;
393
+ ;
394
+ __VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
395
+ ...{ class: "text-gray-700 mr-2" },
396
+ ...{ class: ([file.status == __VLS_ctx.UploadStatus.Offline ? 'line-through' : '']) },
397
+ title: (file.relativePath || file.fileName || file.name),
398
+ });
399
+ ;
400
+ ;
401
+ (file.fileName ?? file.name);
402
+ __VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({});
403
+ let __VLS_28;
404
+ Tag;
405
+ const __VLS_29 = __VLS_asFunctionalComponent1(__VLS_28, new __VLS_28({
406
+ color: (__VLS_ctx.getStatusColor(file.status)),
407
+ }));
408
+ const __VLS_30 = __VLS_29({
409
+ color: (__VLS_ctx.getStatusColor(file.status)),
410
+ }, ...__VLS_functionalComponentArgsRest(__VLS_29));
411
+ const { default: __VLS_33 } = __VLS_31.slots;
412
+ (__VLS_ctx.getStatus(file.status));
413
+ [errInfo, getPlaceholder, displayList, UploadStatus, getStatusColor, getStatus,];
414
+ var __VLS_31;
415
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
416
+ ...{ class: "flex items-center" },
417
+ });
418
+ ;
419
+ ;
420
+ if (__VLS_ctx.showOnlineSwitch && (file.status == __VLS_ctx.UploadStatus.Online || file.status == __VLS_ctx.UploadStatus.Offline)) {
421
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
422
+ ...{ class: "mr-2" },
423
+ });
424
+ ;
425
+ let __VLS_34;
426
+ Tooltip;
427
+ const __VLS_35 = __VLS_asFunctionalComponent1(__VLS_34, new __VLS_34({
428
+ title: (__VLS_ctx.$t('webui.components.form.upload.onlineOrOffline')),
429
+ }));
430
+ const __VLS_36 = __VLS_35({
431
+ title: (__VLS_ctx.$t('webui.components.form.upload.onlineOrOffline')),
432
+ }, ...__VLS_functionalComponentArgsRest(__VLS_35));
433
+ const { default: __VLS_39 } = __VLS_37.slots;
434
+ let __VLS_40;
435
+ Switch;
436
+ const __VLS_41 = __VLS_asFunctionalComponent1(__VLS_40, new __VLS_40({
437
+ ...{ 'onChange': {} },
438
+ checked: (file.status),
439
+ data: ([
440
+ { label: __VLS_ctx.$t('webui.common.online'), value: __VLS_ctx.UploadStatus.Online },
441
+ { label: __VLS_ctx.$t('webui.common.offline'), value: __VLS_ctx.UploadStatus.Offline },
442
+ ]),
443
+ }));
444
+ const __VLS_42 = __VLS_41({
445
+ ...{ 'onChange': {} },
446
+ checked: (file.status),
447
+ data: ([
448
+ { label: __VLS_ctx.$t('webui.common.online'), value: __VLS_ctx.UploadStatus.Online },
449
+ { label: __VLS_ctx.$t('webui.common.offline'), value: __VLS_ctx.UploadStatus.Offline },
450
+ ]),
451
+ }, ...__VLS_functionalComponentArgsRest(__VLS_41));
452
+ let __VLS_45;
453
+ const __VLS_46 = ({ change: {} },
454
+ { onChange: (...[$event]) => {
455
+ if (!(__VLS_ctx.showOnlineSwitch && (file.status == __VLS_ctx.UploadStatus.Online || file.status == __VLS_ctx.UploadStatus.Offline)))
456
+ return;
457
+ __VLS_ctx.onlineOrOffline(file);
458
+ [$t, $t, $t, UploadStatus, UploadStatus, UploadStatus, UploadStatus, showOnlineSwitch, onlineOrOffline,];
459
+ } });
460
+ __VLS_asFunctionalDirective(__VLS_directives.vAuth, {})(null, { ...__VLS_directiveBindingRestFields, value: ({ role: ['Super', 'Admin'], permit: ':uploadlist:online' }) }, null, null);
461
+ var __VLS_43;
462
+ var __VLS_44;
463
+ [vAuth,];
464
+ var __VLS_37;
465
+ }
466
+ if (__VLS_ctx.downloadUrl && (file.status == __VLS_ctx.UploadStatus.Online || file.status == __VLS_ctx.UploadStatus.Offline)) {
467
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
468
+ ...{ class: "flex items-center text-blue-500 hover:text-blue-700 mr-1 cursor-pointer" },
469
+ });
470
+ ;
471
+ ;
472
+ ;
473
+ ;
474
+ ;
475
+ ;
476
+ let __VLS_47;
477
+ Tooltip;
478
+ const __VLS_48 = __VLS_asFunctionalComponent1(__VLS_47, new __VLS_47({
479
+ title: (__VLS_ctx.$t('webui.common.download')),
480
+ }));
481
+ const __VLS_49 = __VLS_48({
482
+ title: (__VLS_ctx.$t('webui.common.download')),
483
+ }, ...__VLS_functionalComponentArgsRest(__VLS_48));
484
+ const { default: __VLS_52 } = __VLS_50.slots;
485
+ let __VLS_53;
486
+ ToolIcon;
487
+ const __VLS_54 = __VLS_asFunctionalComponent1(__VLS_53, new __VLS_53({
488
+ ...{ 'onClick': {} },
489
+ icon: "icon-download",
490
+ clickable: true,
491
+ }));
492
+ const __VLS_55 = __VLS_54({
493
+ ...{ 'onClick': {} },
494
+ icon: "icon-download",
495
+ clickable: true,
496
+ }, ...__VLS_functionalComponentArgsRest(__VLS_54));
497
+ let __VLS_58;
498
+ const __VLS_59 = ({ click: {} },
499
+ { onClick: (...[$event]) => {
500
+ if (!(__VLS_ctx.downloadUrl && (file.status == __VLS_ctx.UploadStatus.Online || file.status == __VLS_ctx.UploadStatus.Offline)))
501
+ return;
502
+ __VLS_ctx.downloadFile(index);
503
+ [$t, UploadStatus, UploadStatus, downloadUrl, downloadFile,];
504
+ } });
505
+ __VLS_asFunctionalDirective(__VLS_directives.vAuth, {})(null, { ...__VLS_directiveBindingRestFields, value: ({ role: ['Super', 'Admin'], permit: ':uploadlist:download' }) }, null, null);
506
+ var __VLS_56;
507
+ var __VLS_57;
508
+ if (__VLS_ctx.showActionText) {
509
+ __VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
510
+ ...{ onClick: (...[$event]) => {
511
+ if (!(__VLS_ctx.downloadUrl && (file.status == __VLS_ctx.UploadStatus.Online || file.status == __VLS_ctx.UploadStatus.Offline)))
512
+ return;
513
+ if (!(__VLS_ctx.showActionText))
514
+ return;
515
+ __VLS_ctx.downloadFile(index);
516
+ [vAuth, downloadFile, showActionText,];
517
+ } },
518
+ ...{ class: "mr-2 text-sm text-nowrap" },
519
+ });
520
+ __VLS_asFunctionalDirective(__VLS_directives.vAuth, {})(null, { ...__VLS_directiveBindingRestFields, value: ({ role: ['Super', 'Admin'], permit: ':uploadlist:download' }) }, null, null);
521
+ ;
522
+ ;
523
+ ;
524
+ (__VLS_ctx.$t('webui.common.download'));
525
+ }
526
+ [vAuth, $t,];
527
+ var __VLS_50;
528
+ }
529
+ if (__VLS_ctx.previewUrl && (file.status == __VLS_ctx.UploadStatus.Online || file.status == __VLS_ctx.UploadStatus.Offline)) {
530
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
531
+ ...{ class: "flex items-center text-blue-500 hover:text-blue-700 mr-1 cursor-pointer" },
532
+ });
533
+ ;
534
+ ;
535
+ ;
536
+ ;
537
+ ;
538
+ ;
539
+ let __VLS_60;
540
+ Tooltip;
541
+ const __VLS_61 = __VLS_asFunctionalComponent1(__VLS_60, new __VLS_60({
542
+ title: (__VLS_ctx.$t('webui.common.preview')),
543
+ }));
544
+ const __VLS_62 = __VLS_61({
545
+ title: (__VLS_ctx.$t('webui.common.preview')),
546
+ }, ...__VLS_functionalComponentArgsRest(__VLS_61));
547
+ const { default: __VLS_65 } = __VLS_63.slots;
548
+ let __VLS_66;
549
+ ToolIcon;
550
+ const __VLS_67 = __VLS_asFunctionalComponent1(__VLS_66, new __VLS_66({
551
+ ...{ 'onClick': {} },
552
+ icon: "icon-eye",
553
+ clickable: true,
554
+ }));
555
+ const __VLS_68 = __VLS_67({
556
+ ...{ 'onClick': {} },
557
+ icon: "icon-eye",
558
+ clickable: true,
559
+ }, ...__VLS_functionalComponentArgsRest(__VLS_67));
560
+ let __VLS_71;
561
+ const __VLS_72 = ({ click: {} },
562
+ { onClick: (...[$event]) => {
563
+ if (!(__VLS_ctx.previewUrl && (file.status == __VLS_ctx.UploadStatus.Online || file.status == __VLS_ctx.UploadStatus.Offline)))
564
+ return;
565
+ __VLS_ctx.previewFile(index);
566
+ [$t, UploadStatus, UploadStatus, previewUrl, previewFile,];
567
+ } });
568
+ __VLS_asFunctionalDirective(__VLS_directives.vAuth, {})(null, { ...__VLS_directiveBindingRestFields, value: ({ role: ['Super', 'Admin'], permit: ':uploadlist:preview' }) }, null, null);
569
+ var __VLS_69;
570
+ var __VLS_70;
571
+ if (__VLS_ctx.showActionText) {
572
+ __VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
573
+ ...{ onClick: (...[$event]) => {
574
+ if (!(__VLS_ctx.previewUrl && (file.status == __VLS_ctx.UploadStatus.Online || file.status == __VLS_ctx.UploadStatus.Offline)))
575
+ return;
576
+ if (!(__VLS_ctx.showActionText))
577
+ return;
578
+ __VLS_ctx.previewFile(index);
579
+ [vAuth, showActionText, previewFile,];
580
+ } },
581
+ ...{ class: "mr-2 text-sm text-nowrap" },
582
+ });
583
+ __VLS_asFunctionalDirective(__VLS_directives.vAuth, {})(null, { ...__VLS_directiveBindingRestFields, value: ({ role: ['Super', 'Admin'], permit: ':uploadlist:preview' }) }, null, null);
584
+ ;
585
+ ;
586
+ ;
587
+ (__VLS_ctx.$t('webui.common.preview'));
588
+ }
589
+ [vAuth, $t,];
590
+ var __VLS_63;
591
+ }
592
+ if (__VLS_ctx.showDelete !== false) {
593
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
594
+ ...{ class: "flex items-center text-red-500 hover:text-red-700 cursor-pointer" },
595
+ });
596
+ ;
597
+ ;
598
+ ;
599
+ ;
600
+ ;
601
+ let __VLS_73;
602
+ Popconfirm;
603
+ const __VLS_74 = __VLS_asFunctionalComponent1(__VLS_73, new __VLS_73({
604
+ ...{ 'onConfirm': {} },
605
+ ...{ 'onCancel': {} },
606
+ open: (__VLS_ctx.confirmIndex(index)),
607
+ cancelText: (__VLS_ctx.$t('webui.common.no')),
608
+ okText: (__VLS_ctx.$t('webui.common.yes')),
609
+ title: (__VLS_ctx.$t('webui.components.form.upload.deleteConfirm')),
610
+ okButtonProps: ({ size: 'small' }),
611
+ cancelButtonProps: ({ size: 'small' }),
612
+ }));
613
+ const __VLS_75 = __VLS_74({
614
+ ...{ 'onConfirm': {} },
615
+ ...{ 'onCancel': {} },
616
+ open: (__VLS_ctx.confirmIndex(index)),
617
+ cancelText: (__VLS_ctx.$t('webui.common.no')),
618
+ okText: (__VLS_ctx.$t('webui.common.yes')),
619
+ title: (__VLS_ctx.$t('webui.components.form.upload.deleteConfirm')),
620
+ okButtonProps: ({ size: 'small' }),
621
+ cancelButtonProps: ({ size: 'small' }),
622
+ }, ...__VLS_functionalComponentArgsRest(__VLS_74));
623
+ let __VLS_78;
624
+ const __VLS_79 = ({ confirm: {} },
625
+ { onConfirm: (...[$event]) => {
626
+ if (!(__VLS_ctx.showDelete !== false))
627
+ return;
628
+ __VLS_ctx.removeFile(index);
629
+ [$t, $t, $t, showDelete, confirmIndex, removeFile,];
630
+ } });
631
+ const __VLS_80 = ({ cancel: {} },
632
+ { onCancel: (...[$event]) => {
633
+ if (!(__VLS_ctx.showDelete !== false))
634
+ return;
635
+ __VLS_ctx.delIndex = -1;
636
+ [delIndex,];
637
+ } });
638
+ const { default: __VLS_81 } = __VLS_76.slots;
639
+ let __VLS_82;
640
+ Tooltip;
641
+ const __VLS_83 = __VLS_asFunctionalComponent1(__VLS_82, new __VLS_82({
642
+ title: (__VLS_ctx.$t('webui.common.delete')),
643
+ }));
644
+ const __VLS_84 = __VLS_83({
645
+ title: (__VLS_ctx.$t('webui.common.delete')),
646
+ }, ...__VLS_functionalComponentArgsRest(__VLS_83));
647
+ const { default: __VLS_87 } = __VLS_85.slots;
648
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({
649
+ ...{ onClick: (...[$event]) => {
650
+ if (!(__VLS_ctx.showDelete !== false))
651
+ return;
652
+ __VLS_ctx.confirmDelFile(index, file.status);
653
+ [$t, confirmDelFile,];
654
+ } },
655
+ });
656
+ let __VLS_88;
657
+ ToolIcon;
658
+ const __VLS_89 = __VLS_asFunctionalComponent1(__VLS_88, new __VLS_88({
659
+ icon: "icon-new",
660
+ angle: (45),
661
+ clickable: true,
662
+ }));
663
+ const __VLS_90 = __VLS_89({
664
+ icon: "icon-new",
665
+ angle: (45),
666
+ clickable: true,
667
+ }, ...__VLS_functionalComponentArgsRest(__VLS_89));
668
+ __VLS_asFunctionalDirective(__VLS_directives.vAuth, {})(null, { ...__VLS_directiveBindingRestFields, value: ({ role: ['Super', 'Admin'], permit: ':uploadlist:delete' }) }, null, null);
669
+ if (__VLS_ctx.showActionText) {
670
+ __VLS_asFunctionalElement1(__VLS_intrinsics.span, __VLS_intrinsics.span)({
671
+ ...{ class: "text-sm text-nowrap" },
672
+ });
673
+ __VLS_asFunctionalDirective(__VLS_directives.vAuth, {})(null, { ...__VLS_directiveBindingRestFields, value: ({ role: ['Super', 'Admin'], permit: ':uploadlist:delete' }) }, null, null);
674
+ ;
675
+ ;
676
+ (__VLS_ctx.$t('webui.common.delete'));
677
+ }
678
+ [vAuth, vAuth, $t, showActionText,];
679
+ var __VLS_85;
680
+ [];
681
+ var __VLS_76;
682
+ var __VLS_77;
683
+ }
684
+ if (file.status !== __VLS_ctx.UploadStatus.Online &&
685
+ file.status !== __VLS_ctx.UploadStatus.Offline &&
686
+ file.status !== __VLS_ctx.UploadStatus.Success) {
687
+ __VLS_asFunctionalElement1(__VLS_intrinsics.div, __VLS_intrinsics.div)({});
688
+ let __VLS_93;
689
+ Progress;
690
+ const __VLS_94 = __VLS_asFunctionalComponent1(__VLS_93, new __VLS_93({
691
+ percent: (file.percent),
692
+ strokeWidth: (2),
693
+ showInfo: (false),
694
+ ...{ style: {} },
695
+ }));
696
+ const __VLS_95 = __VLS_94({
697
+ percent: (file.percent),
698
+ strokeWidth: (2),
699
+ showInfo: (false),
700
+ ...{ style: {} },
701
+ }, ...__VLS_functionalComponentArgsRest(__VLS_94));
702
+ }
703
+ [UploadStatus, UploadStatus, UploadStatus,];
704
+ }
705
+ var __VLS_6 = __VLS_5, __VLS_20 = __VLS_19;
706
+ [];
707
+ const __VLS_export = (await import('vue')).defineComponent({
708
+ emits: {},
709
+ __typeProps: {},
710
+ props: {},
711
+ });
712
+ export default {};
713
+ //# sourceMappingURL=uploadList.vue.js.map