diff --git a/package-lock.json b/package-lock.json index fab0c0e..d88c972 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15968,7 +15968,8 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -16011,7 +16012,8 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", @@ -16022,7 +16024,8 @@ "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -16139,7 +16142,8 @@ "inherits": { "version": "2.0.4", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -16151,6 +16155,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -16180,6 +16185,7 @@ "version": "2.9.0", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -16198,6 +16204,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -16300,6 +16307,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -16385,7 +16393,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -16421,6 +16430,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -16440,6 +16450,7 @@ "version": "3.0.1", "bundled": true, "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -16483,12 +16494,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, @@ -16926,7 +16939,8 @@ "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -17043,7 +17057,8 @@ "inherits": { "version": "2.0.4", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -17085,6 +17100,7 @@ "version": "2.9.0", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -17103,6 +17119,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -17205,6 +17222,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -17290,7 +17308,8 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -17326,6 +17345,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -17389,12 +17409,14 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.1.1", "bundled": true, - "dev": true + "dev": true, + "optional": true } } }, diff --git a/src/app/navigation/navigation.component.html b/src/app/navigation/navigation.component.html index 5515279..b5ae58f 100644 --- a/src/app/navigation/navigation.component.html +++ b/src/app/navigation/navigation.component.html @@ -65,6 +65,9 @@
  • {{item.name}}
  • + diff --git a/src/app/pages/lockscreen/lockscreen.component.scss b/src/app/pages/lockscreen/lockscreen.component.scss index 1856376..c872d8a 100644 --- a/src/app/pages/lockscreen/lockscreen.component.scss +++ b/src/app/pages/lockscreen/lockscreen.component.scss @@ -51,6 +51,7 @@ position: fixed; bottom: 35px; font-size: 14px; + color: white; } .toLogin{ color: #B0B0B0; diff --git a/src/app/pipes/size.pipe.ts b/src/app/pipes/size.pipe.ts index 3171b48..7e12666 100644 --- a/src/app/pipes/size.pipe.ts +++ b/src/app/pipes/size.pipe.ts @@ -32,4 +32,10 @@ export class NamePipe2 implements PipeTransform { let nameArr = name.split("/") return nameArr[nameArr.length - 2] } +} +@Pipe({name: 'name3'}) +export class NamePipe3 implements PipeTransform { + transform(name: string): string { + return name.replace(/\//g,'>').substring(9,name.length) + } } \ No newline at end of file diff --git a/src/app/ui/all-file/all-file.component.ts b/src/app/ui/all-file/all-file.component.ts index 4cc2e2e..585332f 100644 --- a/src/app/ui/all-file/all-file.component.ts +++ b/src/app/ui/all-file/all-file.component.ts @@ -235,25 +235,22 @@ export class AllFileComponent { goback:any //记录上一级目录 //点击列表每一条的名字 clickName(e,item){ - // console.log(item) + console.log(e,item) e.stopPropagation() if(item.type == "jpg" || item.type == "png" || item.type == "bmp"|| item.type == "gif" || item.type == "jpeg"&& !item.isDir){ const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去 - data: {url:item.key,type:"img"} }); - + this.downloadFile.handleData(item.key,"查看") }else if(item.type == "mp4" || item.type == "MP4" && !item.isDir){ - console.log(666,item.key) const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去 width: '1400px', height:'800px', data: {url:item.key,type:"video"} }); - dialogRef.afterClosed().subscribe( - - ); + dialogRef.afterClosed().subscribe(); + this.downloadFile.handleData(item.key,"查看") }else if(item.type == "mp3" || item.type == "MP3"&& !item.isDir){ const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去 @@ -261,13 +258,11 @@ export class AllFileComponent { height:'108px', data: {url:item.key,type:"mp3"} }); - dialogRef.afterClosed().subscribe( - - ); + dialogRef.afterClosed().subscribe(); + this.downloadFile.handleData(item.key,"查看") }else if(item.type == "pdf"){ - // console.log(item) window.open("/api/Objects/drives/" + item.key) - + this.downloadFile.handleData(item.key,"查看") }else if(item.type == "gaopenche"){ window.open("GaoPenChe") @@ -310,6 +305,9 @@ export class AllFileComponent { config.duration = 3000 this.snackBar.open('该文件类型暂不支持在线查看,请下载查看','确定',config) } + + + } //返回上一级目录 backTominTop(){ diff --git a/src/app/ui/enterpriseuser/addenterpriseuser.component.ts b/src/app/ui/enterpriseuser/addenterpriseuser.component.ts index f52acd0..2493598 100644 --- a/src/app/ui/enterpriseuser/addenterpriseuser.component.ts +++ b/src/app/ui/enterpriseuser/addenterpriseuser.component.ts @@ -55,6 +55,7 @@ export class AddEnterpriserUser { creationTime : date, posts : postsObj } + // console.log(date) this.http.post("/api/Users",body).subscribe( data => { this.dialogRef.close(data); }) diff --git a/src/app/ui/enterpriseuser/enterpriseuser.component.html b/src/app/ui/enterpriseuser/enterpriseuser.component.html index 1fe73b3..beedf2f 100644 --- a/src/app/ui/enterpriseuser/enterpriseuser.component.html +++ b/src/app/ui/enterpriseuser/enterpriseuser.component.html @@ -48,7 +48,7 @@ 操作 - assessment查看学习记录 + assessment查看学习记录 cached重置密码 edit修改 remove_circle禁用 diff --git a/src/app/ui/enterpriseuser/enterpriseuser.component.ts b/src/app/ui/enterpriseuser/enterpriseuser.component.ts index e5e4bb8..ad72564 100644 --- a/src/app/ui/enterpriseuser/enterpriseuser.component.ts +++ b/src/app/ui/enterpriseuser/enterpriseuser.component.ts @@ -7,7 +7,7 @@ import { PageEvent } from '@angular/material/paginator'; import { AddEnterpriserUser } from './addenterpriseuser.component' import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import {FormControl} from '@angular/forms'; - +import { Router,ActivatedRoute } from '@angular/router' @Component({ selector: 'app-enterpriseuser', templateUrl: './enterpriseuser.component.html', @@ -15,7 +15,7 @@ import {FormControl} from '@angular/forms'; }) export class EnterpriseuserComponent implements OnInit { - constructor(public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { } + constructor(public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private router:Router,private route:ActivatedRoute) { } ngOnInit() { this.initData() @@ -64,7 +64,6 @@ export class EnterpriseuserComponent implements OnInit { RoleType: '2', } this.http.get('/api/Users',{params:data}).subscribe((data:any)=>{ - console.log(666,data) this.length = data.totalCount this.pageSize = data.pageSize this.pageEvent.pageIndex = 0 @@ -94,6 +93,10 @@ export class EnterpriseuserComponent implements OnInit { this.initData() } + //跳转学习记录 + openRecord(e){ + this.router.navigate([`/home/statistics?name=${e.realName}&id=${e.name}`]) + } //创建用户 open(){ let dialogRef = this.dialog.open(AddEnterpriserUser, {//调用open方法打开对话框并且携带参数过去 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 new file mode 100644 index 0000000..9c05fb8 --- /dev/null +++ b/src/app/ui/learning-record-details/learning-record-details.component.html @@ -0,0 +1,49 @@ + +
    +
    +
    + +
    +
    +
    + 开始时间 : + + + + + +
    +
    + 结束时间 : + + + + + +
    +
    +
    + + +
    +
    + +
    +
      +
    • +

      {{item.time}}

      + + {{item.time2}} + {{item.operation}} : {{item.target | name3}} + + +
    • +
    + + + +
    +
    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 new file mode 100644 index 0000000..5d92c75 --- /dev/null +++ b/src/app/ui/learning-record-details/learning-record-details.component.scss @@ -0,0 +1,43 @@ +.topbox{ + display: flex; + width: 100%; + height:7%; + line-height: 66px; + // border-bottom: 1px solid gray; + justify-content: space-around; + .datasearch{ + display: flex; + div{ + margin: 0 10px; + span{ + margin-right: 5px; + } + mat-form-field{ + input{ + padding-left: 3px; + } + } + + } + } + .btnbox{ + button{ + margin: 0 10px; + } + } +} +.listbox{ + margin-top: 18px; + margin-left: 26%; + height: 82%; + overflow-y: auto; + .timeTitle{ + font-weight: 800; + font-size: 18px; + } + .listitem{ + margin-left: 80px; + font-size: 16px; + line-height: 30px; + } +} \ 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 new file mode 100644 index 0000000..5b04c6c --- /dev/null +++ b/src/app/ui/learning-record-details/learning-record-details.component.ts @@ -0,0 +1,143 @@ +import { Component, OnInit ,ViewChild} from '@angular/core'; +import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core'; +import {MatDatepicker} from '@angular/material/datepicker'; +import {FormControl} from '@angular/forms'; +import {HttpClient} from '@angular/common/http'; +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; +import { MatPaginator } from '@angular/material/paginator'; +import { PageEvent } from '@angular/material/paginator'; +import { Router,ActivatedRoute } from '@angular/router' +@Component({ + selector: 'app-learning-record-details', + templateUrl: './learning-record-details.component.html', + styleUrls: ['./learning-record-details.component.scss'] +}) +export class LearningRecordDetailsComponent implements OnInit { + startdate:any //开始时间 + enddate:any //结束时间 + constructor(private adapter: DateAdapter,private http:HttpClient,public snackBar: MatSnackBar,private router:Router,private route:ActivatedRoute) { } + + lastdate:any //上个月日期 + + startTime:any //开始时间查询条件 + endTime:any //结束时间查询条件 + + Catalog:any = this.route.snapshot.queryParams.Catalog || "" //目录 + + PageNumber:any = 1//当前页数 + id:any = this.route.snapshot.queryParams.id//身份证 + + + recordList:any//渲染的100条列表 + oneMonthDate:number = 30*24*60*60*1000; //一个月的时间戳 + + + //分页 + @ViewChild(MatPaginator, {static: true}) + pageEvent: PageEvent; + paginator: MatPaginator; + length:any; //共多少条数据 + pageSize:any; //每页条数 + // pageSizeOptions: number[] = [10] //设置每页条数 + pageNumber:number = 1; //第几页 + + ngOnInit(): void { + this.adapter.setLocale('CH'); + + let nowdate = new Date().toLocaleDateString() //本月日期 2020/07/11 形式 + this.lastdate = new Date(new Date().getTime()-this.oneMonthDate).toLocaleDateString() //上个月日期 2020/06/11 形式 + + this.startdate = new FormControl(new Date(this.lastdate)); //日历开始时间显示 + this.enddate = new FormControl(new Date()); //日历结束时间显示 + + this.startTime = this.getTIme(new Date(this.lastdate)) + this.endTime = this.getTIme(new Date()) + + this.getAllStudyRecords() + } + + + //分页切换 + chagePage (e) { + this.pageNumber = e.pageIndex+1 + let date:any = new Date() + let data = { + Name : this.id, + StartTime : this.startTime, + EndTime : this.endTime, + Catalog : this.Catalog, + PageNumber : String(this.pageNumber), + PageSize:"100" + } + 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 + }) + } + + //传入 new Date()格式 将日期变为 年月日时分秒 + getTIme(date){ + let year = date.getFullYear(); //年 + let month = date.getMonth() + 1; //月 + let day = date.getDate(); //日 + let hour = date.getHours() //时 + let min = date.getMinutes(); //分 + let seconds = date.getSeconds(); //秒 + return year+'-'+month+'-'+ day + " "+ hour +':'+ min +':'+ seconds; + } + + //获得所有学习记录 + getAllStudyRecords(){ + let date:any = new Date() + let data = { + Name : this.id, + StartTime : this.startTime, + EndTime : this.endTime, + Catalog : this.Catalog || "", + PageNumber : this.PageNumber, + PageSize:"100" + } + 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 + }) + } + + //查询 + onSubmit(){ + if(this.startdate.value > this.enddate.value){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('起始时间大于结束时间','确定',config); + } + if(this.enddate.value.toLocaleDateString() == new Date().toLocaleDateString() || this.enddate.value > new Date()){ + this.enddate.value = new Date() + } + if(this.enddate.value < new Date() && this.enddate.value.toLocaleDateString() != new Date().toLocaleDateString()){ + this.enddate.value = new Date(this.enddate.value.getTime() + 24*60*60*1000) + } + this.startTime = this.getTIme(this.startdate.value) + this.endTime = this.getTIme(this.enddate.value) + this.getAllStudyRecords() + } + //重置 + reset(){ + this.startdate = new FormControl(new Date(this.lastdate)); //日历开始时间显示 + this.enddate = new FormControl(new Date()); //日历结束时间显示 + this.startTime = this.getTIme(this.startdate.value) + this.endTime = this.getTIme(this.enddate.value) + this.getAllStudyRecords() + } +} diff --git a/src/app/ui/ui-routing.module.ts b/src/app/ui/ui-routing.module.ts index eb06364..4f6a533 100644 --- a/src/app/ui/ui-routing.module.ts +++ b/src/app/ui/ui-routing.module.ts @@ -3,10 +3,12 @@ import { NgModule } from '@angular/core'; import { AllFileComponent } from './all-file/all-file.component'; import { EnterpriseuserComponent } from './enterpriseuser/enterpriseuser.component'; import { TeacherManagementComponent } from './teacherManagement/enterpriseuser.component'; +import { LearningRecordDetailsComponent } from './learning-record-details/learning-record-details.component'; const routes: Routes = [ { path: '', component:AllFileComponent }, { path: 'userManagement', component:EnterpriseuserComponent }, - { path: 'teacherManagement', component:TeacherManagementComponent } + { path: 'teacherManagement', component:TeacherManagementComponent }, + { path: 'learningrecorddetails', component:LearningRecordDetailsComponent } ]; @NgModule({ diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts index ba63d57..2cf4e8c 100644 --- a/src/app/ui/ui.module.ts +++ b/src/app/ui/ui.module.ts @@ -47,7 +47,7 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatPaginatorIntl } from '@angular/material/paginator'; import { PersonaldataComponent } from '../pages/personaldata/personaldata.component'; import { ChangepasswordComponent } from './changepassword/changepassword.component'; -import { SizePipe , NamePipe,NamePipe2} from '../pipes/size.pipe'; +import { SizePipe , NamePipe,NamePipe2, NamePipe3} from '../pipes/size.pipe'; import {ConfirmpswDirective} from './changepassword/equal-validator.directive'; import { FileUploadModule } from 'ng2-file-upload' import { AllFileComponent, ViewDetails, FolderDialog } from './all-file/all-file.component'; @@ -60,8 +60,9 @@ import {EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser} from './en import { myPaginator } from "./my-paginator" import { TeacherManagementComponent, editTeacher, seeTeacher } from './teacherManagement/enterpriseuser.component'; import { AddTeacher } from './teacherManagement/addenterpriseuser.component'; +import { LearningRecordDetailsComponent } from './learning-record-details/learning-record-details.component'; @NgModule({ - declarations: [FolderDialog,ViewDetails,PersonaldataComponent, ChangepasswordComponent,SizePipe,NamePipe,NamePipe2,ConfirmpswDirective, AllFileComponent, ChangeuserdataComponent, LoginComponent, UploadFilesComponent,AddEnterpriserUser,EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser,TeacherManagementComponent,editTeacher,AddTeacher,seeTeacher], + declarations: [FolderDialog,ViewDetails,PersonaldataComponent, ChangepasswordComponent,SizePipe,NamePipe,NamePipe2,NamePipe3,ConfirmpswDirective, AllFileComponent, ChangeuserdataComponent, LoginComponent, UploadFilesComponent,AddEnterpriserUser,EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser,TeacherManagementComponent,editTeacher,AddTeacher,seeTeacher, LearningRecordDetailsComponent], imports: [ CommonModule, diff --git a/tsconfig.json b/tsconfig.json index 30956ae..9ddd180 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,8 @@ "lib": [ "es2018", "dom" - ] + ], + "allowSyntheticDefaultImports": true }, "angularCompilerOptions": { "fullTemplateTypeCheck": true,