import {Component} from '@angular/core';
import {ViewController} from "ionic-angular";
import * as Mock from "mockjs";
import {HomeService} from "../../pages/home/home.service";

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

    text: string;
    personList = [];
    checkPerosn = [];

    constructor(public viewCtrl: ViewController, private homeSer: HomeService) {
        this.getPersonList()
    }

    //人员列表
    getPersonList() {
        const data = {
            page: 1,
            limit: 1000,
        };
        this.homeSer.getOrgList(data).subscribe(
            (res) => {
                this.personList = res.list.user;
            }
        )
    }

    dismiss() {
        this.viewCtrl.dismiss({data: this.checkPerosn});
    }

    cancel() {
        this.viewCtrl.dismiss();
    }

    changeCheck(e, item) {
        this.checkPerosn = item;
    }

}
