From 9b7aeb403bb9942eaa20907333df180153217a03 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Fri, 6 Nov 2020 08:25:25 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=B8=83=E5=B1=80=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/pages/login/login.component.scss | 2 +- src/app/ui/home/home.component.html | 30 ++++++++- src/app/ui/home/home.component.scss | 77 ++++++++++++++++++++++++ src/app/ui/home/home.component.ts | 42 ++++++++++++- 4 files changed, 148 insertions(+), 3 deletions(-) diff --git a/src/app/pages/login/login.component.scss b/src/app/pages/login/login.component.scss index 0c628e3..9c3ceb1 100644 --- a/src/app/pages/login/login.component.scss +++ b/src/app/pages/login/login.component.scss @@ -49,7 +49,7 @@ text-align: center; margin-bottom: 0.488281rem; background-image:-webkit-linear-gradient(right,#f18d6f,#FF4923); - font-weight: 800; + font-weight: 900; font-family: KaiTi; -webkit-background-clip:text; font-size: 0.273438rem; diff --git a/src/app/ui/home/home.component.html b/src/app/ui/home/home.component.html index 4e103ca..f0f913a 100644 --- a/src/app/ui/home/home.component.html +++ b/src/app/ui/home/home.component.html @@ -1,3 +1,31 @@
- 首页 + +
+ + +
+ 欢迎您,广西总队 + account_circle + + + +
+
+ +
+
+
+
+ + + +
+
+
+
+
+ +
+
+
diff --git a/src/app/ui/home/home.component.scss b/src/app/ui/home/home.component.scss index eeabf97..9c713f1 100644 --- a/src/app/ui/home/home.component.scss +++ b/src/app/ui/home/home.component.scss @@ -3,5 +3,82 @@ height: 100%; box-sizing: border-box; padding: 0.009766rem; + display: flex; + flex-direction: column; overflow: hidden; + header { + width: 100%; + height: 0.585938rem; + line-height: 0.585938rem; + text-align: center; + position: relative; + label { font-weight: 550; } + .floatRight { + position: absolute; + top: 0.146484rem; + right: 0.244141rem; + height: 0.292969rem; + line-height: 0.292969rem; + font-size: 0.136719rem; + .mat-icon { + vertical-align: middle; + cursor: pointer; + color: #999; + margin-left: 0.048828rem; + } + } + } + .center { + flex: 1; + background: #F4F5F9; + display: flex; + flex-direction: column; + padding: 0.097656rem; + box-sizing: border-box; + overflow: hidden; + } +} + +//头部 +.oneColor { + background-image:-webkit-linear-gradient(right,#f18d6f,#FF4923); + -webkit-background-clip:text; + -webkit-text-fill-color:transparent; +} +.twoColor { + background-image:-webkit-linear-gradient(right,rgb(38, 91, 238),skyblue,); + -webkit-background-clip:text; + -webkit-text-fill-color:transparent; +} +button.mat-menu-item { text-align: center; } + +//中间内容区 +.centerHeader { + width: 100%; + height: 0.488281rem; + display: flex; + justify-content: center; + align-items: center; + div { margin: 0 0.097656rem } + input { + height: 0.292969rem; + line-height: 0.292969rem; + padding-left: 0.048828rem; + border-radius: 0.195313rem; + outline: none; + border: 0.009766rem solid #999; + } + button { + width: 0.78125rem; + height: 0.341797rem; + line-height: 0.341797rem; + border-radius: 0.195313rem; + outline: none; + border: none; + color: #fff; + } +} +.mat-datepicker-toggle{ vertical-align: middle; } +.centerTable { + flex: 1; } \ No newline at end of file diff --git a/src/app/ui/home/home.component.ts b/src/app/ui/home/home.component.ts index 73acf06..1642a5e 100644 --- a/src/app/ui/home/home.component.ts +++ b/src/app/ui/home/home.component.ts @@ -1,4 +1,11 @@ +import { HttpClient } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; +import { FormControl } from '@angular/forms'; +import { DateAdapter } from '@angular/material/core'; +import { MatDialog } from '@angular/material/dialog'; +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; +import { Router } from '@angular/router'; +import { CacheTokenService } from 'src/app/http-interceptors/cache-token.service'; @Component({ selector: 'app-home', @@ -7,9 +14,42 @@ import { Component, OnInit } from '@angular/core'; }) export class HomeComponent implements OnInit { - constructor() { } + constructor(private http:HttpClient,public token:CacheTokenService,public dialog: MatDialog,private router:Router,public snackBar: MatSnackBar,private adapter: DateAdapter,) { } ngOnInit(): void { + this.adapter.setLocale('CH'); + this.enddate = new FormControl(new Date()); //日历结束时间显示 } + enddate:any; //查询时间 + + //退出系统 + signOut () { + let out = confirm("您确定要退出吗") + if(out) { + this.http.post('/api/Account/SignOut',{}).subscribe(data=> { + this.token.delete() + sessionStorage.clear() + window.localStorage.clear() + this.router.navigate(['/login']) + const config = new MatSnackBarConfig(); + config.verticalPosition = 'bottom'; + config.duration = 3000 + this.snackBar.open('成功退出','确定',config); + }) + } + } + + //查询 + query () { + + } + + //新增 + add () { + + } + + + }