import { Component, OnInit } from '@angular/core';
import { FlexTableComponent } from '../../../../../shared/common/FlexTable.component';
import { FrameRequest } from '../../../../../shared/frame/frame-request';

@Component({
  selector: 'app-layout-plan-monitor',
  templateUrl: './layout-plan-monitor.component.html',
  styleUrls: ['./layout-plan-monitor.component.scss']
})
export class LayoutPlanMonitorComponent extends FlexTableComponent implements OnInit {

  public query = {
    query: "",
    year_code: 0
  };

  QUERY_URL = "pl/mergePublishPlan/pageLayoutPlan.htm";
  YEAR_CODE_URL = "pl/plExamTime/list.htm";
  LATEST_TIME_URL = "pl/plExamTime/getCurrentYearCode.htm";


  constructor() { 
    super();
  }

  ngOnInit() {
    setTimeout(() =>{
      FrameRequest.requestEntity(this.LATEST_TIME_URL, { }, (entity) => {
        if (entity) {
          this.query.year_code = Number.parseInt(entity);
        }
      });
    },200);
  }

}
