<div class="modal-header">
  <h4 class="modal-title pull-left">{{uploadTitle}}</h4>
  <div [hidden]="true">
    <input #elMultipleUpload id="elMultFile" type="file" ng2FileSelect [uploader]="fileUploader" multiple/>
    <input #elSimpleUpload id="elSimpleFile" type="file" ng2FileSelect [uploader]="fileUploader"/>
  </div>
</div>
<div class="modal-body">
  <table class="table table-borderless">
    <tbody>
    <tr *ngFor="let item of fileUploader.queue">
      <td><strong>{{ item?.file?.name }}</strong></td>
      <td *ngIf="fileUploader.options.isHTML5" nowrap>{{ item?.file?.size / 1024 / 1024 | number:'.2' }} MB</td>
      <td *ngIf="fileUploader.options.isHTML5">
        <div class="progress" style="margin-bottom: 0; width:100px;">
          <div class="progress-bar" role="progressbar" [ngStyle]="{ 'width': fileUploader.progress + '%' }"></div>
        </div>
      </td>
      <td class="text-center">
        <span *ngIf="item.isSuccess"><i class="fa fa-ok"></i></span>
        <span *ngIf="item.isCancel"><i class="icon-close mr"></i></span>
        <span *ngIf="item.isError"><i class="fas fa-times"></i></span>
      </td>
    </tr>
    </tbody>
  </table>
</div>

<div class="modal-footer justify-content-between" *ngIf="!fileUploader.isUploading">
  <div>
    <button *ngIf="templateFile" class="btn btn-primary" type="button" (click)="FuncService.fileDownload('frame/template/download.htm', {file_name: templateFile})">
      下载模版
    </button>
  </div>
  <div>
    <button class="btn btn-primary" type="button" *ngIf="fileUploader.queue.length === 0" (click)="chooseFile()">
      选择上传文件
    </button>
    <button class="btn btn-primary" type="button" *ngIf="fileUploader.queue.length > 0" (click)="chooseFile()">
      重新选择文件
    </button>
    <button class="btn btn-success ml-3" type="button" *ngIf="fileUploader.queue.length > 0 && !uploadComplete" (click)="fileUploader.uploadAll()">
      上传文件
    </button>
    <button class="btn btn-secondary ml-3" type="button" (click)="closeWindow()">关闭窗口</button>
  </div>
</div>
