icve-urc 1.0.0

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 (57) hide show
  1. package/README.en.md +36 -0
  2. package/README.md +24 -0
  3. package/dist/demo.html +10 -0
  4. package/dist/icve-urc.common.js +114103 -0
  5. package/dist/icve-urc.common.js.map +1 -0
  6. package/dist/icve-urc.css +1 -0
  7. package/dist/icve-urc.umd.js +114113 -0
  8. package/dist/icve-urc.umd.js.map +1 -0
  9. package/dist/icve-urc.umd.min.js +75 -0
  10. package/dist/icve-urc.umd.min.js.map +1 -0
  11. package/package.json +33 -0
  12. package/src/App copy.vue +116 -0
  13. package/src/App.vue +125 -0
  14. package/src/api/resourceManagement/index.js +33 -0
  15. package/src/assets/img/error.png +0 -0
  16. package/src/assets/img/file.png +0 -0
  17. package/src/assets/img/icon-pic.png +0 -0
  18. package/src/assets/img/icon_audio.png +0 -0
  19. package/src/assets/img/icon_excel.png +0 -0
  20. package/src/assets/img/icon_other.png +0 -0
  21. package/src/assets/img/icon_pdf.png +0 -0
  22. package/src/assets/img/icon_ppt.png +0 -0
  23. package/src/assets/img/icon_txt_s.png +0 -0
  24. package/src/assets/img/icon_vedio.png +0 -0
  25. package/src/assets/img/icon_word.png +0 -0
  26. package/src/assets/img/icon_zip.png +0 -0
  27. package/src/assets/img/loading.gif +0 -0
  28. package/src/assets/logo.png +0 -0
  29. package/src/assets/styles/btn.scss +99 -0
  30. package/src/assets/styles/element-ui.scss +92 -0
  31. package/src/assets/styles/element-variables.scss +31 -0
  32. package/src/assets/styles/icon/demo.css +539 -0
  33. package/src/assets/styles/icon/demo_index.html +556 -0
  34. package/src/assets/styles/icon/iconfont.css +79 -0
  35. package/src/assets/styles/icon/iconfont.js +1 -0
  36. package/src/assets/styles/icon/iconfont.json +121 -0
  37. package/src/assets/styles/icon/iconfont.ttf +0 -0
  38. package/src/assets/styles/icon/iconfont.woff +0 -0
  39. package/src/assets/styles/icon/iconfont.woff2 +0 -0
  40. package/src/assets/styles/index.scss +252 -0
  41. package/src/assets/styles/mixin.scss +66 -0
  42. package/src/assets/styles/ruoyi.scss +273 -0
  43. package/src/assets/styles/sidebar.scss +249 -0
  44. package/src/assets/styles/transition.scss +53 -0
  45. package/src/assets/styles/variables.scss +54 -0
  46. package/src/components/AliPlayer.vue +158 -0
  47. package/src/components/Pagination/index.vue +119 -0
  48. package/src/components/fileImport.vue +466 -0
  49. package/src/components/filePreview.vue +670 -0
  50. package/src/components/fileUpload.vue +752 -0
  51. package/src/components/treeCompontent.vue +277 -0
  52. package/src/main.js +26 -0
  53. package/src/router/index.js +22 -0
  54. package/src/utils/auth.js +15 -0
  55. package/src/utils/errorCode.js +6 -0
  56. package/src/utils/request.js +63 -0
  57. package/src/utils/scroll-to.js +58 -0
