import { Component, OnInit } from '@angular/core';
import { BsModalService } from 'ngx-bootstrap/modal';
import { FlexTableComponent } from '../../../../../shared/common/FlexTable.component';
import * as _ from 'lodash';

@Component({
  selector: 'app-by-turn-out-reply',
  templateUrl: './by-turn-out-reply.component.html',
  styleUrls: ['./by-turn-out-reply.component.scss']
})
export class ByTurnOutReplyComponent extends FlexTableComponent  implements OnInit {

  public query = {
    query: "",
    time: ""
  };
  QUERY_URL = "by/byTurnOutReply/page.htm";
  ADD_URL = "by/byTurnOutReply/add.htm";
  DELETE_URL= "by/byTurnOutReply/delete.htm";
  GET_URL= "by/byTurnOutReply/get.htm";
  EDIT_URL= "by/byTurnOutReply/edit.htm";
  TIME_URL = "by/byTurnTimeConfig/list.htm?turn_type=2";

  constructor(public bsModalService: BsModalService ) {
    super();
  }

  ngOnInit() { 
  }

  //解决通过flex-select查询参数传递的问题
  search(param) {
    for (const key in this.query) {
      if (this.query[key] === undefined || this.query[key] === null) {
        this.query[key] = "";
      }
    }
    let searchCondition = this.query;
    //参数合并
    _.assignIn(param, searchCondition);
  }

}
