陈鹏飞 4 years ago
parent
commit
b4f5fcb9ce
  1. 2
      src/app/pages/lockscreen/lockscreen.component.ts
  2. 2
      src/app/pages/login/login.component.ts
  3. 12
      src/app/ui/all-file/all-file.component.html
  4. 31
      src/app/ui/all-file/all-file.component.ts
  5. 2
      src/app/ui/teacherManagement/enterpriseuser.component.ts

2
src/app/pages/lockscreen/lockscreen.component.ts

@ -29,6 +29,8 @@ export class LockscreenComponent implements OnInit {
onSubmit(e){
let params = { roleType: this.roleType }
this.http.post('/api/Account/SignIn',e,{params}).subscribe((data:any)=>{
sessionStorage.setItem('username',e.name)
sessionStorage.setItem('expires',data.expires)
sessionStorage.setItem('realName',data.realName)
sessionStorage.setItem('roleType',data.roleType)
sessionStorage.setItem("token",data.token);

2
src/app/pages/login/login.component.ts

@ -29,6 +29,8 @@ export class LoginComponent implements OnInit {
onSubmit(e){
let params = { roleType: '0' }
this.http.post('/api/Account/SignIn',e,{params}).subscribe((data:any)=>{
sessionStorage.setItem('username',e.name)
sessionStorage.setItem('expires',data.expires)
sessionStorage.setItem('realName',data.realName)
sessionStorage.setItem('roleType',data.roleType)
sessionStorage.setItem("token",data.token);

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

@ -29,7 +29,6 @@
<mat-icon>delete</mat-icon> <span>删除</span>
</div>
<div class="progressBox" *ngIf="uploadisLoading">
<button mat-raised-button style="margin-right: 5px;width: 84px;height: 33px;" (click)="cancel()">取消上传</button>
<span style="font-size: 12px;">上传中...</span>
@ -141,13 +140,14 @@
<span style="font-size: 14px;cursor: default;">您还没上传过文件哦~</span>
</div>
</div>
<div class="openSystem" *ngIf="!selectedDataBank.includes('/')">
<a (click)="openteacher()" href="ax://startup?"> <mat-icon style="vertical-align: middle; font-size: 24px;">account_balance</mat-icon> 战术授课<span>进入</span></a>
</div>
<div class="openSystem" *ngIf="!selectedDataBank.includes('/')">
<a (click)="openlearn()" href="ax2://startup?"> <mat-icon style="vertical-align: middle; font-size: 24px;">account_balance</mat-icon> 战术学习<span>进入</span></a>
<div class="openSystem" *ngIf="!selectedDataBank.includes('/') && roleType =='1' " >
<a (click)="openteacher()" [href]='aHrefUnsafeLearnFun()'> <mat-icon style="vertical-align: middle; font-size: 24px;">account_balance</mat-icon> 战术授课<span>进入</span></a>
</div>
<div class="openSystem" *ngIf="!selectedDataBank.includes('/') && roleType == '2' ">
<a (click)="openlearn()" [href]='aHrefUnsafeLearnFun()'> <mat-icon style="vertical-align: middle; font-size: 24px;">account_balance</mat-icon> 战术学习<span>进入</span></a>
</div>
<div class="fixedBox" [hidden]="!uploadisLoading2">
<app-upload-files [thatFile]='this' #child></app-upload-files>

31
src/app/ui/all-file/all-file.component.ts

@ -4,11 +4,11 @@ import {MatSort} from '@angular/material/sort';
import {MatTableDataSource} from '@angular/material/table';
import { HttpClient,HttpHeaders } from '@angular/common/http';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { IsLoginService } from '../../is-login.service'
import { IsLoginService } from '../../is-login.service';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import {UploadFilesComponent} from '../upload-files/upload-files.component'
import { ComponentServiceService } from '../../component-service.service'
import {UploadFilesComponent} from '../upload-files/upload-files.component';
import { ComponentServiceService } from '../../component-service.service';
import { DomSanitizer } from "@angular/platform-browser";
@Component({
selector: 'app-all-file',
templateUrl: './all-file.component.html',
@ -18,7 +18,7 @@ export class AllFileComponent {
displayedColumns: string[] = ['select', 'name', 'weight', 'time'];
dataSource:any = new MatTableDataSource;
constructor(public emitService: ComponentServiceService,private http: HttpClient,public snackBar: MatSnackBar,public downloadFile:IsLoginService,public dialog: MatDialog,private zone: NgZone) { }
constructor(private sanitizer: DomSanitizer,public emitService: ComponentServiceService,private http: HttpClient,public snackBar: MatSnackBar,public downloadFile:IsLoginService,public dialog: MatDialog,private zone: NgZone) { }
isCancel:boolean = false //搜索框的X是否显示
searchData:any = "搜索您的文件" //搜索框内容
isClickFile:boolean = false //是否点击过文件
@ -28,7 +28,6 @@ export class AllFileComponent {
isAdmin:boolean = false //是否是管理员
selectedDataBank:string = '' //当前需要显示的资料库
fileNum:any = 0 //当前资料库文件数量
@ -65,7 +64,11 @@ export class AllFileComponent {
}
}
roleType:any
aHrefUnsafe:any //战术授课a标签 去除unsafe标志
ngOnInit(): void {
this.roleType = sessionStorage.getItem('roleType')
this.dataSource.sort = this.sort;
this.getALLFileList("支队级-主官")
@ -79,6 +82,18 @@ export class AllFileComponent {
this.isAdmin = true
}
}
aHrefUnsafeLearnFun(){
this.roleType = sessionStorage.getItem('roleType')
let username = sessionStorage.getItem('username')
let expires = sessionStorage.getItem('expires')
let realName = sessionStorage.getItem('realName')
let roleType = sessionStorage.getItem('roleType')
let token = sessionStorage.getItem('token')
let refreshToken = sessionStorage.getItem('refreshToken')
let aHref = `ax://startup?username=${username}&token=${token}&refreshToken=${refreshToken}&expires=${expires}&realname=${realName}&roleType=${roleType}`
this.aHrefUnsafe = this.sanitizer.bypassSecurityTrustUrl(aHref);
return this.aHrefUnsafe
}
//获得当前资料库的文件列表
getALLFileList(name){
@ -688,6 +703,7 @@ export class AllFileComponent {
let arrList = [] //匹配到 禁止删除的 目录
this.selection.selected.forEach((element)=>{
let data = element.key.split("/");
this.isTrueDelete.forEach(elements => {
if (elements==data[data.length-2] && data.length-2==2 && !data[data.length-1]) {
arrList.push('true')
@ -704,8 +720,6 @@ export class AllFileComponent {
let result = await new Promise((result,reject)=>{
if(element.isDir){ //如果是文件夹
// let lastIndex = element.key.lastIndexOf("/")
// let prefix = element.key.substring(0,lastIndex)
let paramsdata:any = {
prefix : element.key,
recursive : true
@ -724,7 +738,6 @@ export class AllFileComponent {
this.isDelete = false
}
result(data)
})
}else{
this.http.delete(`/api/Objects/drives/${element.key}`).subscribe(data=>{

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

@ -269,7 +269,7 @@ export class editTeacher {
let body = {
name : this.data.name,
realName : e.realName,
roleType : 2,
roleType : 1,
enabled : this.data.enabled,
creationTime : date,
posts : postsObj

Loading…
Cancel
Save