You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-task',
|
|
|
|
templateUrl: './task.component.html',
|
|
|
|
styleUrls: ['./task.component.scss']
|
|
|
|
})
|
|
|
|
export class TaskComponent implements OnInit {
|
|
|
|
level=""
|
|
|
|
user=false
|
|
|
|
constructor(private router: Router) { }
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
console.log(JSON.parse(sessionStorage.getItem('userData')));
|
|
|
|
|
|
|
|
this.level=JSON.parse(sessionStorage.getItem('userData')).organizationLevel
|
|
|
|
let user=JSON.parse(sessionStorage.getItem('userData')).roles
|
|
|
|
|
|
|
|
for (let index = 0; index < user.length; index++) {
|
|
|
|
const element = user[index].name;
|
|
|
|
if(element.indexOf('检查') != -1){
|
|
|
|
this.user=true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(this.router.url=="/task"){
|
|
|
|
if(this.level=="brigade"){
|
|
|
|
this.router.navigate(['/task/indicators'])
|
|
|
|
}else if(this.level=="battalion" && !this.user){
|
|
|
|
this.router.navigate(['/task/monthlytaskoverview'])
|
|
|
|
}else if(this.level=="squadron" || this.user){
|
|
|
|
this.router.navigate(['/task/taskexecution'])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|