import { Component,ViewChild,OnInit } from '@angular/core';
import { FramePageComponent } from '../../../frame/core/page/frame.page';
import { BsModalService } from 'ngx-bootstrap/modal';
import {ScoreFirstYmDetailComponent} from '../score-first-ym-detail/score-first-ym-detail.component';
import {ScoreYmReportComponent} from '../score-ym-report/score-ym-report.component';
import { FrameUpload } from '../../../../core/frame/upload/frame-upload/frame-upload';
import { ModalService } from '../../../../core/service/modal.service';

@Component({
  selector: 'app-score-first-ym',
  templateUrl: './score-first-ym.component.html',
  styleUrls: ['./score-first-ym.component.scss']
})
export class ScoreFirstYmComponent extends FramePageComponent implements OnInit {
  @ViewChild('uploader', {static: false}) uploader: FrameUpload;
  constructor(private modalService: BsModalService) {
    super(modalService);
    this.modalComponent = ScoreFirstYmDetailComponent;
  }

  ngOnInit() {
  }

  showConfrimModal () {
    this.showComponentModal(ScoreYmReportComponent);
  }

  doUploaFile() {
    debugger;
    ModalService.showUploadWindow(this.bsService,'./score/ymfirst/upload.htm',{},{
      uploadTitle:'初试成绩',
      uploadCallback: this.uploadWithThreadCallback.bind(this),
      autoClose:true
    });
  }

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