Commit 8fec8ce2 by sunchao

银盾学院权限控制

parent 2b0e433b
...@@ -2,10 +2,12 @@ ...@@ -2,10 +2,12 @@
<h5>{{item.title}}</h5> <h5>{{item.title}}</h5>
<ul> <ul>
<li *ngFor="let subItem of item.subItems" (click)="featureSelect(subItem)"> <li *ngFor="let subItem of item.subItems" (click)="featureSelect(subItem)">
<ng-container *ngIf="subItem.isShow">
<div> <div>
<img [src]="'assets/images/indexIcons/' + subItem.icon + '.png'" alt=""> <img [src]="'assets/images/indexIcons/' + subItem.icon + '.png'" alt="">
</div> </div>
<p>{{subItem.name}}</p> <p>{{subItem.name}}</p>
</ng-container>
</li> </li>
</ul> </ul>
</div> </div>
......
...@@ -949,4 +949,9 @@ export class MyService { ...@@ -949,4 +949,9 @@ export class MyService {
return this.http.post(url,JSON.stringify(params)) return this.http.post(url,JSON.stringify(params))
} }
//是否可见银盾学院
queryCanSee(params){
const url = this.ydapi + "/practitioner/queryCanSee";
return this.http.post(url,JSON.stringify(params))
}
} }
<ul> <ul>
<li *ngFor="let subItem of courseLists" (click)="featureSelect(subItem)"> <ng-container *ngFor="let subItem of courseLists">
<li (click)="featureSelect(subItem)" *ngIf="subItem.isShow">
<div> <div>
<img [src]="'assets/images/indexIcons/' + subItem.icon + '.png'" alt=""> <img [src]="'assets/images/indexIcons/' + subItem.icon + '.png'" alt="">
</div> </div>
<p>{{subItem.name}}</p> <p>{{subItem.name}}</p>
</li> </li>
</ng-container>
</ul> </ul>
<Modal [(ngModel)]="this.state.modal1" [transparent]="true" [maskClosable]="true" (onClose)="onClose('modal1')"> <Modal [(ngModel)]="this.state.modal1" [transparent]="true" [maskClosable]="true" (onClose)="onClose('modal1')">
<div [ngStyle]="{ height: 100, overflow: 'scroll',color:'#000' }"> <div [ngStyle]="{ height: 100, overflow: 'scroll',color:'#000' }">
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { MyService } from '../my.service';
@Component({ @Component({
selector: 'ydlife-yd-college', selector: 'ydlife-yd-college',
...@@ -7,16 +8,18 @@ import { Router } from '@angular/router'; ...@@ -7,16 +8,18 @@ import { Router } from '@angular/router';
styleUrls: ['./yd-college.component.scss'] styleUrls: ['./yd-college.component.scss']
}) })
export class YdCollegeComponent implements OnInit { export class YdCollegeComponent implements OnInit {
canSeeSchool:Boolean=false;
lifeCustomerInfo: any = JSON.parse(localStorage.getItem('lifeCustomerInfo')) ? JSON.parse(localStorage.getItem('lifeCustomerInfo')) : null;
public courseLists = [ public courseLists = [
{no:23,name:'保险ABC',icon:'insuranceABC',link:'',path:`https://${window.location.host}/issue`,isOpen:true}, {no:23,name:'保险ABC',icon:'insuranceABC',link:'',path:`https://${window.location.host}/issue`,isOpen:true,isShow:true},
{no:24,name:'岗前训',icon:'preJobTraining',link:'/preJobTraining',path:'',isOpen:true}, {no:24,name:'岗前训',icon:'preJobTraining',link:'/preJobTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:25,name:'新人训',icon:'newTraining',link:'/newTraining',path:'',isOpen:true}, {no:25,name:'新人训',icon:'newTraining',link:'/newTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:26,name:'CFFP初级训',icon:'cffpElementaryTraining',link:'/cffpElementaryTraining',path:'',isOpen:true}, {no:26,name:'CFFP初级训',icon:'cffpElementaryTraining',link:'/cffpElementaryTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:27,name:'提升训',icon:'promotionTraining',link:'/promotionTraining',path:'',isOpen:true}, {no:27,name:'提升训',icon:'promotionTraining',link:'/promotionTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:28,name:'CFFP衔接训',icon:'cffpBridgingTraining',link:'/cffpBridgingTraining',path:'',isOpen:true}, {no:28,name:'CFFP衔接训',icon:'cffpBridgingTraining',link:'/cffpBridgingTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:29,name:'CFFP高阶训',icon:'cffpAdvancedTraining',link:'/cffpAdvancedTraining',path:'',isOpen:true}, {no:29,name:'CFFP高阶训',icon:'cffpAdvancedTraining',link:'/cffpAdvancedTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:30,name:'产品培训',icon:'productTraining',link:'/productTraining',path:'',isOpen:true}, {no:30,name:'产品培训',icon:'productTraining',link:'/productTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:31,name:'我的培训',icon:'training',link:'/myTraining',path:'',isOpen:true} {no:31,name:'我的培训',icon:'training',link:'/myTraining',path:'',isOpen:true,isShow:this.canSeeSchool}
] ]
public state = { public state = {
modal1:false modal1:false
...@@ -35,9 +38,33 @@ export class YdCollegeComponent implements OnInit { ...@@ -35,9 +38,33 @@ export class YdCollegeComponent implements OnInit {
this.router.navigate([`./${item.link}`]); this.router.navigate([`./${item.link}`]);
} }
} }
constructor(private router:Router) { } constructor(private router:Router,private myService: MyService) { }
ngOnInit() { ngOnInit() {
this.queryCanSee()
}
getMenu(){
this.courseLists = [
{no:23,name:'保险ABC',icon:'insuranceABC',link:'',path:`https://${window.location.host}/issue`,isOpen:true,isShow:true},
{no:24,name:'岗前训',icon:'preJobTraining',link:'/preJobTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:25,name:'新人训',icon:'newTraining',link:'/newTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:26,name:'CFFP初级训',icon:'cffpElementaryTraining',link:'/cffpElementaryTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:27,name:'提升训',icon:'promotionTraining',link:'/promotionTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:28,name:'CFFP衔接训',icon:'cffpBridgingTraining',link:'/cffpBridgingTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:29,name:'CFFP高阶训',icon:'cffpAdvancedTraining',link:'/cffpAdvancedTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:30,name:'产品培训',icon:'productTraining',link:'/productTraining',path:'',isOpen:true,isShow:this.canSeeSchool},
{no:31,name:'我的培训',icon:'training',link:'/myTraining',path:'',isOpen:true,isShow:this.canSeeSchool}
]
}
queryCanSee(){
this.myService.queryCanSee({practitionerId: this.lifeCustomerInfo?this.lifeCustomerInfo['practitionerId']:null,}).subscribe((res)=>{
if(res['success']){
this.canSeeSchool = res['data']['canSeeYdCollege']==1?true:false;
}
this.getMenu()
})
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment