From 0bba21fc6d5cb7fe3ef610f24251aa4fa325cef0 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Mon, 13 Jul 2020 11:31:11 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E4=BF=AE=E6=94=B9=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../learning-record-details.component.html | 11 +++---- .../learning-record-details.component.scss | 11 +++++-- .../learning-record-details.component.ts | 30 +++++++++++++++++-- src/styles.scss | 4 +++ 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/src/app/ui/learning-record-details/learning-record-details.component.html b/src/app/ui/learning-record-details/learning-record-details.component.html index 9c05fb8..09325b8 100644 --- a/src/app/ui/learning-record-details/learning-record-details.component.html +++ b/src/app/ui/learning-record-details/learning-record-details.component.html @@ -2,24 +2,21 @@
- +
开始时间 : - - + - +
结束时间 : - - + -
diff --git a/src/app/ui/learning-record-details/learning-record-details.component.scss b/src/app/ui/learning-record-details/learning-record-details.component.scss index 5d92c75..cba0bf2 100644 --- a/src/app/ui/learning-record-details/learning-record-details.component.scss +++ b/src/app/ui/learning-record-details/learning-record-details.component.scss @@ -14,7 +14,10 @@ } mat-form-field{ input{ - padding-left: 3px; + padding-left: 3px; + // width: 200px; + // height: 26px; + // line-height: 26px; } } @@ -29,7 +32,7 @@ .listbox{ margin-top: 18px; margin-left: 26%; - height: 82%; + height: 84%; overflow-y: auto; .timeTitle{ font-weight: 800; @@ -40,4 +43,8 @@ font-size: 16px; line-height: 30px; } +} +.mat-paginator { + background-color: hsla(0,0%,100%,0); + padding-right: 10%; } \ No newline at end of file diff --git a/src/app/ui/learning-record-details/learning-record-details.component.ts b/src/app/ui/learning-record-details/learning-record-details.component.ts index 5b04c6c..7b7471d 100644 --- a/src/app/ui/learning-record-details/learning-record-details.component.ts +++ b/src/app/ui/learning-record-details/learning-record-details.component.ts @@ -26,7 +26,7 @@ export class LearningRecordDetailsComponent implements OnInit { PageNumber:any = 1//当前页数 id:any = this.route.snapshot.queryParams.id//身份证 - + PostName:any = this.route.snapshot.queryParams.PostName.replace(/-/g,'/')//传过来的职务名称 recordList:any//渲染的100条列表 oneMonthDate:number = 30*24*60*60*1000; //一个月的时间戳 @@ -42,6 +42,7 @@ export class LearningRecordDetailsComponent implements OnInit { pageNumber:number = 1; //第几页 ngOnInit(): void { + console.log(this.PostName) this.adapter.setLocale('CH'); let nowdate = new Date().toLocaleDateString() //本月日期 2020/07/11 形式 @@ -91,8 +92,30 @@ export class LearningRecordDetailsComponent implements OnInit { return year+'-'+month+'-'+ day + " "+ hour +':'+ min +':'+ seconds; } - //获得所有学习记录 + //初始获得所有学习记录 getAllStudyRecords(){ + let date:any = new Date() + let data = { + Name : this.id, + Catalog : this.Catalog || "", + PageNumber : this.PageNumber, + PageSize:"100", + PostName:"" + } + this.http.get("/api/StudyRecords",{params:data}).subscribe((data:any) => { + this.recordList = data.items + this.recordList.forEach((item) => { + item.time = item.creationTime.substring(0,10) + item.time2 = item.creationTime.substring(11,16) + }) + this.length = data.totalCount + this.pageSize = data.pageSize + this.pageEvent.pageIndex = 0 + }) + } + + //带查询时间获得所有学习记录 + getAllStudyRecords2(){ let date:any = new Date() let data = { Name : this.id, @@ -114,6 +137,7 @@ export class LearningRecordDetailsComponent implements OnInit { }) } + // //查询 onSubmit(){ if(this.startdate.value > this.enddate.value){ @@ -130,7 +154,7 @@ export class LearningRecordDetailsComponent implements OnInit { } this.startTime = this.getTIme(this.startdate.value) this.endTime = this.getTIme(this.enddate.value) - this.getAllStudyRecords() + this.getAllStudyRecords2() } //重置 reset(){ diff --git a/src/styles.scss b/src/styles.scss index 43476c1..bef4481 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -83,3 +83,7 @@ table td.mat-footer-cell:last-of-type{ width: 210px; font-size: 13px!important; } + +.mat-drawer-container{ + background-color: none; +} \ No newline at end of file