|
@@ -81,18 +81,21 @@
|
|
}
|
|
}
|
|
this.allNum = this.photoList.length;
|
|
this.allNum = this.photoList.length;
|
|
if(this.allNum > this.photoQuantityLimit){
|
|
if(this.allNum > this.photoQuantityLimit){
|
|
- alert("单次上传文件数量不能大于"+this.photoQuantityLimit+",当前数量为"+photoQuantity);
|
|
|
|
|
|
+ alert("单次上传文件数量不能大于"+this.photoQuantityLimit+",当前数量为"+this.allNum);
|
|
photos.files = null;
|
|
photos.files = null;
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
- this.photoLine = this.photoList.splice(0, this.concurrency);
|
|
|
|
|
|
+ //初始化this.concurrency个到photoLine中,开始处理
|
|
|
|
+ this.photoLine = this.photoList.splice(0,this.concurrency);
|
|
for(var i = 0;i<this.photoLine.length;i++){
|
|
for(var i = 0;i<this.photoLine.length;i++){
|
|
this.processStudentPhoto(this.photoLine[i]);
|
|
this.processStudentPhoto(this.photoLine[i]);
|
|
}
|
|
}
|
|
var _this = this;
|
|
var _this = this;
|
|
|
|
+ /**
|
|
|
|
+ * 启动检查,看photoLine中是否有已完成的,如果有,从photoList中取出第一个将其替换
|
|
|
|
+ * 队列中一直保持this.concurrency个正在处理的照片
|
|
|
|
+ */
|
|
var uploadTime = setInterval(function(){
|
|
var uploadTime = setInterval(function(){
|
|
- //检查photoLine中是否有已经完成的
|
|
|
|
for (let i = 0; i < _this.photoLine.length; i++) {
|
|
for (let i = 0; i < _this.photoLine.length; i++) {
|
|
if (_this.photoLine[i].finished) {
|
|
if (_this.photoLine[i].finished) {
|
|
if (_this.photoList.length > 0) {
|
|
if (_this.photoList.length > 0) {
|