import {Component, OnInit} from '@angular/core';
import {DomSanitizer} from '@angular/platform-browser';
import { BsModalRef } from 'ngx-bootstrap/modal';
import { MsgService } from '../../../../../core/service/msg.service';
import { FrameDetailComponent } from '../../../../frame/core/detail/frame.detail';

@Component({
  selector: 'app-exam-judge-choose',
  templateUrl: './exam-judge-choose.component.html',
  styleUrls: ['./exam-judge-choose.component.scss']
})
export class ExamJudgeChooseComponent extends FrameDetailComponent implements OnInit {

  afterChooseJudge;
  room_chief;

  constructor(bsModalRef: BsModalRef, sanitizer: DomSanitizer) {
    super(bsModalRef, sanitizer);
  }

  ngOnInit() {
  }

  initDefautEntity() {
  }

  chooseJudge(judge) {
    if(this['room_chief'] === true)
      judge.room_chief = 'Active';
    MsgService.confirmAlert(`确定选择评委【${judge.judge_name}(${judge.judge_mobile})】吗?`, () => {
      this.afterChooseJudge.call(this.framePageComponent, judge);
      this['room_chief'] = false;
    });
  }

}
