diff --git a/src/app/navigation/navigation.component.html b/src/app/navigation/navigation.component.html index b5ae58f..1cc8b01 100644 --- a/src/app/navigation/navigation.component.html +++ b/src/app/navigation/navigation.component.html @@ -57,7 +57,7 @@ - + 系统管理 diff --git a/src/app/navigation/navigation.component.ts b/src/app/navigation/navigation.component.ts index 9345fe9..2af5bf3 100644 --- a/src/app/navigation/navigation.component.ts +++ b/src/app/navigation/navigation.component.ts @@ -65,6 +65,7 @@ export class NavigationComponent implements OnInit { ] + isAdmin:boolean = false ngOnInit() { // this.http.get('/api/DataBanks').subscribe((data:any) => { // if(data && data.length != 0){ @@ -73,6 +74,9 @@ export class NavigationComponent implements OnInit { // }) // this.getAllDataBank() this.selectedDataBank = "支队级-主官" + if(sessionStorage.getItem("roleType") == "0"){ + this.isAdmin = true + } } diff --git a/src/app/ui/all-file/all-file.component.html b/src/app/ui/all-file/all-file.component.html index 3d4acb1..2d0e4b6 100644 --- a/src/app/ui/all-file/all-file.component.html +++ b/src/app/ui/all-file/all-file.component.html @@ -1,8 +1,8 @@
-
-
+
+
backup 上传
@@ -17,7 +17,7 @@
-
+
create_new_folder 新建文件夹
@@ -25,7 +25,7 @@ save_alt 下载
-
+
delete 删除
@@ -150,4 +150,7 @@
+
    +
  • {{item.key}}
  • +
diff --git a/src/app/ui/all-file/all-file.component.ts b/src/app/ui/all-file/all-file.component.ts index 585332f..a199694 100644 --- a/src/app/ui/all-file/all-file.component.ts +++ b/src/app/ui/all-file/all-file.component.ts @@ -25,6 +25,8 @@ export class AllFileComponent { isDelete:boolean = false //是否删除按钮 isNoFileTitle:boolean = false //无文件时提示 + + isAdmin:boolean = false //是否是管理员 selectedDataBank:string = '' //当前需要显示的资料库 @@ -72,6 +74,10 @@ export class AllFileComponent { this.getALLFileList(value) this.selection.clear(); }); + + if(sessionStorage.getItem("roleType") == "0"){ + this.isAdmin = true + } } //获得所有资料库,默认显示第一个资料库的文件 @@ -95,7 +101,7 @@ export class AllFileComponent { this.http.get(`/api/Objects/drives`,{ params:paramsdata }).subscribe((data:any) => { - console.log(456,data) + // console.log(456,data) this.selection.clear() data.contents.forEach((item)=>{ let typeArr = item.key.split('.') @@ -214,17 +220,26 @@ export class AllFileComponent { this.searchData = "搜索您的文件" this.isCancel = false } + + + allFiles:any //搜索出来的全部文件 + checkedAllFiles:any = [] //点击搜索 search(){ - console.log(13,this.searchData) if(this.searchData != "搜索您的文件"){ this.http.get("/api/Objects/drives",{ params:{ - prefix : this.searchData, - delimiter : "/" + prefix : "allFiles", + delimiter : "" } - }).subscribe(data=>{ - console.log(data) + }).subscribe((data:any)=>{ + this.allFiles = data.contents + this.allFiles.forEach(item=>{ + if(item.key.indexOf(this.searchData)){ + this.checkedAllFiles.push(item) + } + }) + console.log(888888,data.contents) }, err=>{ @@ -235,7 +250,7 @@ export class AllFileComponent { goback:any //记录上一级目录 //点击列表每一条的名字 clickName(e,item){ - console.log(e,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){ @@ -260,9 +275,14 @@ export class AllFileComponent { }); dialogRef.afterClosed().subscribe(); this.downloadFile.handleData(item.key,"查看") - }else if(item.type == "pdf"){ + }else if(item.type == "pdf" && item.size < 20971520){ window.open("/api/Objects/drives/" + item.key) this.downloadFile.handleData(item.key,"查看") + }else if(item.type == "pdf" && item.size > 20971520){ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('暂不支持在线预览大于20M的pdf文件,请下载查看','确定',config) }else if(item.type == "gaopenche"){ window.open("GaoPenChe") @@ -613,7 +633,7 @@ export class AllFileComponent { this.objectName = data.objectName this.uploadId = data.uploadId - console.log(1) + // console.log(1) this.subsectionUploading() }) } @@ -642,7 +662,7 @@ export class AllFileComponent { "partNumber":data.partNumber || null, "eTag": data.eTag || null} resolve(msg) // 调用 promise 内置方法处理成功 - console.log(2) + // console.log(2) }) }); this.PartNumberETag.push(result) @@ -660,7 +680,7 @@ export class AllFileComponent { let data = this.PartNumberETag; let paramsData = {uploadId:this.uploadId}; this.http.post(`/api/CompleteMultipartUpload/drives/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ - console.log(3) + // console.log(3) this.getALLFileList(this.selectedDataBank); this.uploadProgress = 0; this.uploadisLoading = false; @@ -819,7 +839,7 @@ export class AllFileComponent { this.snackBar.open('文件夹不支持下载','确定',config) }else{ this.http.get('/api/ObjectMetadata/drives/' + this.selectDownloadFile.key).subscribe(data=>{ - console.log(123,data) + // console.log(123,data) this.download = data this.downloadFile.download(this.download) }) diff --git a/src/app/ui/enterpriseuser/enterpriseuser.component.ts b/src/app/ui/enterpriseuser/enterpriseuser.component.ts index 8b46fe4..bfa8860 100644 --- a/src/app/ui/enterpriseuser/enterpriseuser.component.ts +++ b/src/app/ui/enterpriseuser/enterpriseuser.component.ts @@ -95,7 +95,8 @@ export class EnterpriseuserComponent implements OnInit { //跳转学习记录 openRecord(e){ - this.router.navigate([`/home/statistics`],{queryParams:{'name':`${e.realName}`,'id':`${e.name}`}}) + // this.router.navigate([`/home/statistics`],{queryParams:{'name':`${e.realName}`,'id':`${e.name}`}}) + window.open(`/home/statistics?name=${e.realName}&id=${e.name}`) } //创建用户 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 index 09325b8..c58b5c2 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,19 +2,19 @@
- +
开始时间 : - +
结束时间 : - +
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 cba0bf2..6bf57f4 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 @@ -15,9 +15,6 @@ mat-form-field{ input{ padding-left: 3px; - // width: 200px; - // height: 26px; - // line-height: 26px; } } 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 7b7471d..539b457 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,'/')//传过来的职务名称 + PostName:any = this.route.snapshot.queryParams.PostName || "" //传过来的职务名称 recordList:any//渲染的100条列表 oneMonthDate:number = 30*24*60*60*1000; //一个月的时间戳 @@ -42,7 +42,6 @@ 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 形式 @@ -68,7 +67,8 @@ export class LearningRecordDetailsComponent implements OnInit { EndTime : this.endTime, Catalog : this.Catalog, PageNumber : String(this.pageNumber), - PageSize:"100" + PageSize:"100", + PostName : this.PostName } this.http.get("/api/StudyRecords",{params:data}).subscribe((data:any) => { this.recordList = data.items @@ -100,7 +100,7 @@ export class LearningRecordDetailsComponent implements OnInit { Catalog : this.Catalog || "", PageNumber : this.PageNumber, PageSize:"100", - PostName:"" + PostName:this.PostName } this.http.get("/api/StudyRecords",{params:data}).subscribe((data:any) => { this.recordList = data.items @@ -114,6 +114,10 @@ export class LearningRecordDetailsComponent implements OnInit { }) } + //返回上一页 + backtop(){ + history.go(-1) + } //带查询时间获得所有学习记录 getAllStudyRecords2(){ let date:any = new Date() @@ -123,7 +127,8 @@ export class LearningRecordDetailsComponent implements OnInit { EndTime : this.endTime, Catalog : this.Catalog || "", PageNumber : this.PageNumber, - PageSize:"100" + PageSize:"100", + PostName:this.PostName } this.http.get("/api/StudyRecords",{params:data}).subscribe((data:any) => { this.recordList = data.items diff --git a/src/app/ui/teacherManagement/enterpriseuser.component.html b/src/app/ui/teacherManagement/enterpriseuser.component.html index 3d6eb06..651eba4 100644 --- a/src/app/ui/teacherManagement/enterpriseuser.component.html +++ b/src/app/ui/teacherManagement/enterpriseuser.component.html @@ -48,7 +48,7 @@ 操作 - assessment查看学习记录 + cached重置密码 edit修改 remove_circle禁用