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

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

  perList;
  name = '';
  constructor(public navCtrl: NavController, public navParams: NavParams,
              public appService: AppService , public viewCtrl: ViewController) {
  }

  ionViewDidLoad() {
        this.getList();
  }

  getList(){
      const data = {
          name:this.name,
          pageNumber:1,
          pageSize:100,
      };
      this.appService.ObserverHttpNoForm('/wisdomgroup/app/getUserByName',data)
          .subscribe((res)=>{
              this.perList = res.json().list;
          })
  }

    dismiss() {
        let data = {  };
        this.viewCtrl.dismiss(data);
    }

    sure(item){
        this.viewCtrl.dismiss(item);
    }

}
