@@ -361,6 +361,8 @@ export class JigsawUploadDirective extends JigsawUploadBase implements IUploader
361361 if ( fileInfo . files ) {
362362 // 把多个file凑成一个formData
363363 this . files . filter ( file => file . url == "" ) . forEach ( ( item : any ) => updateState ( item ) ) ;
364+ fileInfo . name = 'multiple-files-combined' ;
365+ fileInfo . state = 'loading' ;
364366 fileInfo . files . forEach ( file => formData . append ( this . contentField , file , file . name ) ) ;
365367 this . _appendAdditionalFields ( formData , 'multiple-files-combined' ) ;
366368 } else {
@@ -391,14 +393,14 @@ export class JigsawUploadDirective extends JigsawUploadBase implements IUploader
391393 this . _statusLog ( fileInfo , this . _translateService . instant ( `upload.done` ) ) ;
392394 }
393395 if ( fileInfo . files ) {
394- this . files . forEach ( item => {
396+ this . files . filter ( file => file . url == "" ) . forEach ( item => {
395397 update ( item ) ;
396398 item . progress = 100 ;
397399 } ) ;
398- } else {
399- update ( fileInfo ) ;
400- this . _afterCurFileUploaded ( fileInfo ) ;
400+ fileInfo . name = "multiple-files-combined" ;
401401 }
402+ update ( fileInfo ) ;
403+ this . _afterCurFileUploaded ( fileInfo ) ;
402404 } , ( e ) => {
403405 const update = ( fileInfo : UploadFileInfo ) => {
404406 fileInfo . state = 'error' ;
@@ -408,7 +410,7 @@ export class JigsawUploadDirective extends JigsawUploadBase implements IUploader
408410 const message = this . _translateService . instant ( `upload.${ e . statusText } ` ) || e . statusText ;
409411 if ( this . batchMode ) {
410412 this . files . filter ( file => file . url == "" ) . forEach ( ( item : any ) => update ( item ) ) ;
411- return ;
413+ fileInfo . name = "multiple-files-combined" ;
412414 }
413415 update ( fileInfo ) ;
414416 this . _afterCurFileUploaded ( fileInfo ) ;
@@ -449,10 +451,13 @@ export class JigsawUploadDirective extends JigsawUploadBase implements IUploader
449451 return ;
450452 }
451453
452- const waitingFile = this . files . find ( f => f . state == 'pause' ) ;
453- if ( waitingFile ) {
454- this . _sequenceUpload ( waitingFile )
455- } else if ( this . _isAllFilesUploaded ( ) ) {
454+ if ( ! this . batchMode ) {
455+ const waitingFile = this . files . find ( f => f . state == 'pause' ) ;
456+ if ( waitingFile ) {
457+ this . _sequenceUpload ( waitingFile )
458+ }
459+ }
460+ if ( this . _isAllFilesUploaded ( ) ) {
456461 this . complete . emit ( this . files ) ;
457462 }
458463 this . _cdr . markForCheck ( ) ;
0 commit comments