import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {ContactListPage} from "../contact-list/contact-list";

@Component({
    selector: 'page-contact-role',
    templateUrl: 'contact-role.html',
})
export class ContactRolePage {

    roleList = [];

    area;

    constructor(public navCtrl: NavController, public navParams: NavParams) {
        this.area = this.navParams.get('area');
        this.roleList = this.area.code == '310000' ? [{value: 0, label: '管理员'},{value: 4, label: '办领导'},{value: 1, label: '处领导'},{value: 2, label: '工作人员'},{value: 3, label: '其他人员'}] : [{value: 4, label: '办领导'},{value: 2, label: '工作人员'},{value: 3, label: '其他人员'}]
        console.log('管理role权限：' + JSON.stringify(this.area))
    }

    ionViewDidLoad() {
        console.log('ionViewDidLoad ContactRolePage');
    }

    goToList(item) {
        this.navCtrl.push(ContactListPage, {role: item.value, area: this.area, roleName: item.label});
    }
}
