Browse Source

菜单管理

beijing
陈鹏飞 2 years ago
parent
commit
0005c50dca
  1. 2
      src/app/pages/home/home.component.html
  2. 2
      src/app/pages/login/login.component.ts
  3. 37
      src/app/system-management/user/user.component.html
  4. 69
      src/app/system-management/user/user.component.scss

2
src/app/pages/home/home.component.html

@ -19,7 +19,7 @@
</li>
</ng-container>
<ng-template #elseTemplate>
<li *ngFor="let item of menuList2" (click)="routerChange(item)"
<li *ngFor="let item of menuList1" (click)="routerChange(item)"
[ngClass]="{'router-link-active': item.name == selectedItem}">
{{item.name}}
</li>

2
src/app/pages/login/login.component.ts

@ -124,7 +124,7 @@ export class LoginComponent implements OnInit {
sessionStorage.setItem("encryptedAccessToken", data.result.encryptedAccessToken);
this.http.get('/api/services/app/Session/GetCurrentLoginInformations').subscribe((data: any) => {
console.log('GetCurrentLoginInformations', data.result)
if (data.result.user.menus.length == 0 && data.result.name!="admin") {
if (data.result.user.menus.length == 0 && data.result.user.userName!="admin") {
this.message.create('error', `当前用户未分配菜单`);
this.isLoading = false
return

37
src/app/system-management/user/user.component.html

@ -1,4 +1,40 @@
<div class="userBox" id="userBox">
<div class="orbox">
<div class="topbox2">
<div class="lefttop">
<span>组织机构列表</span>
</div>
<div class="righttop">
<nz-input-group nzPrefixIcon="search">
<input type="text" nz-input placeholder="请输入机构名称" [(ngModel)]="searchValue" />
</nz-input-group>
</div>
</div>
<div class="treeTitle">
<span>组织机构</span>
</div>
<div class="treebox">
<nz-tree [nzSearchValue]="searchValue" #nzTreeComponent [nzData]="nodes" [nzExpandAll]="nzExpandAll"
[nzExpandedKeys]="defaultExpandedKeys" [nzSelectedKeys]='nzSelectedKeys' (nzClick)="nzClick($event)"
[nzTreeTemplate]="nzTreeTemplate" [nzExpandedIcon]="multiExpandedIconTpl">
</nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div class="nodebox">
<span class="name">{{ node.title }}</span>
</div>
</ng-template>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length == 0; else elseTemplate">
</ng-container>
<ng-template #elseTemplate>
<i nz-icon [nzType]="node.isExpanded ? 'caret-down' : 'caret-right'" class="ant-tree-switcher-line-icon"></i>
</ng-template>
</ng-template>
</div>
</div>
<div class="box">
<div class="topbox">
<div class="lefttop">
<span>用户列表</span>
@ -61,3 +97,4 @@
<ng-template #totalTemplate let-total> 16条/页,共{{usersNum}}条 </ng-template>
</div>
</div>
</div>

69
src/app/system-management/user/user.component.scss

@ -6,10 +6,68 @@
padding: 20px;
overflow: hidden;
display: flex;
// flex-direction: column;
.treebox {
display: flex;
flex-direction: column;
}
.topbox2 {
width: 100%;
height: 36px;
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20px;
.lefttop {
span {
color: #000D21;
margin-right: 16px;
}
.yellowspan {
color: rgb(240, 176, 37);
}
}
thead {}
.righttop {
height: 36px;
display: flex;
button {
margin-left: 16px;
}
nz-input-group {
height: 32px;
}
}
}
.orbox {
width: 375px;
// height: 100%;
overflow-y: auto;
margin-right: 10px;
display: flex;
flex-direction: column;
}
.treeTitle {
width: 100%;
height: 55px;
line-height: 55px;
margin-top: 12px;
display: flex;
justify-content: space-between;
color: #000D21;
box-sizing: border-box;
padding-left: 30px;
padding-right: 180px;
background: rgba(145, 204, 255, 0.2);
border: 1px solid rgba(145, 204, 255, 0.2);
}
.nodebox {
font-size: 15px;
}
tbody {
tr {
td:nth-child(1) {
@ -29,7 +87,14 @@
}
}
}
.box{
flex: 1;
overflow: auto;
padding-top: 20px;
::-webkit-scrollbar {
display: none;
}
}
.topbox {
width: 100%;
height: 36px;

Loading…
Cancel
Save