import { Component } from '@angular/core';
import {IonicPage, NavController, NavParams, ViewController} from 'ionic-angular';
import {Response} from "@angular/http";
import {AppService} from "../../../../service/appHttpService";


@Component({
  selector: 'page-person',
  templateUrl: 'person.html',
})
export class PersonPage {

    group;     //组织id
  batchList = [];
  constructor(public navCtrl: NavController, public navParams: NavParams,
              public viewCtrl: ViewController, public appService: AppService) {
  }

  ionViewDidLoad() {
      const data = {
          pageSize:'1000',
          pageNumber:'1'
      };
      this.appService.ObserverHttpGetData("wisdomgroup/sysmanagement/usergroup/search.ajax",data)
          .subscribe((res: Response) => {
                  let data = res.json();
                  this.batchList = data.list;
                  console.log(this.batchList);

              }, error => {
                  this.appService.alert('网络异常！');
              }
          );
  }

    dismiss() {
          this.viewCtrl.dismiss(this.batchList[this.group]);
    }

}
