merge chenliwen work

Web_Manager_Develope
wm 9 years ago
commit b2cfaacc34

@ -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,10 +287,9 @@ 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(){
@ -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);
});
}
});
}
}

Loading…
Cancel
Save