import { Component, OnInit, ViewChild } from '@angular/core';
import { BsModalService } from 'ngx-bootstrap/modal';
import { FrameUpload } from 'src/app/core/frame/upload/frame-upload/frame-upload';
import { ModalService } from 'src/app/core/service/modal.service';
import { FramePageComponent } from 'src/app/routes/frame/core/page/frame.page';

@Component({
  selector: 'app-score-ym-violation',
  templateUrl: './score-ym-violation.component.html',
  styleUrls: ['./score-ym-violation.component.scss']
})
export class ScoreYmViolationComponent extends FramePageComponent implements OnInit {

  @ViewChild('uploader', { static: false }) uploader: FrameUpload;
  constructor(private modalService: BsModalService) {
    super(modalService);
   }

  ngOnInit(): void {
  }

  doUploaFile() {
    ModalService.showUploadWindow(this.bsService, './score/ym/violation/upload.htm', {}, {
      uploadTitle: '违纪考生',
      templateFile:'模版-线上考试违纪考生.xls',
      uploadCallback: this.uploadWithThreadCallback.bind(this),
      autoClose: true
    });
  }

  uploadWithThreadCallback(ajax) {
    this.pager.reload();
  }

}
