import { Component, OnInit } from '@angular/core';
import { BsModalService } from 'ngx-bootstrap/modal';
import { AjaxService } from '../../../../../core/service/ajax.service';
import { MsgService } from '../../../../../core/service/msg.service';
import { FramePageComponent } from '../../../../frame/core/page/frame.page';
import { ExamParamDetailComponent } from '../exam-param-detail/exam-param-detail.component';

@Component({
  selector: 'app-exam-param',
  templateUrl: './exam-param.component.html',
  styleUrls: ['./exam-param.component.scss']
})
export class ExamParamComponent  extends FramePageComponent  implements OnInit {

  constructor(private modalService: BsModalService) {
    super(modalService);
    this.modalComponent = ExamParamDetailComponent;
   }

  ngOnInit() {
  }

  reloadParam() {
    MsgService.confirmAlert(`确定要重新加载面试参数吗？如果参数较多，该操作可能需要比较长的时间，请谨慎使用该功能!`, () => {
      AjaxService.request('exam/param/reload.htm', {}, () => {
        MsgService.successAlert(`参数加载成功，后台参数已经生效，评委端需重新登录！`);
      }, { RequestWithLoading: true});
    });
  }

}
