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