diff --git a/src/app/routes/menu-manager/components/index/index.component.html b/src/app/routes/menu-manager/components/index/index.component.html index 8b1acd73..3577b04b 100644 --- a/src/app/routes/menu-manager/components/index/index.component.html +++ b/src/app/routes/menu-manager/components/index/index.component.html @@ -23,14 +23,15 @@ - - + +
- - + + + [nzLoading]="service.http.loading" *ngIf="isShowFre || isShowBackEND"> @@ -85,12 +86,12 @@ 查看 - 编辑 + 编辑 - 删除 + 删除 - 新增子项 + 新增子项 diff --git a/src/app/routes/menu-manager/components/index/index.component.ts b/src/app/routes/menu-manager/components/index/index.component.ts index 2f9b1306..3cd5cf8c 100644 --- a/src/app/routes/menu-manager/components/index/index.component.ts +++ b/src/app/routes/menu-manager/components/index/index.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { STComponent, STColumn, STRequestOptions, STChange } from '@delon/abc/st'; +import { ACLService } from '@delon/acl'; import { SFComponent, SFSchema } from '@delon/form'; import { Menu, ModalHelper } from '@delon/theme'; import { EAEnvironmentService } from '@shared'; @@ -37,14 +38,26 @@ export class MenuManagerComponentsIndexComponent implements OnInit { mapOfExpandedData: { [key: string]: any[] } = {}; listOfMapData: any[] = []; - constructor(private envSrv: EAEnvironmentService, public service: MenuManagerService, private modal: NzModalService, private modalHelper: ModalHelper,) { + + isShowBackEND = false; + isShowFre = false; + constructor( + private envSrv: EAEnvironmentService, + public service: MenuManagerService, + private modal: NzModalService, + private modalHelper: ModalHelper, + private acl: ACLService + ) { + const acls = acl.data.abilities || []; + this.isShowBackEND = acl.data.full || !!acls.find(acl => acl === 'MENU-INDEX-obclist'); + this.isShowFre = acl.data.full || !!acls.find(acl => acl === 'MENU-INDEX-smclist'); this.initData(); } ngOnInit(): void {} initData(): void { - this.selectedPlatform = this.platforms[0]; + this.selectedPlatform = this.isShowFre ? this.platforms[0] : this.platforms[1]; this.loadMemu(this.selectedPlatform.appId); } @@ -126,13 +139,13 @@ export class MenuManagerComponentsIndexComponent implements OnInit { } }); } - menuSort(){ + menuSort() { const dialogData = { appId: this.selectedPlatform.appId }; - this.modalHelper.create(MenuManagerMenusortComponent, { i: dialogData }, { size: 900 }).subscribe((res:any) => { - if(res) { - console.log('a') + this.modalHelper.create(MenuManagerMenusortComponent, { i: dialogData }, { size: 900 }).subscribe((res: any) => { + if (res) { + console.log('a'); this.loadMemu(this.selectedPlatform.appId); } }); diff --git a/src/app/routes/menu-manager/menu-manager-routing.module.ts b/src/app/routes/menu-manager/menu-manager-routing.module.ts index 30dde843..4879b5aa 100644 --- a/src/app/routes/menu-manager/menu-manager-routing.module.ts +++ b/src/app/routes/menu-manager/menu-manager-routing.module.ts @@ -5,7 +5,11 @@ import { MenuManagerComponentsIndexComponent } from './components/index/index.co const routes: Routes = [ { path: '', redirectTo: 'index', pathMatch: 'full' }, - { path: 'index', component: MenuManagerComponentsIndexComponent, data: { guard: { ability: ['MENU-INDEX-obclist'] } } }, + { + path: 'index', + component: MenuManagerComponentsIndexComponent, + data: { guard: { ability: ['MENU-INDEX-obclist', 'MENU-INDEX-smclist'] } } + }, { path: 'auth', component: ApiAuthComponent, data: { guard: { ability: ['MENU-AUTH-obclist', 'MENU-AUTH-smclist'] } } } ];