Browse Source

[完善]跳转两种学习记录网页

master
邵佳豪 5 years ago
parent
commit
fdad0daf5a
  1. 2
      src/app/navigation/navigation.component.html
  2. 4
      src/app/navigation/navigation.component.ts
  3. 11
      src/app/ui/all-file/all-file.component.html
  4. 44
      src/app/ui/all-file/all-file.component.ts
  5. 3
      src/app/ui/enterpriseuser/enterpriseuser.component.ts
  6. 6
      src/app/ui/learning-record-details/learning-record-details.component.html
  7. 3
      src/app/ui/learning-record-details/learning-record-details.component.scss
  8. 15
      src/app/ui/learning-record-details/learning-record-details.component.ts
  9. 2
      src/app/ui/teacherManagement/enterpriseuser.component.html

2
src/app/navigation/navigation.component.html

@ -57,7 +57,7 @@
</ul>
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel *ngIf="isAdmin">
<mat-expansion-panel-header>
系统管理
</mat-expansion-panel-header>

4
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
}
}

11
src/app/ui/all-file/all-file.component.html

@ -1,8 +1,8 @@
<div class="topbox">
<div class="leftbox">
<div class="upload" (mouseenter)="uploadBtnEnter()" (mouseleave)="uploadBtnLeave()">
<div class="btn" style="width: 88px;height: 33px;">
<div class="upload" (mouseenter)="uploadBtnEnter()" (mouseleave)="uploadBtnLeave()" *ngIf="isAdmin">
<div class="btn" style="width: 88px;height: 33px;" >
<mat-icon>backup</mat-icon><span> 上传</span>
<input type="file" (change)='selectFile($event)'>
</div>
@ -17,7 +17,7 @@
</div>
</div>
</div>
<div class="newFile" (click)="createFolder()">
<div class="newFile" (click)="createFolder()" *ngIf="isAdmin">
<mat-icon>create_new_folder</mat-icon> <span>新建文件夹</span>
</div>
@ -25,7 +25,7 @@
<mat-icon>save_alt</mat-icon> <span>下载</span>
</div>
<div class="newFile" style="width: 88px;" *ngIf="isDelete" (click)="deleteFiles()">
<div class="newFile" style="width: 88px;" *ngIf="isDelete && isAdmin" (click)="deleteFiles()" >
<mat-icon>delete</mat-icon> <span>删除</span>
</div>
@ -150,4 +150,7 @@
<app-upload-files [thatFile]='this' #child></app-upload-files>
</div>
<ul>
<li *ngFor="let item of checkedAllFiles">{{item.key}}</li>
</ul>

44
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)
})

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

6
src/app/ui/learning-record-details/learning-record-details.component.html

@ -2,19 +2,19 @@
<div style="height: 100%; width: 100%;">
<div class="topbox">
<div class="backtop">
<button type="button" mat-raised-button color="primary" routerLink="/home/statistics"><mat-icon style="vertical-align: middle;font-size: 20px;">reply</mat-icon>返回</button>
<button type="button" mat-raised-button color="primary" (click)="backtop()"><mat-icon style="vertical-align: middle;font-size: 20px;">reply</mat-icon>返回</button>
</div>
<div class="datasearch">
<div class="starttime">
<span>开始时间 :</span>
<input style="width: 220px; height:22px;line-height: 22px;font-size: 15px;" matInput [matDatepicker]="dp" readonly [formControl]="startdate">
<input style="width: 220px; height:21px;line-height: 21px;font-size: 15px;" matInput [matDatepicker]="dp" readonly [formControl]="startdate">
<mat-datepicker-toggle matSuffix [for]="dp"></mat-datepicker-toggle>
<mat-datepicker #dp disabled="false"></mat-datepicker>
</div>
<div class="endtime">
<span>结束时间 :</span>
<input style="width: 220px; height:22px;line-height: 22px;font-size: 15px;" matInput [matDatepicker]="dp2" readonly [formControl]="enddate">
<input style="width: 220px; height:21px;line-height: 21px;font-size: 15px;" matInput [matDatepicker]="dp2" readonly [formControl]="enddate">
<mat-datepicker-toggle matSuffix [for]="dp2"></mat-datepicker-toggle>
<mat-datepicker #dp2 disabled="false"></mat-datepicker>
</div>

3
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;
}
}

15
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

2
src/app/ui/teacherManagement/enterpriseuser.component.html

@ -48,7 +48,7 @@
<ng-container matColumnDef="operation">
<th mat-header-cell *matHeaderCellDef>操作</th>
<td mat-cell *matCellDef="let element">
<span class="operationSpan"><mat-icon class="icon">assessment</mat-icon><span class="spanbtn blue">查看学习记录</span></span>
<!-- <span class="operationSpan"><mat-icon class="icon">assessment</mat-icon><span class="spanbtn blue">查看学习记录</span></span> -->
<span class="operationSpan"><mat-icon class="icon">cached</mat-icon><span class="spanbtn blue" (click)="reset(element)">重置密码</span></span>
<span class="operationSpan"><mat-icon class="icon">edit</mat-icon><span class="spanbtn blue" (click)="edit(element)">修改</span></span>
<span *ngIf="element.enabled" class="operationSpan"><mat-icon class="icon" style="color: rgb(245, 34, 45);">remove_circle</mat-icon><span class="spanbtn blue" (click)="noEnabled(element)">禁用</span></span>

Loading…
Cancel
Save