edit
This commit is contained in:
@ -23,14 +23,15 @@
|
||||
<nz-card class="content-box">
|
||||
|
||||
<nz-tabset [nzTabBarExtraContent]="extraTemplate">
|
||||
<nz-tab nzTitle="货主菜单" (nzClick)="changeMemu(0)"></nz-tab>
|
||||
<nz-tab nzTitle="运营后台菜单" (nzClick)="changeMemu(1)"></nz-tab>
|
||||
<nz-tab nzTitle="货主菜单" (nzClick)="changeMemu(0)" *ngIf="isShowFre"></nz-tab>
|
||||
<nz-tab nzTitle="运营后台菜单" (nzClick)="changeMemu(1)" *ngIf="isShowBackEND"></nz-tab>
|
||||
</nz-tabset>
|
||||
<ng-template #extraTemplate>
|
||||
<div class="d-flex align-items-center">
|
||||
<div>
|
||||
<button nz-button nzType="primary" (click)="menuAction('新增菜单')">新增</button>
|
||||
<button nz-button nzType="primary" (click)="menuSort()">菜单排序</button>
|
||||
<button nz-button nzType="primary" (click)="menuAction('新增菜单')" acl
|
||||
[acl-ability]="['MENU-INDEX-add']">新增</button>
|
||||
<button nz-button nzType="primary" (click)="menuSort()" acl [acl-ability]="['MENU-INDEX-sort']">菜单排序</button>
|
||||
<!-- <button nz-button nzType="primary" (click)="menuImport(0)" [disabled]="false"
|
||||
*ngIf="selectedPlatform.enName==='tms-smc-web'">
|
||||
导入货主菜单
|
||||
@ -52,7 +53,7 @@
|
||||
</ng-template>
|
||||
</st> -->
|
||||
<nz-table #expandTable [nzData]="listOfMapData" nzTableLayout="fixed" nzBordered nzSize="small"
|
||||
[nzLoading]="service.http.loading">
|
||||
[nzLoading]="service.http.loading" *ngIf="isShowFre || isShowBackEND">
|
||||
<thead>
|
||||
<tr>
|
||||
<!-- <th nzWidth="70px" nzAlign="center">#</th> -->
|
||||
@ -85,12 +86,12 @@
|
||||
<td nzAlign="center" nzWidth="250px">
|
||||
<a (click)="menuAction('查看菜单',item,item.parentId,true)">查看</a>
|
||||
<nz-divider nzType="vertical"></nz-divider>
|
||||
<a (click)="menuAction('编辑菜单',item,item.parentId)">编辑</a>
|
||||
<a (click)="menuAction('编辑菜单',item,item.parentId)" acl [acl-ability]="['MENU-INDEX-edit']">编辑</a>
|
||||
<nz-divider nzType="vertical"></nz-divider>
|
||||
<a (click)="deleteAction(item)">删除</a>
|
||||
<a (click)="deleteAction(item)" acl [acl-ability]="['MENU-INDEX-delete']">删除</a>
|
||||
<ng-container *ngIf="item.level!==3">
|
||||
<nz-divider nzType="vertical"></nz-divider>
|
||||
<a (click)="menuAction('新增菜单',null,item.id)">新增子项</a>
|
||||
<a (click)="menuAction('新增菜单',null,item.id)" acl [acl-ability]="['MENU-INDEX-add']">新增子项</a>
|
||||
</ng-container>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -132,7 +145,7 @@ export class MenuManagerComponentsIndexComponent implements OnInit {
|
||||
};
|
||||
this.modalHelper.create(MenuManagerMenusortComponent, { i: dialogData }, { size: 900 }).subscribe((res: any) => {
|
||||
if (res) {
|
||||
console.log('a')
|
||||
console.log('a');
|
||||
this.loadMemu(this.selectedPlatform.appId);
|
||||
}
|
||||
});
|
||||
|
||||
@ -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'] } } }
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user