|
|
|
@ -38,7 +38,19 @@ export class RoleComponent implements OnInit {
|
|
|
|
|
params: params |
|
|
|
|
}).subscribe((data: any) => { |
|
|
|
|
console.log('角色列表', data.result.items) |
|
|
|
|
this.listOfData = data.result.items |
|
|
|
|
console.log(JSON.parse(sessionStorage.getItem('userdata'))); |
|
|
|
|
let level=JSON.parse(sessionStorage.getItem('userdata')).organization.level |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.result.items.forEach(ele=>{ |
|
|
|
|
console.log(ele); |
|
|
|
|
|
|
|
|
|
if(ele.organizationsLevel>=level||ele.organizationsLevel==0){ |
|
|
|
|
this.listOfData.push(ele) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.listOfData=[...this.listOfData] |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -80,7 +92,8 @@ export class RoleComponent implements OnInit {
|
|
|
|
|
let body = { |
|
|
|
|
name: instance.validateForm.value.name, |
|
|
|
|
DisplayName: instance.validateForm.value.name, |
|
|
|
|
grantedPermissions: instance.validateForm.value.power || [] |
|
|
|
|
grantedPermissions: instance.validateForm.value.power || [], |
|
|
|
|
organizationsLevel: instance.validateForm.value.organizationsLevel |
|
|
|
|
} |
|
|
|
|
let body2 = instance.validateForm.value.menus || [] |
|
|
|
|
this.http.post('/api/services/app/Role/Create', body).subscribe((data: any) => { |
|
|
|
@ -132,7 +145,8 @@ export class RoleComponent implements OnInit {
|
|
|
|
|
id: item.id, |
|
|
|
|
name: instance.validateForm.value.name, |
|
|
|
|
DisplayName: instance.validateForm.value.name, |
|
|
|
|
grantedPermissions: instance.validateForm.value.power || [] |
|
|
|
|
grantedPermissions: instance.validateForm.value.power || [], |
|
|
|
|
organizationsLevel: instance.validateForm.value.organizationsLevel |
|
|
|
|
} |
|
|
|
|
let body2 = instance.validateForm.value.menus || [] |
|
|
|
|
this.http.put('/api/services/app/Role/Update', body).subscribe((data: any) => { |
|
|
|
|