lw-cdp-ui 1.1.68 → 1.1.69
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/dist/components/lwUpload/index.vue +134 -123
- package/dist/lw-cdp-ui.esm.js +793 -791
- package/dist/lw-cdp-ui.umd.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +54 -54
- package/dist/static/images/404.png +0 -0
- package/dist/static/images/logo2.png +0 -0
- package/dist/static/images/logo4.svg +0 -73
- package/dist/static/images/video-bg.mp4 +0 -0
- package/dist/static/images/video-poster.png +0 -0
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
:class="{ 'lw-upload-round': round }">
|
|
4
4
|
<div class="view-img-list">
|
|
5
5
|
<template v-for="(f, index) in fileList">
|
|
6
|
+
<!-- 图片显示 -->
|
|
6
7
|
<div class="lw-upload__img"
|
|
7
8
|
:style="style">
|
|
8
|
-
<el-image
|
|
9
|
+
<el-image v-if="accept.indexOf('image') > -1"
|
|
10
|
+
class="image"
|
|
9
11
|
:src="getShowValue(f)"
|
|
10
12
|
:preview-src-list="fileList"
|
|
11
13
|
fit="cover"
|
|
@@ -18,6 +20,11 @@
|
|
|
18
20
|
</div>
|
|
19
21
|
</template>
|
|
20
22
|
</el-image>
|
|
23
|
+
|
|
24
|
+
<video v-if="accept.indexOf('video') > -1"
|
|
25
|
+
:src="
|
|
26
|
+
getShowValue(f)"
|
|
27
|
+
controls></video>
|
|
21
28
|
<div class="lw-upload__img-actions"
|
|
22
29
|
v-if="!disabled">
|
|
23
30
|
<span class="del"
|
|
@@ -54,24 +61,20 @@
|
|
|
54
61
|
</el-icon>
|
|
55
62
|
<h4 v-if="title">{{ title }}</h4>
|
|
56
63
|
</div>
|
|
64
|
+
<div v-if="file?.percentage"
|
|
65
|
+
:style="style"
|
|
66
|
+
class="lw-upload__progress">
|
|
67
|
+
<el-progress :percentage="file.percentage"
|
|
68
|
+
:text-inside="true"
|
|
69
|
+
:stroke-width="16" />
|
|
70
|
+
</div>
|
|
57
71
|
</div>
|
|
58
72
|
</slot>
|
|
59
73
|
</el-upload>
|
|
60
74
|
</div>
|
|
61
75
|
|
|
62
|
-
<div v-if="
|
|
63
|
-
class="
|
|
64
|
-
<div class="lw-upload__progress">
|
|
65
|
-
<el-progress :percentage="file.percentage"
|
|
66
|
-
:text-inside="true"
|
|
67
|
-
:stroke-width="16" />
|
|
68
|
-
</div>
|
|
69
|
-
<el-image class="image"
|
|
70
|
-
:src="file.tempFile"
|
|
71
|
-
fit="cover"></el-image>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<div v-if="tip" class="el-upload__tip">
|
|
76
|
+
<div v-if="tip"
|
|
77
|
+
class="el-upload__tip">
|
|
75
78
|
{{tip}}
|
|
76
79
|
</div>
|
|
77
80
|
</div>
|
|
@@ -231,7 +234,6 @@ export default {
|
|
|
231
234
|
}
|
|
232
235
|
},
|
|
233
236
|
before(file) {
|
|
234
|
-
console.log(file.type)
|
|
235
237
|
const acceptIncludes = this.accept.replace(/\s/g, "").split(",").includes(file.type)
|
|
236
238
|
if (!acceptIncludes) {
|
|
237
239
|
this.$notify.warning({
|
|
@@ -261,7 +263,7 @@ export default {
|
|
|
261
263
|
delete file.percentage
|
|
262
264
|
delete file.raw
|
|
263
265
|
delete file.response
|
|
264
|
-
delete file.status
|
|
266
|
+
// delete file.status
|
|
265
267
|
delete file.uid
|
|
266
268
|
var os = this.onSuccess(res, file)
|
|
267
269
|
if (os != undefined && os == false) {
|
|
@@ -297,7 +299,7 @@ export default {
|
|
|
297
299
|
},
|
|
298
300
|
error(err) {
|
|
299
301
|
this.$nextTick(() => {
|
|
300
|
-
this.
|
|
302
|
+
delete this.file.percentage
|
|
301
303
|
})
|
|
302
304
|
this.$notify.error({
|
|
303
305
|
title: '上传文件未成功',
|
|
@@ -308,13 +310,13 @@ export default {
|
|
|
308
310
|
let apiObj = this.apiObj || this.$api.auth.upload
|
|
309
311
|
const data = new FormData();
|
|
310
312
|
data.append(param.filename, param.file);
|
|
313
|
+
data.append('fileName', param.file.name);
|
|
311
314
|
for (const key in param.data) {
|
|
312
315
|
data.append(key, param.data[key]);
|
|
313
316
|
}
|
|
314
317
|
apiObj(data, {
|
|
315
318
|
onUploadProgress: e => {
|
|
316
|
-
|
|
317
|
-
param.onProgress({ percent: complete })
|
|
319
|
+
this.file.percentage = parseInt(((e.loaded / e.total) * 100) | 0, 10)
|
|
318
320
|
}
|
|
319
321
|
}).then(res => {
|
|
320
322
|
var response = this.parseData(res);
|
|
@@ -331,7 +333,6 @@ export default {
|
|
|
331
333
|
getShowValue(item) {
|
|
332
334
|
if (this.multiple) {
|
|
333
335
|
if (typeof this.returnFile == 'object') {
|
|
334
|
-
console.log(Object.keys(this.returnFile)[0])
|
|
335
336
|
return item[this.returnFile[Object.keys(this.returnFile)[0]]]
|
|
336
337
|
} else {
|
|
337
338
|
return item
|
|
@@ -349,141 +350,151 @@ export default {
|
|
|
349
350
|
border-color: var(--el-color-danger);
|
|
350
351
|
}
|
|
351
352
|
|
|
352
|
-
.lw-upload
|
|
353
|
-
border-radius: 0;
|
|
354
|
-
height: 100%;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
.lw-upload .uploader,
|
|
358
|
-
.lw-upload:deep(.el-upload) {
|
|
353
|
+
.lw-upload {
|
|
359
354
|
width: 100%;
|
|
360
|
-
height: 100%;
|
|
361
|
-
}
|
|
362
355
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
position: relative;
|
|
367
|
-
}
|
|
356
|
+
&.lw-upload-round {
|
|
357
|
+
border-radius: 50%;
|
|
358
|
+
overflow: hidden;
|
|
368
359
|
|
|
369
|
-
.
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}
|
|
360
|
+
.el-upload--picture-card {
|
|
361
|
+
border-radius: 50%;
|
|
362
|
+
}
|
|
373
363
|
|
|
374
|
-
.lw-upload__img-actions {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
}
|
|
364
|
+
.lw-upload__img-actions {
|
|
365
|
+
top: auto;
|
|
366
|
+
left: 0;
|
|
367
|
+
right: 0;
|
|
368
|
+
bottom: 0;
|
|
380
369
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
height: 25px;
|
|
387
|
-
cursor: pointer;
|
|
388
|
-
color: #fff;
|
|
389
|
-
}
|
|
370
|
+
span {
|
|
371
|
+
width: 100%;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
390
375
|
|
|
391
|
-
.
|
|
392
|
-
|
|
393
|
-
|
|
376
|
+
.el-upload--picture-card {
|
|
377
|
+
border-radius: 0;
|
|
378
|
+
height: 100%;
|
|
379
|
+
position: relative;
|
|
380
|
+
}
|
|
394
381
|
|
|
395
|
-
.
|
|
396
|
-
|
|
397
|
-
|
|
382
|
+
.uploader,
|
|
383
|
+
:deep(.el-upload) {
|
|
384
|
+
width: 100%;
|
|
385
|
+
height: 100%;
|
|
386
|
+
}
|
|
398
387
|
|
|
399
|
-
.
|
|
400
|
-
|
|
401
|
-
|
|
388
|
+
.file-empty {
|
|
389
|
+
width: 100%;
|
|
390
|
+
height: 100%;
|
|
391
|
+
display: flex;
|
|
392
|
+
justify-content: center;
|
|
393
|
+
align-items: center;
|
|
394
|
+
flex-direction: column;
|
|
402
395
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
396
|
+
i {
|
|
397
|
+
font-size: 28px;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
h4 {
|
|
401
|
+
font-size: 12px;
|
|
402
|
+
font-weight: normal;
|
|
403
|
+
color: #8c939d;
|
|
404
|
+
margin-top: 8px;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
411
407
|
}
|
|
412
408
|
|
|
413
|
-
.lw-
|
|
409
|
+
.lw-upload__img {
|
|
414
410
|
width: 100%;
|
|
415
411
|
height: 100%;
|
|
416
412
|
position: relative;
|
|
413
|
+
display: flex;
|
|
414
|
+
align-items: center;
|
|
415
|
+
justify-content: center;
|
|
416
|
+
|
|
417
|
+
.image {
|
|
418
|
+
width: 100%;
|
|
419
|
+
height: 100%;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
video {
|
|
423
|
+
background-color: #000;
|
|
424
|
+
width: 100%;
|
|
425
|
+
height: 100%;
|
|
426
|
+
object-fit: contain;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
&-actions {
|
|
430
|
+
position: absolute;
|
|
431
|
+
top: 0;
|
|
432
|
+
right: 0;
|
|
433
|
+
display: none;
|
|
434
|
+
|
|
435
|
+
span {
|
|
436
|
+
display: flex;
|
|
437
|
+
justify-content: center;
|
|
438
|
+
align-items: center;
|
|
439
|
+
width: 25px;
|
|
440
|
+
height: 25px;
|
|
441
|
+
cursor: pointer;
|
|
442
|
+
color: #fff;
|
|
443
|
+
|
|
444
|
+
i {
|
|
445
|
+
font-size: 12px;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
&.del {
|
|
449
|
+
background: #f56c6c;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
&:hover {
|
|
454
|
+
display: block;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
&-slot {
|
|
459
|
+
display: flex;
|
|
460
|
+
justify-content: center;
|
|
461
|
+
align-items: center;
|
|
462
|
+
width: 100%;
|
|
463
|
+
height: 100%;
|
|
464
|
+
font-size: 12px;
|
|
465
|
+
background-color: var(--el-fill-color-lighter);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
&-uploading .image {
|
|
469
|
+
width: 100%;
|
|
470
|
+
height: 100%;
|
|
471
|
+
}
|
|
417
472
|
}
|
|
418
473
|
|
|
419
474
|
.lw-upload__progress {
|
|
420
475
|
position: absolute;
|
|
476
|
+
top: 0;
|
|
477
|
+
left: 0;
|
|
421
478
|
width: 100%;
|
|
422
479
|
height: 100%;
|
|
423
480
|
display: flex;
|
|
424
481
|
justify-content: center;
|
|
425
482
|
align-items: center;
|
|
426
|
-
background-color:
|
|
483
|
+
background-color: rgba(#000, 0.4);
|
|
484
|
+
backdrop-filter: blur(10px);
|
|
427
485
|
z-index: 1;
|
|
428
486
|
padding: 10px;
|
|
429
|
-
}
|
|
430
487
|
|
|
431
|
-
.
|
|
432
|
-
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.lw-upload__uploading .image {
|
|
436
|
-
width: 100%;
|
|
437
|
-
height: 100%;
|
|
488
|
+
.el-progress {
|
|
489
|
+
width: 100%;
|
|
490
|
+
}
|
|
438
491
|
}
|
|
439
492
|
|
|
440
|
-
.lw-upload .file-empty {
|
|
441
|
-
width: 100%;
|
|
442
|
-
height: 100%;
|
|
443
|
-
display: flex;
|
|
444
|
-
justify-content: center;
|
|
445
|
-
align-items: center;
|
|
446
|
-
flex-direction: column;
|
|
447
|
-
}
|
|
448
|
-
.lw-upload {
|
|
449
|
-
width: 100%;
|
|
450
|
-
}
|
|
451
493
|
.view-img-list {
|
|
452
494
|
display: flex;
|
|
453
495
|
align-items: center;
|
|
454
496
|
flex-wrap: wrap;
|
|
455
497
|
gap: 10px;
|
|
456
|
-
// margin-bottom: 10px;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
.lw-upload .file-empty i {
|
|
460
|
-
font-size: 28px;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
.lw-upload .file-empty h4 {
|
|
464
|
-
font-size: 12px;
|
|
465
|
-
font-weight: normal;
|
|
466
|
-
color: #8c939d;
|
|
467
|
-
margin-top: 8px;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
.lw-upload.lw-upload-round {
|
|
471
|
-
border-radius: 50%;
|
|
472
|
-
overflow: hidden;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
.lw-upload.lw-upload-round .el-upload--picture-card {
|
|
476
|
-
border-radius: 50%;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
.lw-upload.lw-upload-round .lw-upload__img-actions {
|
|
480
|
-
top: auto;
|
|
481
|
-
left: 0;
|
|
482
|
-
right: 0;
|
|
483
|
-
bottom: 0;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
.lw-upload.lw-upload-round .lw-upload__img-actions span {
|
|
487
|
-
width: 100%;
|
|
488
498
|
}
|
|
489
499
|
</style>
|
|
500
|
+
|