From f74aca491b9e7e2290597949c68cd854e48bd212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=B5=B7?= Date: Sat, 25 Apr 2020 17:29:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E4=B8=BB=E4=BD=93=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index/src/app/view/admin/admin.component.html | 105 ++++++++++++++++-- index/src/app/view/admin/admin.component.less | 42 ++++++- index/src/app/view/admin/admin.component.ts | 29 +++-- index/src/app/view/admin/admin.module.ts | 10 +- 4 files changed, 162 insertions(+), 24 deletions(-) diff --git a/index/src/app/view/admin/admin.component.html b/index/src/app/view/admin/admin.component.html index 8a9131c..725b33b 100644 --- a/index/src/app/view/admin/admin.component.html +++ b/index/src/app/view/admin/admin.component.html @@ -1,12 +1,93 @@ -

admin works!

-indec -article -category -comment -link -tag -update -user -userInfo -visitor - + + + +
    +
  • + + 后台首页 +
  • + +
  • + +
  • + +
  • + + 评论管理 +
  • + +
  • + + 标签管理 +
  • + +
  • + + 分类管理 +
  • + +
  • + + 修改信息 +
  • + +
  • + + 用户管理 +
  • + +
  • + + 友链管理 +
  • + +
  • + + 访问管理 +
  • + +
  • + + 更新管理 +
  • + + + +

    别管别人言语

    +

    做最好的自己

    +
    + +

    欢迎来访小海博客

    +
    + +
+
+ + +
+ +
+
+ © 小海博客 - Design by 小海 +
+
+ + + diff --git a/index/src/app/view/admin/admin.component.less b/index/src/app/view/admin/admin.component.less index 04b3e9a..4f07094 100644 --- a/index/src/app/view/admin/admin.component.less +++ b/index/src/app/view/admin/admin.component.less @@ -1,4 +1,40 @@ -a{ - margin: 5px; - padding: 10px; + +.myCard { + width: 180px; + margin-left: 10px; +} + +nz-layout, nz-sider { + height: 100%; +} + +.layout { + padding-top: 80px; +} + +p { + text-align: center; +} + +nz-content { + margin-left: 30px; + margin-right: 30px; +} + +.inner-content { + padding: 15px; + background: #fff; + min-height: 560px; + height: 100%; +} + +nz-footer { + text-align: center; +} + +@media only screen and (max-width: 768px) { + nz-content { + margin-left: 10px; + margin-right: 10px; + } } diff --git a/index/src/app/view/admin/admin.component.ts b/index/src/app/view/admin/admin.component.ts index 76def9d..cf2c729 100644 --- a/index/src/app/view/admin/admin.component.ts +++ b/index/src/app/view/admin/admin.component.ts @@ -1,15 +1,30 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit} from '@angular/core'; +import {UserService} from '../../services/user.service'; +import {User} from '../../class/User'; @Component({ - selector: 'app-admin', - templateUrl: './admin.component.html', - styleUrls: ['./admin.component.less'] + selector: 'app-admin', + templateUrl: './admin.component.html', + styleUrls: ['./admin.component.less'] }) export class AdminComponent implements OnInit { - constructor() { } + constructor(public userService: UserService) { + } - ngOnInit(): void { - } + user: User; + isCollapsed: boolean = false; + + ngOnInit(): void { + this.userService.watchUserInfo({ + complete: () => null, + error: (err) => null, + next: data => { + console.log('更新user') + this.user = data.result + } + } + ) + } } diff --git a/index/src/app/view/admin/admin.module.ts b/index/src/app/view/admin/admin.module.ts index 8f06c5b..97ab26c 100644 --- a/index/src/app/view/admin/admin.module.ts +++ b/index/src/app/view/admin/admin.module.ts @@ -11,11 +11,15 @@ import {AdminUpdateComponent} from './admin-update/admin-update.component'; import {AdminUserComponent} from './admin-user/admin-user.component'; import {AdminUserinfoComponent} from './admin-userinfo/admin-userinfo.component'; import {AdminVisitorComponent} from './admin-visitor/admin-visitor.component'; -import { AdminComponent } from './admin.component'; +import {AdminComponent} from './admin.component'; +import {NgZorroAntdModule} from 'ng-zorro-antd'; +import {NzSpaceModule} from 'ng-zorro-antd/space'; +import {AdminHeaderComponent} from '../../components/admin-header/admin-header.component'; @NgModule({ declarations: [ + AdminHeaderComponent, AdminIndexComponent, AdminArticleComponent, AdminCategoryComponent, @@ -30,7 +34,9 @@ import { AdminComponent } from './admin.component'; ], imports: [ CommonModule, - AdminRoutingModule + AdminRoutingModule, + NgZorroAntdModule, + NzSpaceModule ] }) export class AdminModule {