|
|
|
@ -1,5 +1,4 @@
|
|
|
|
|
<template> |
|
|
|
|
|
|
|
|
|
<basic-container> |
|
|
|
|
<avue-crud |
|
|
|
|
:option="option" |
|
|
|
@ -257,7 +256,6 @@ export default {
|
|
|
|
|
const totalChunks = Math.ceil(file.size / CHUNK_SIZE); // 计算总分片数 |
|
|
|
|
let uploadedChunks = 0; // 已上传的分片数 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const overallStartTime = performance.now(); // 函数开始执行时的时间 |
|
|
|
|
for (let index = 0; index < totalChunks; index++) { |
|
|
|
|
const start = index * CHUNK_SIZE; |
|
|
|
@ -300,7 +298,6 @@ export default {
|
|
|
|
|
// 这里可以根据需要更新进度条或进度文本 |
|
|
|
|
|
|
|
|
|
if (index === totalChunks - 1) { |
|
|
|
|
|
|
|
|
|
const fileData = { |
|
|
|
|
fileName: file.name, |
|
|
|
|
totalChunks: totalChunks, |
|
|
|
@ -317,17 +314,24 @@ export default {
|
|
|
|
|
|
|
|
|
|
if (Stresponse.data.code === 200) { |
|
|
|
|
const overallEndTime = performance.now(); // 函数结束时的时间 |
|
|
|
|
const totalFunctionTime = (overallEndTime - overallStartTime) / 1000; // 总执行时间,转换为秒 |
|
|
|
|
const totalFunctionTime = |
|
|
|
|
(overallEndTime - overallStartTime) / 1000; // 总执行时间,转换为秒 |
|
|
|
|
column.tip = ``; |
|
|
|
|
console.log(Stresponse.data, "合并请求成功"); |
|
|
|
|
_this.form.videoUrl = |
|
|
|
|
Stresponse.data.data.domain + Stresponse.data.data.path; // 确保根据实际响应更新属性名 |
|
|
|
|
let url=(Stresponse.data.data.domain + '/'+ Stresponse.data.data.name) |
|
|
|
|
console.log(url,'地址'); |
|
|
|
|
_this.form.videoUrl = url; // 确保根据实际响应更新属性名 |
|
|
|
|
console.log(_this.form.videoUrl, "参数"); |
|
|
|
|
loading(); |
|
|
|
|
this.$message.success( |
|
|
|
|
`上传成功:文件名:${file.name},文件大小${( |
|
|
|
|
file.size / |
|
|
|
|
(1024 * 1024) |
|
|
|
|
).toFixed(2)} MB, 上传进度: ${progressPercentage}%,总耗时:${totalFunctionTime.toFixed(2)}秒` |
|
|
|
|
).toFixed( |
|
|
|
|
2 |
|
|
|
|
)} MB, 上传进度: ${progressPercentage}%,总耗时:${totalFunctionTime.toFixed( |
|
|
|
|
2 |
|
|
|
|
)}秒` |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
loading(); |
|
|
|
@ -473,5 +477,4 @@ export default {
|
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style> |
|
|
|
|
</style> |
|
|
|
|
<style></style> |
|
|
|
|