|
@@ -223,15 +223,15 @@
|
|
|
</div>
|
|
|
<div style="margin-bottom: 10px">
|
|
|
<span>{{
|
|
|
- fileLoadCount
|
|
|
+ fileLoading[index].load
|
|
|
}}</span>
|
|
|
/
|
|
|
<span>{{
|
|
|
- fileLoadNum
|
|
|
+ fileLoading[index].count
|
|
|
}}</span>
|
|
|
</div>
|
|
|
- <el-progress :text-inside="true" :stroke-width="20" :percentage="infoprogress
|
|
|
- ? infoprogress
|
|
|
+ <el-progress :text-inside="true" :stroke-width="20" :percentage=" fileLoading[index].progress
|
|
|
+ ? fileLoading[index].progress
|
|
|
: 0
|
|
|
" style="width: 80%"></el-progress>
|
|
|
</div>
|
|
@@ -931,11 +931,9 @@ export default {
|
|
|
btnDisplay: false,
|
|
|
|
|
|
fileLoading: [],
|
|
|
- fileLoadCount: 0,
|
|
|
- fileLoadNum: 0,
|
|
|
- infoisAllSize: 0,
|
|
|
- infoprogress: 0,
|
|
|
- infoisFinishSize: 0,
|
|
|
+ // fileLoadCount: [],
|
|
|
+ // fileLoadNum: [],
|
|
|
+ // infoprogress: [],
|
|
|
|
|
|
};
|
|
|
},
|
|
@@ -1312,7 +1310,7 @@ export default {
|
|
|
}
|
|
|
console.log('topictopictopictopic',topic)
|
|
|
testArray.push(topic)
|
|
|
- this.fileLoading.push({id:i,bool:false})
|
|
|
+ this.fileLoading.push({bool:false,count:0,load:0,progress:0})
|
|
|
}
|
|
|
this.testArray = testArray
|
|
|
this.worksArray = array
|
|
@@ -2005,10 +2003,12 @@ export default {
|
|
|
this.isDesktop = this.screenWidth > 750; // 你可以根据需要调整这个阈值
|
|
|
},
|
|
|
downloadFileType5(fileData,title="附件",index){
|
|
|
- this.fileLoading[index].bool=true
|
|
|
- this.fileLoadNum = 0
|
|
|
- this.fileLoadCount = 0
|
|
|
- this.infoprogress = 0
|
|
|
+ this.fileLoading[index].bool = true
|
|
|
+ this.fileLoading[index].count = 0
|
|
|
+ this.fileLoading[index].load = 0
|
|
|
+ this.fileLoading[index].progress = 0
|
|
|
+
|
|
|
+
|
|
|
let data = fileData;
|
|
|
const zip = new JSZip();
|
|
|
let downFileArray = [];
|
|
@@ -2019,7 +2019,7 @@ export default {
|
|
|
let promises = [];
|
|
|
console.log('downFileArray',downFileArray);
|
|
|
downFileArray.forEach(e=>{
|
|
|
- this.fileLoadNum += e.urlList.length
|
|
|
+ this.fileLoading[index].count += e.urlList.length
|
|
|
})
|
|
|
|
|
|
if(downFileArray.length==1){//只有一位老师的情况
|
|
@@ -2032,9 +2032,9 @@ export default {
|
|
|
const file_name = i.name; // 获取文件名
|
|
|
folder.file(file_name, data.data, { binary: true }); // 逐个添加文件
|
|
|
}
|
|
|
- this.fileLoadCount+=1
|
|
|
- this.infoprogress = parseInt((this.fileLoadCount / this.fileLoadNum) * 100);
|
|
|
- if (this.fileLoadCount == this.fileLoadNum) {
|
|
|
+ this.fileLoading[index].load+=1
|
|
|
+ this.fileLoading[index].progress = parseInt((this.fileLoading[index].load / this.fileLoading[index].count) * 100);
|
|
|
+ if (this.fileLoading[index].load == this.fileLoading[index].count) {
|
|
|
this.fileLoading[index].bool=false
|
|
|
}
|
|
|
});
|
|
@@ -2049,10 +2049,9 @@ export default {
|
|
|
const file_name = `${downFileArray[0].username}-${downFileArray[0].urlList[0].name}`; // 获取文件名
|
|
|
zip.file(file_name, data.data, { binary: true }); // 逐个添加文件
|
|
|
}
|
|
|
- this.fileLoadCount+=1
|
|
|
- this.infoprogress = parseInt((this.fileLoadCount / this.fileLoadNum) * 100);
|
|
|
-
|
|
|
- if (this.fileLoadCount == this.fileLoadNum) {
|
|
|
+ this.fileLoading[index].load+=1
|
|
|
+ this.fileLoading[index].progress = parseInt((this.fileLoading[index].load / this.fileLoading[index].count) * 100);
|
|
|
+ if (this.fileLoading[index].load == this.fileLoading[index].count) {
|
|
|
this.fileLoading[index].bool=false
|
|
|
}
|
|
|
}))
|
|
@@ -2066,9 +2065,9 @@ export default {
|
|
|
const file_name = `${i.username ? i.username : '匿名'}-${i.urlList[0].name}`; // 获取文件名
|
|
|
zip.file(file_name, data.data, { binary: true }); // 逐个添加文件
|
|
|
}
|
|
|
- this.fileLoadCount+=1
|
|
|
- this.infoprogress = parseInt((this.fileLoadCount / this.fileLoadNum) * 100);
|
|
|
- if (this.fileLoadCount == this.fileLoadNum) {
|
|
|
+ this.fileLoading[index].load+=1
|
|
|
+ this.fileLoading[index].progress = parseInt((this.fileLoading[index].load / this.fileLoading[index].count) * 100);
|
|
|
+ if (this.fileLoading[index].load == this.fileLoading[index].count) {
|
|
|
this.fileLoading[index].bool=false
|
|
|
}
|
|
|
}))
|
|
@@ -2081,9 +2080,9 @@ export default {
|
|
|
const file_name = ui.name; // 获取文件名
|
|
|
folder.file(file_name, data.data, { binary: true }); // 逐个添加文件
|
|
|
}
|
|
|
- this.fileLoadCount+=1
|
|
|
- this.infoprogress = parseInt((this.fileLoadCount / this.fileLoadNum) * 100);
|
|
|
- if (this.fileLoadCount == this.fileLoadNum) {
|
|
|
+ this.fileLoading[index].load+=1
|
|
|
+ this.fileLoading[index].progress = parseInt((this.fileLoading[index].load / this.fileLoading[index].count) * 100);
|
|
|
+ if (this.fileLoading[index].load == this.fileLoading[index].count) {
|
|
|
this.fileLoading[index].bool=false
|
|
|
}
|
|
|
})
|