import { Component, OnInit } from '@angular/core';
import { BsModalRef } from 'ngx-bootstrap/modal';
import { FrameDetailComponent } from '../../../../frame/core/detail/frame.detail';


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

  recordArr = [];

  constructor(bsModalRef: BsModalRef) { 
    super(bsModalRef);
  }

  ngOnInit(): void {
    this.requestRecord();
  }

  requestRecord() {
    this.AjaxService.requestArray('exam/judge/score/record/list.htm', this.ResponseEntity, (array) => {
      this.recordArr = array;
    });
  }

  deleteRecord(record_id?) {
    this.MsgService.confirmAlert('确定要删除评委的打分记录吗？一旦删除，须提醒评委重新登录！', () => {
      this.AjaxService.request('exam/judge/score/record/delete.htm', {record_id: record_id}, () => {
        this.MsgService.successToastr('删除成功！');
        this.requestRecord();
      });
    })
    
  }

}