@@ -0,0 +1,752 @@
1
+ <template>
2
+ <!-- 文件上传组件容器 -->
3
+ <div class="dashboard-editor-container">
4
+ <!-- 文件上传组件 -->
5
+ <el-upload
6
+ class="upload-demo"
7
+ action=""
8
+ ref="upload"
9
+ :file-list="fileList"
10
+ multiple
11
+ :limit="100"
12
+ :show-file-list="false"
13
+ :on-change="handleChange"
14
+ :on-remove="handleRemove"
15
+ :auto-upload="false"
16
+ :data="paramsData"
17
+ drag
18
+ >
19
+ <i class="el-icon-upload"></i>
20
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
21
+ </el-upload>
22
+ <div class="checkbox">
23
+ <el-checkbox v-model="checked"> </el-checkbox>
24
+ <span>我已阅读并同意 <i @click="open = true">《文件上传须知》</i></span>
25
+ </div>
26
+ <!-- 文件列表滚动区域 -->
27
+ <div class="wenjian">
28
+ <!-- 文件列表过渡动画 -->
29
+ <transition-group
30
+ class="upload-file-list el-upload-list el-upload-list--text"
31
+ name="el-fade-in-linear"
32
+ tag="ul"
33
+ >
34
+ <!-- 文件列表项 -->
35
+ <li
36
+ :key="index"
37
+ class="active1"
38
+ v-for="(file, index) in fileList"
39
+ @click="qiehuan(file, index)"
40
+ style="padding: 6px 0"
41
+ >
42
+ <!-- 文件信息顶部区域 -->
43
+ <div class="top">
44
+ <!-- 文件名称链接 -->
45
+ <el-link :underline="false">
46
+ <!-- 文件名称提示 -->
47
+ <el-tooltip
48
+ class="item"
49
+ effect="light"
50
+ :content="file.name"
51
+ placement="bottom"
52
+ :open-delay="1000"
53
+ >
54
+ <span class="el-icon-document">
55
+ {{ index + 1 }}.{{ file.name }}</span
56
+ >
57
+ </el-tooltip>
58
+ </el-link>
59
+ <!-- 删除按钮区域 -->
60
+ <div class="ele-upload-list__item-content-action">
61
+ <!-- 删除按钮提示 -->
62
+ <el-tooltip
63
+ class="item"
64
+ effect="light"
65
+ content="删除"
66
+ placement="bottom"
67
+ :open-delay="1000"
68
+ >
69
+ <i class="el-icon-close" @click.stop="removeFile(index)"></i>
70
+ </el-tooltip>
71
+ </div>
72
+ </div>
73
+ <!-- 上传进度条 -->
74
+ <el-progress
75
+ v-show="progressShow"
76
+ :percentage="num == index ? percentage : num > index ? 100 : 0"
77
+ ></el-progress>
78
+ </li>
79
+ </transition-group>
80
+ </div>
81
+ <el-dialog
82
+ :visible.sync="open"
83
+ title="文件上传须知"
84
+ width="800px"
85
+ center
86
+ :modal="false"
87
+ >
88
+ <div class="main">
89
+ <h3>上传须知</h3>
90
+ <p>
91
+ 1.根据国家《出版管理条例》《网络出版服务管理规定》及教育部《职业教育专业教学资源库建设工作手册》等相关规定,上传的资源必须符合以下要求:
92
+ </p>
93
+ <p>
94
+ (1)没有法律、法规禁止出版的内容,没有政治性、道德性问题和科学性错误,不泄露国家秘密。
95
+ </p>
96
+ <p>
97
+ (2)不含有侵犯他人著作权、肖像权、名誉权等权益的内容,资源具有原创性,引用需指明作者姓名、作品名称,使用他人作品应取得许可。
98
+ </p>
99
+ <p>
100
+ (3)采用法定计量单位,名词、术语、符号等符合国家统一规定,尚无统一规定的,可采用习惯用法并保持一致。
101
+ </p>
102
+ <p>
103
+ (4)地图具有严肃的政治性、严密的科学性和严格的法定性,使用的地图应根据《地图管理条例》的要求已送相关部门审核并标注审图号。
104
+ </p>
105
+ <p>2.本系统目前支持以下格式资源:</p>
106
+ <p>文本类:doc docx xls xlsx pdf txt ppt pptx</p>
107
+ <p>音视频:m4v mp3 mp4</p>
108
+ <p>图片:jpg jpeg png bmp gif</p>
109
+ <p>模型:fbx glb obj stl</p>
110
+ <p>压缩包:7z rar tar zip</p>
111
+ </div>
112
+ <span slot="footer" class="dialog-footer">
113
+ <el-button
114
+ class="bcsc"
115
+ @click="
116
+ open = false;
117
+ checked = true;
118
+ "
119
+ >我已阅读并同意</el-button
120
+ >
121
+ <el-button @click="open = false">取 消</el-button>
122
+ </span>
123
+ </el-dialog>
124
+ </div>
125
+ </template>
126
+ <script>
127
+ import { getStsMessage, getUploadToken } from "@/api/resourceManagement";
128
+ import { getToken } from "@/utils/auth";
129
+ import axios from "axios";
130
+ import SparkMD5 from "spark-md5"; // 引入MD5计算库
131
+ let uuid = require("uuid"); // 引入uuid生成器
132
+ let OSS = require("ali-oss"); // 引入阿里云OSS SDK
133
+ const parallel = 5; // 同时上传的分片数
134
+ const partSize = 1024 * 1024 * 10; // 每个分片大小(10MB)
135
+ const partSizeTwo = 1024 * 1024 * 2; // 2MB分片大小
136
+ export default {
137
+ name: "FileUpload",
138
+ // 组件属性
139
+ props: {
140
+ space: [Number], // 空间大小
141
+ allSpace: [Number], // 总空间大小
142
+ productId: {
143
+ type: String,
144
+ default: "",
145
+ }, // 产品ID
146
+ userId: {
147
+ type: String,
148
+ default: "",
149
+ }, // 用户ID
150
+ params: {
151
+ type: String,
152
+ default: "",
153
+ }, // 上传参数
154
+ },
155
+ watch: {
156
+ params: {
157
+ handler(newVal) {
158
+ this.uploadToken.params = newVal;
159
+ this.getOssUploadToken();
160
+ },
161
+ },
162
+ immediate: true,
163
+ },
164
+ // 组件数据
165
+ data() {
166
+ return {
167
+ localSpace: this.space, // 本地空间
168
+ localAllSpace: this.allSpace, // 本地总空间
169
+ open: false, // 打开须知
170
+ button_to_disable: false, // 按钮禁用状态
171
+ arr: [], // 文件数组
172
+ file_system_url: "", // 文件系统URL
173
+ signature: "", // 签名信息
174
+ paramsData: {}, // 上传参数
175
+ aListOfShards: [], // 分片列表
176
+ total: 0, // 总数
177
+ jzShow: false, // 加载显示
178
+ progressShow: false, // 进度条显示
179
+ dialogVisible: false, // 对话框显示
180
+ fileList: [], // 文件列表
181
+ checked: false, // 选中状态
182
+ qxchecked: false, // 取消选中状态
183
+ file: null, // 当前文件
184
+ tempCheckpoint: null, // 临时检查点
185
+ uploadId: "", // 上传ID
186
+ uploadStatus: null, // 上传状态
187
+ percentage: 0, // 上传进度
188
+ uploadName: "", // 上传文件名
189
+ isLoad: false, // 加载状态
190
+ partNumber: 1, // 分片序号
191
+ num: 0, // 当前序号
192
+ idx: null, // 索引
193
+ workType: "", // 工作类型
194
+ size: "", // 文件大小
195
+ all: 0, // 总计
196
+ client: null, // OSS客户端
197
+ CallbackUrl: "", // 回调URL
198
+ fileType: [
199
+ "fbx",
200
+ "glb",
201
+ "obj",
202
+ "stl",
203
+ "7z",
204
+ "rar",
205
+ "tar",
206
+ "zip",
207
+ "jpg",
208
+ "jpeg",
209
+ "png",
210
+ "ziph",
211
+ "bmp",
212
+ "gif",
213
+ "m4v",
214
+ "mp3",
215
+ "mp4",
216
+ "doc",
217
+ "docx",
218
+ "xls",
219
+ "xlsx",
220
+ "pdf",
221
+ "txt",
222
+ "ppt",
223
+ "pptx",
224
+ "html",
225
+ ],
226
+ tokenInterval: null, // token刷新定时器
227
+ uploadToken: {
228
+ product_id: this.productId,
229
+ user_id: this.userId,
230
+ params: this.params,
231
+ }, // 上传凭证
232
+ multipartUploadParams: {}, // 分片参数
233
+ multipartSpace: null, // 分片参数
234
+ };
235
+ },
236
+ // 生命周期钩子
237
+ created() {
238
+ // 初始化空间大小
239
+ this.total = this.localSpace;
240
+ this.getOssUploadToken();
241
+ },
242
+ // 组件销毁时清除定时器
243
+ destroyed() {
244
+ if (this.tokenInterval) {
245
+ clearInterval(this.tokenInterval);
246
+ this.tokenInterval = null;
247
+ }
248
+ },
249
+ // 组件方法
250
+ methods: {
251
+ // 获取上传凭证
252
+ async getOssUploadToken() {
253
+ // 定义获取token的函数
254
+ const getTokenInterval = () => {
255
+ // 获取上传token
256
+ getStsMessage(this.uploadToken).then((res) => {
257
+ if ((res.code = 200)) {
258
+ this.CallbackUrl = res.data.callbackUrl;
259
+ this.multipartUploadParams = res.data.callback;
260
+ this.multipartSpace = res.data.dir;
261
+ // 初始化OSS客户端
262
+ this.client = new OSS({
263
+ region: "oss-cn-hangzhou",
264
+ accessKeyId: res.data.accessKeyId,
265
+ accessKeySecret: res.data.accessKeySecret,
266
+ stsToken: res.data.securityToken,
267
+ bucket: "icve",
268
+ });
269
+ }
270
+ });
271
+
272
+ // 获取上传签名
273
+ getUploadToken(this.uploadToken).then((res) => {
274
+ if (res.code == 200) {
275
+ this.file_system_url = res.data.file_system_url;
276
+ this.signature = res.data.signature;
277
+ this.paramsData = {
278
+ key: this.signature.dir + "/" + this.signature.random + "/",
279
+ policy: this.signature.policy,
280
+ OSSAccessKeyId: this.signature.accessId,
281
+ identity: this.signature.identity,
282
+ success_action_status: "200",
283
+ callback: this.signature.callback,
284
+ signature: this.signature.signature,
285
+ agent: this.signature.agent,
286
+ ip: this.signature.ip,
287
+ "x:space": this.signature.spaceName,
288
+ "x:identity": this.signature.identity,
289
+ };
290
+ }
291
+ });
292
+ };
293
+
294
+ // 初始获取token
295
+ getTokenInterval();
296
+
297
+ // 设置定时刷新token(30分钟)
298
+ this.tokenInterval = setInterval(getTokenInterval, 30 * 60 * 1000);
299
+ },
300
+ // 删除文件
301
+ removeFile(idx) {
302
+ this.$confirm("确定移除该文件?", "删除", {
303
+ confirmButtonText: "确定",
304
+ cancelButtonText: "取消",
305
+ type: "warning",
306
+ }).then(() => {
307
+ this.fileList.splice(idx, 1);
308
+ });
309
+ },
310
+
311
+ // 提交上传
312
+ submitForm() {
313
+ if (!this.checked) {
314
+ this.$message.warning("请先阅读并同意《文件上传须知》");
315
+ return;
316
+ }
317
+ if (this.fileList.length === 0) {
318
+ return this.$message.warning("请选择文件!");
319
+ }
320
+ if (this.jzShow) {
321
+ return this.$message.warning("文件正在上传中,请勿重复提交!");
322
+ }
323
+ // 检查空间是否足够
324
+ // if (this.localSpace > this.localAllSpace) {
325
+ // this.fileList = []
326
+ // this.localSpace = this.total
327
+ // return this.$message.warning('存储空间不足请重新选择文件!')
328
+ // }
329
+ this.num = 0;
330
+ this.jzShow = true;
331
+ this.progressShow = true;
332
+ this.button_to_disable = true;
333
+ this.recursion(this.fileList);
334
+ },
335
+
336
+ // 递归上传文件
337
+ async recursion(ipArr) {
338
+ var str = "";
339
+ var flag = false;
340
+ // 判断是否需要分片上传
341
+ let imgSize = Number(ipArr[this.num].raw.size / 1024 / 1024);
342
+ if (imgSize > 100) {
343
+ // 大文件分片上传
344
+ await this.multipartUpload(ipArr[this.num]);
345
+ this.num++;
346
+ if (this.num < ipArr.length) {
347
+ this.recursion(ipArr);
348
+ } else {
349
+ if (this.arr.length > 0) {
350
+ for (let i = 0; i < this.arr.length; i++) {
351
+ str = str + this.arr[i] + ",";
352
+ }
353
+ this.arr = [];
354
+ flag = true;
355
+ } else {
356
+ this.$message.success("上传成功");
357
+ }
358
+ setTimeout(() => {
359
+ this.clear();
360
+ this.$emit("theUploadIsComplete", flag, str);
361
+ }, 200);
362
+ }
363
+ } else {
364
+ // 小文件普通上传
365
+ await this.commonUpload(ipArr[this.num]).then(() => {
366
+ this.num++;
367
+ if (this.num < ipArr.length) {
368
+ this.recursion(ipArr);
369
+ } else {
370
+ if (this.arr.length > 0) {
371
+ for (let i = 0; i < this.arr.length; i++) {
372
+ str = str + this.arr[i] + ",";
373
+ }
374
+ this.arr = [];
375
+ flag = true;
376
+ } else {
377
+ this.$message.success("上传成功");
378
+ }
379
+ setTimeout(() => {
380
+ this.clear();
381
+ this.$emit("theUploadIsComplete", flag, str);
382
+ }, 200);
383
+ }
384
+ });
385
+ }
386
+ },
387
+ // 上传成功清除数据
388
+ clear() {
389
+ this.jzShow = false;
390
+ this.checked = false;
391
+ this.num = 0;
392
+ this.fileList = [];
393
+ },
394
+
395
+ // 普通上传方法
396
+ async commonUpload(file, idx) {
397
+ const formData = new FormData();
398
+ const obj = JSON.parse(JSON.stringify(this.paramsData));
399
+ obj.key = obj.key + file.raw.name;
400
+ formData.append("key", obj.key);
401
+ formData.append("policy", obj.policy);
402
+ formData.append("OSSAccessKeyId", obj.OSSAccessKeyId);
403
+ formData.append("success_action_status", obj.success_action_status);
404
+ formData.append("callback", obj.callback);
405
+ formData.append("signature", obj.signature);
406
+ formData.append("x:space", obj["x:space"]);
407
+ formData.append("x:identity", obj["x:identity"]);
408
+ formData.append("x:agent", obj.agent);
409
+ formData.append("x:ip", obj.ip);
410
+ formData.append("x:product_id", this.uploadToken.product_id);
411
+ formData.append("x:user_id", this.uploadToken.user_id);
412
+ if (this.uploadToken.params !== "") {
413
+ let uploadToken = JSON.parse(this.uploadToken.params);
414
+ // 循环遍历paramsData对象的属性
415
+ for (let key in uploadToken) {
416
+ formData.append(`x:${key}`, uploadToken[key]);
417
+ }
418
+ }
419
+ formData.append("file", file.raw);
420
+ this.percentage = 0;
421
+ this.isLoad = true;
422
+
423
+ // 发起上传请求
424
+ let { data } = await axios({
425
+ headers: {
426
+ Accept: "*/*",
427
+ token: getToken(),
428
+ },
429
+ method: "post",
430
+ url: this.file_system_url,
431
+ data: formData,
432
+ onUploadProgress: (progressEvent) => {
433
+ if (progressEvent.lengthComputable) {
434
+ this.percentage =
435
+ parseInt((progressEvent.loaded / progressEvent.total) * 100) || 0;
436
+ }
437
+ },
438
+ });
439
+ if (data.code == 1) {
440
+ const result = data;
441
+ this.percentage = 100;
442
+ result.customName = file.raw.name;
443
+ result.size = file.raw.size;
444
+ await this.$emit("successUpLoad", result, file.workType, file.size);
445
+ } else if (data.code == -1) {
446
+ this.percentage = 0;
447
+ this.arr.push(file.name);
448
+ }
449
+ this.percentage = 0;
450
+ this.isLoad = false;
451
+ },
452
+ // 分片上传方法
453
+ async multipartUpload(file, ipArr) {
454
+ this.percentage = 0;
455
+ let params = {};
456
+ if (this.uploadToken.params !== "") {
457
+ let uploadToken = JSON.parse(this.uploadToken.params);
458
+ for (let key in uploadToken) {
459
+ params[`x:${key}`] = uploadToken[key];
460
+ }
461
+ }
462
+ this.uploadStatus = null;
463
+ this.multipartUploadParams.customValue.file_name = file.raw.name;
464
+ // console.log(this.multipartUploadParams, "this.multipartUploadParams");
465
+ try {
466
+ this.isLoad = true;
467
+ let result = await this.client.multipartUpload(
468
+ `${this.multipartSpace}/${uuid
469
+ .v1()
470
+ .replace(/-/g, "")}.${file.raw.name.substring(
471
+ file.raw.name.lastIndexOf(".") + 1
472
+ )}`,
473
+ file.raw,
474
+ {
475
+ partSize,
476
+ parallel,
477
+ progress: (p, checkpoint) => {
478
+ if (p == 1) {
479
+ }
480
+ if (p != 0 && p != 100) {
481
+ this.percentage = parseInt(Number(p * 100));
482
+ } else {
483
+ this.percentage = parseInt(p * 100);
484
+ }
485
+ },
486
+ callback: this.multipartUploadParams,
487
+ }
488
+ );
489
+ this.isLoad = false;
490
+ if (result.data.code == 1) {
491
+ this.percentage = 100;
492
+ result.data.customName = file.raw.name;
493
+ result.data.size = file.raw.size;
494
+ await this.$emit(
495
+ "successUpLoad",
496
+ result.data,
497
+ file.workType,
498
+ file.size
499
+ );
500
+ } else if (result.code == -1) {
501
+ this.percentage = 0;
502
+ this.arr.push(file.name);
503
+ }
504
+ } catch (e) {
505
+ this.arr.push(file.name);
506
+ this.isLoad = false;
507
+ this.percentage = 0;
508
+ if (e.code === "ConnectionTimeoutError") {
509
+ this.uploadStatus = "exception";
510
+ }
511
+ }
512
+ // await this.fileMd5Sum(file.raw)
513
+ // .then(async (md5) => {})
514
+ // .catch(() => {
515
+ // this.percentage = 0
516
+ // this.arr.push(file.raw.name)
517
+ // })
518
+ },
519
+ // 计算文件MD5
520
+ fileMd5Sum(file) {
521
+ return new Promise((resolve, reject) => {
522
+ const fileReader = new FileReader();
523
+ const chunkSize = 1024 * 1024 * 2; //2MB分片
524
+ const chunks = Math.ceil(file.size / chunkSize);
525
+ let currentChunk = 0;
526
+ var spark = new SparkMD5.ArrayBuffer();
527
+
528
+ const loadFile = (e) => {
529
+ spark.append(e.target.result);
530
+ currentChunk++;
531
+ if (currentChunk < chunks) {
532
+ loadNext();
533
+ } else {
534
+ const md5 = spark.end();
535
+ resolve(md5);
536
+ }
537
+ };
538
+
539
+ const loadError = () => {
540
+ reject("compute file md5 error");
541
+ };
542
+
543
+ const loadNext = () => {
544
+ fileReader.onload = loadFile;
545
+ fileReader.onerror = loadError;
546
+ const start = currentChunk * chunkSize;
547
+ const end =
548
+ start + chunkSize >= file.size ? file.size : start + chunkSize;
549
+ const data = file.slice(start, end);
550
+ fileReader.readAsArrayBuffer(data);
551
+ };
552
+
553
+ loadNext();
554
+ });
555
+ },
556
+ // 文件选择变化处理
557
+ handleChange(file, fileList) {
558
+ this.file = file.raw;
559
+ let types = this.file.name;
560
+ let fileIndex = types.lastIndexOf(".") + 1;
561
+ let workType = types.substring(fileIndex);
562
+ // 转换为小写
563
+ workType = workType.toLowerCase();
564
+ // 检查文件类型
565
+ let typeFlag = this.fileType.includes(workType);
566
+ if (!typeFlag) {
567
+ this.isLoad = false;
568
+ this.$message.error("当前作品项请上传" + this.fileType + "格式文件。");
569
+ return false;
570
+ } else {
571
+ file.workType = workType;
572
+ file.size = this.getFileSize(this.file.size);
573
+ this.fileList.push(file);
574
+
575
+ // 文件列表去重
576
+ let map = new Map();
577
+ for (let item of this.fileList) {
578
+ if (!map.has(item.id)) {
579
+ map.set(item.name, item);
580
+ }
581
+ }
582
+ this.fileList = [...map.values()];
583
+
584
+ // 计算总空间
585
+ this.fileList.forEach((i) => {
586
+ this.localSpace = this.localSpace + i.raw.size;
587
+ });
588
+ }
589
+ },
590
+
591
+ // 移除文件
592
+ handleRemove(file, fileList) {
593
+ this.fileList = [];
594
+ this.percentage = 0;
595
+ },
596
+
597
+ // 文件大小格式化
598
+ getFileSize(val) {
599
+ if (!val) return "";
600
+ if (val < 102.4) {
601
+ return val + " B";
602
+ }
603
+ let num = val / 1024;
604
+ if (num > 1024) {
605
+ num = num / 1024;
606
+ return num.toFixed(2) + " M";
607
+ } else {
608
+ return num.toFixed(2) + " K";
609
+ }
610
+ },
611
+ },
612
+ };
613
+ </script>
614
+ <style lang="scss">
615
+ .el-progress-bar__outer {
616
+ width: 100%;
617
+ }
618
+
619
+ .el-progress-bar {
620
+ position: relative;
621
+ }
622
+
623
+ .el-progress__text {
624
+ position: absolute;
625
+ right: 0;
626
+ top: 1px;
627
+ }
628
+
629
+ .el-scrollbar__wrap {
630
+ overflow-x: hidden;
631
+ }
632
+ </style>
633
+ <style lang="scss" scoped>
634
+ .checkbox {
635
+ margin-top: 10px;
636
+ display: flex;
637
+ justify-content: end;
638
+ }
639
+
640
+ .upload-file-list {
641
+ .el-link {
642
+ width: 100%;
643
+ justify-content: start;
644
+ }
645
+ li {
646
+ position: relative;
647
+ display: flex;
648
+ flex-direction: column;
649
+ margin-bottom: 10px;
650
+ }
651
+
652
+ .active1 {
653
+ padding: 5px 10px !important;
654
+ margin-bottom: 10px;
655
+ ::v-deep .el-link--inner {
656
+ display: block;
657
+ width: 100%;
658
+ }
659
+ span {
660
+ line-height: normal;
661
+ width: 90%;
662
+ color: rgba(0, 0, 0, 1);
663
+ overflow: hidden;
664
+ white-space: nowrap;
665
+ text-overflow: ellipsis;
666
+ }
667
+ }
668
+
669
+ .top {
670
+ margin-top: 10px;
671
+ display: flex;
672
+ justify-content: space-between;
673
+ align-items: center;
674
+ }
675
+
676
+ .progress {
677
+ width: 100%;
678
+ height: 20px;
679
+ }
680
+
681
+ .active {
682
+ background: #e72021;
683
+ padding: 5px 10px !important;
684
+ margin-bottom: 10px;
685
+
686
+ span {
687
+ color: #fff !important;
688
+ width: 180px;
689
+ overflow: hidden;
690
+ white-space: nowrap;
691
+ text-overflow: ellipsis;
692
+ }
693
+
694
+ .ele-upload-list__item-content-action {
695
+ color: #fff;
696
+ }
697
+ }
698
+ }
699
+ .checkbox {
700
+ display: flex;
701
+ justify-content: start;
702
+ align-items: center;
703
+ span {
704
+ padding-left: 10px;
705
+ font-size: 16px;
706
+ color: #666666;
707
+ i {
708
+ color: #3e7bfa;
709
+ cursor: pointer;
710
+ }
711
+ }
712
+ }
713
+ .bcsc {
714
+ background: #3e7bfa;
715
+ border: none;
716
+ border-radius: 8px;
717
+ color: #fff;
718
+ }
719
+ .button-box {
720
+ display: flex;
721
+ justify-content: center;
722
+ margin-top: 30px;
723
+ .bcsc {
724
+ width: 112px;
725
+ height: 42px;
726
+ background: #3e7bfa;
727
+ border: none;
728
+ border-radius: 8px;
729
+ color: #fff;
730
+ }
731
+ .qx {
732
+ width: 112px;
733
+ height: 42px;
734
+ background: rgba(62, 123, 250, 0);
735
+ border-radius: 8px;
736
+ border: 1px solid #dddddd;
737
+ }
738
+ }
739
+ ::v-deep .el-upload {
740
+ width: 100%;
741
+ .el-upload-dragger {
742
+ width: 100%;
743
+ }
744
+ }
745
+ ::v-deep .el-upload-list .el-upload-list--text {
746
+ background-color: #f7f7f7;
747
+ }
748
+
749
+ ::v-deep .el-upload-list__item-name {
750
+ background-color: #f7f7f7;
751
+ }
752
+ </style>