import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {Response} from "@angular/http";
import {AppService} from "../../../service/http.service";
import {ListPage} from "../surveyManage/list/list";
import {ChangeApplyListPage} from "../manageDuty/change-apply-list/change-apply-list";
import {MySurveyPage} from "../mySurvey/my-survey/my-survey";
import {SurveryPage} from "../mySurvey/survery/survery";

@IonicPage()
@Component({
  selector: 'page-more-app',
  templateUrl: 'more-app.html',
})
export class MoreAppPage {

    role;
  constructor(public navCtrl: NavController, public navParams: NavParams,
              public appService: AppService) {
  }

  ionViewDidLoad() {
    this.getRole();
  }

    //获取权限
    getRole(){
        this.appService.ObserverHttpGet("/wisdomgroup/app/getRoles", null).subscribe((res: Response) => {
            this.role = res.json();
        }, error => {
            this.appService.alert('系统错误！');
        });
    }

  //问卷调查
    goToSurveyManage(){
      this.navCtrl.push('ListPage');
    }

    //活动
    goActivity() {
        this.navCtrl.push('ActivityListPage', {

        });
    }

    goAnnouncement() {
        this.navCtrl.push("AnnouncementPage");
    }

    //外出报备跳转
    goOutGoingReportAboutAll() {
        this.navCtrl.push("OutGoingReportPage", {
            type: 1
        });
    }

    //报备跟踪
    goReportTrack(){
        this.navCtrl.push("ReportTrackPage");
    }

    //值班情况
    goDuty(){
        this.navCtrl.push("DutyPage");
    }

    goToMySurvey(){
        this.navCtrl.push('SurveryPage');
    }

    goActivityTrack(){
        this.navCtrl.push("ActivityTrackPage");
    }

    replayManage(){
      this.navCtrl.push('ChangeApplyListPage');
    }
}
