|
|
|
@ -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(){ |
|
|
|
|