import { Component, OnInit } from '@angular/core';
import { FlexTableComponent } from '../../../../shared/common/FlexTable.component';
import { BsModalService } from 'ngx-bootstrap/modal';
import { FormBuilder, Validators } from '@angular/forms';
import { FrameRequest } from '../../../../shared/frame/frame-request';
import { AppComponent } from '../../../..';
import { FrameFunction } from '../../../../shared/frame/frame_function';

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

  public query = {
    query: ""
  };
  QUERY_URL = "msgque/jcYhxxb/page.htm";
  


  constructor() {
    super();
  }

  ngOnInit() {
   
  }

  async syn() {
    
    let checkedArray = this.framePager.getCheckedArray();
    if(checkedArray.length === 0) {
      AppComponent.alert({title:"信息提示",text:"请选择数据!"})
      return;
    }
   
    AppComponent.confirm("确定将用户从自考前置数据库同步到自考数据库",()=>{
      checkedArray = this.framePager.getCheckedArray((item)=>item.dlzh);
      FrameRequest.requestMap("msgque/jcYhxxb/syn.htm", {dlzhs:checkedArray.join()}, () => {
        AppComponent.GobalComponent.successMsg('用户信息同步成功');
        this.framePager.reload();
      });
    })
  }

}
