Skip to content

Commit

Permalink
[#9][fyqj] add user relative info in header
Browse files Browse the repository at this point in the history
  • Loading branch information
wfsovereign committed Dec 26, 2017
1 parent c913d97 commit 4340edf
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/app/manage/manage-app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

<div class="container main">
<h2>Main content</h2>
<button class="btn btn-primary">test</button>

<router-outlet></router-outlet>

Expand Down
21 changes: 21 additions & 0 deletions src/app/shared/page-header/page-header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,25 @@
<i class="fa fa-bars" aria-hidden="true"></i>
</div>

<div class="user-info navbar-right">
<div reDropdown>
<span class="username dropdown-toggle">
&nbsp;{{dummyName}}
<i class="menu-icon glyphicon glyphicon-user"></i>
<span class="caret"></span>
</span>
<ul class="dropdown-menu">
<li>
<a>个人信息</a>
</li>
<li>
<a>系统设置</a>
</li>
<li>
<a>登出</a>
</li>
</ul>
</div>
</div>

</div>
37 changes: 37 additions & 0 deletions src/app/shared/page-header/page-header.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,40 @@
font-weight: 500;
white-space: nowrap;
}

.user-info {
position: absolute;
right: 5rem;

& > .open > .dropdown-menu {
display: block;
}
}

.username {
color: #fff;
cursor: pointer;
}

.dropdown-menu {
margin-top: 0;
border-top-right-radius: 0;
border-top-left-radius: 0;
max-height: 600px;
overflow: auto;
}

li {
a {
display: block;
cursor: pointer;
transition: all 0.2s;
background-color: transparent;

&:hover {
text-decoration: none;
color: #141414;
background-color: #eeeeee;
}
}
}
5 changes: 4 additions & 1 deletion src/app/shared/page-header/page-header.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, EventEmitter, Output } from '@angular/core';
import { Component, EventEmitter, Output, ViewChild } from '@angular/core';

@Component({
selector: 'app-page-header',
Expand All @@ -8,6 +8,9 @@ import { Component, EventEmitter, Output } from '@angular/core';
export class PageHeaderComponent {
@Output() onExpand = new EventEmitter();

@ViewChild('volumeTemplate') volumeTemplate;
dummyName = '管理员名称';

handleExpandClick() {
this.onExpand.emit();
}
Expand Down

0 comments on commit 4340edf

Please sign in to comment.