Web_Manager_Develope
chenlw 9 years ago
parent 98ff399ee6
commit a28e1765eb

@ -239,9 +239,11 @@ module Developer {
alert("数据文件中没有可用上传的文件!"); alert("数据文件中没有可用上传的文件!");
}else{ }else{
var isuploaad = 1,i = 0; var isuploaad = 1,i = 0;
var timerForUpload = setInterval(function(){
var timerForUpload = $interval(function(){
if(i >= isExited.length){ if(i >= isExited.length){
clearInterval(timerForUpload); // clearInterval(timerForUpload);
$interval.cancle(timerForUpload);
} }
if(isuploaad == 1){ if(isuploaad == 1){
var r = new Resumable({ var r = new Resumable({
@ -265,18 +267,16 @@ module Developer {
r.on('fileAdded', function(file){ r.on('fileAdded', function(file){
r.upload(); r.upload();
update();
}); });
$scope.model.resumablejs.push({ $scope.model.resumablejs.push({
dirname : isExited[i].id, dirname : isExited[i].id,
resumable : r resumable : r
}); });
r.setRootPath(isExited[i].type+"/"+isExited[i].batch+"/"+isExited[i].id+"/"+isExited[i].version+"/"); r.setRootPath(isExited[i].type+"/"+isExited[i].batch+"/"+isExited[i].id+"/"+isExited[i].version+"/");
r.myLoadFiles($scope.model.folderList[isExited[i].id]); r.myLoadFiles($scope.model.folderList[isExited[i].id]);
r.upload(); r.upload();
r.on('fileProgress',function(file){ r.on('fileProgress',function(file){
var file_id=file.relativePath.replace(/^[a-z]*\/$/,''); var file_id=file.relativePath.replace(/^[a-z]*\/$/,'');
var filestr = ""; var filestr = "";
@ -287,10 +287,9 @@ module Developer {
} }
file_id = filestr.replace(/\/*/g,''); file_id = filestr.replace(/\/*/g,'');
r.setFileId(file_id); r.setFileId(file_id);
//$scope.$apply(function(){ // $scope.$apply(function(){
$scope.model.uploadprocess[file_id] = Math.floor(r.progress()*98); $scope.model.uploadprocess[file_id] = Math.floor(r.progress()*98);
//}); // });
}); });
r.on('complete', function(){ r.on('complete', function(){
@ -341,6 +340,7 @@ module Developer {
},2000); },2000);
isuploaad = 1; isuploaad = 1;
}); });
} }
},2000); },2000);
} }
@ -443,10 +443,16 @@ module Developer {
var dirId = $scope.model.resumablejs[i].dirname; var dirId = $scope.model.resumablejs[i].dirname;
var r = $scope.model.resumablejs[i].resumable; var r = $scope.model.resumablejs[i].resumable;
r.on('fileProgress', (file) =>{ r.on('fileProgress', (file) =>{
if(r.getisnowcheck().indexOf("0") == -1){
$scope.$apply(function(){ $scope.$apply(function(){
$scope.model.uploadprocess[dirId] = Math.floor(r.progress()*100); $scope.model.uploadprocess[dirId] = Math.floor(r.progress()*100);
console.log(dirId+":"+Math.floor(r.progress()*100))
}); });
}
else{
$scope.$apply(function(){
$scope.model.uploadprocess[dirId] = Math.floor(r.progress()*98);
});
}
}); });
} }
} }

Loading…
Cancel
Save