57 changed files with 2 additions and 3830 deletions
@ -1,159 +0,0 @@ |
|||||||
|
|
||||||
<div class="topbox"> |
|
||||||
<div class="leftbox"> |
|
||||||
<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> |
|
||||||
<div class="openbtn" style="position: absolute;" *ngIf="isOpenUpload"> |
|
||||||
<div> |
|
||||||
<span>上传文件</span> |
|
||||||
<input type="file" (change)='selectFile($event)'> |
|
||||||
</div> |
|
||||||
<div> |
|
||||||
<span>上传文件夹</span> |
|
||||||
<input multiple webkitdirectory type="file" (change)='selectFiles($event)'> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="newFile" (click)="createFolder()" *ngIf="isAdmin"> |
|
||||||
<mat-icon>create_new_folder</mat-icon> <span>新建文件夹</span> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="newFile" style="width: 88px;" (click)='downLoadFile()'> |
|
||||||
<mat-icon>save_alt</mat-icon> <span>下载</span> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="newFile delete" style="width: 88px;" *ngIf="isAdmin" (click)="deleteFiles()" > |
|
||||||
<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> |
|
||||||
<mat-progress-bar mode="determinate" [value]="uploadProgress" class="progress"></mat-progress-bar> |
|
||||||
</div> |
|
||||||
|
|
||||||
<!-- <div class="progressBox" *ngIf="uploadisLoading2"> |
|
||||||
<button mat-raised-button style="margin-right: 5px;width: 84px;height: 33px;" (click)="cancel2()">取消上传</button> |
|
||||||
<span style="font-size: 12px;">文件夹上传中...(当前上传 {{uploadProgress2}} )</span> |
|
||||||
<mat-spinner determinate style="position: absolute;right: 0;right: 260px;bottom: -10px;" diameter=40></mat-spinner> |
|
||||||
</div> --> |
|
||||||
|
|
||||||
<div class="progressBox" *ngIf="downloadFile.isDownloading"> |
|
||||||
<!-- <button mat-raised-button style="margin-right: 5px;" (click)="cancelDowload()">取消下载</button> --> |
|
||||||
<span style="font-size: 12px;">下载中...</span> |
|
||||||
<mat-progress-bar mode="determinate" [value]="downloadFile.downloadProgress" class="progress" style="left: 52px;top: 13px;"></mat-progress-bar> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<!-- <div class="rightbox"> |
|
||||||
<div class="inputbox"> |
|
||||||
<input type="text" [(ngModel)]="searchData" (focus)="searchfocus($event)" (blur)="searchblur($event)"> |
|
||||||
<span class="cancel" *ngIf="isCancel" (click)="cancelbtn()"><mat-icon style="font-size: 16px;">cancel</mat-icon></span> |
|
||||||
<span class="search" (click)="search()"><mat-icon>search</mat-icon></span> |
|
||||||
</div> |
|
||||||
</div> --> |
|
||||||
</div> |
|
||||||
<div class="titlebox"> |
|
||||||
<div class="titleleft"> |
|
||||||
<span class="goBack" (click)='backToTop()' *ngIf="selectedDataBank.includes('/')">返回根目录</span> |
|
||||||
|
|
||||||
<span class="goBack" (click)='backTominTop()' *ngIf="selectedDataBank.includes('/')">返回上一级</span> |
|
||||||
<span style="margin: 0 3px;color: #c5d8f3;">|</span> |
|
||||||
<span class="allFile" *ngIf="!selectedDataBank.includes('/')">全部文件</span> |
|
||||||
<span style="margin: 0 3px;color: #c5d8f3;">→</span> |
|
||||||
<span class="allFile">{{selectedDataBank}}</span> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="titleright"> |
|
||||||
<span>已全部加载,共 {{fileNum}} 个</span> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="mainbox" style="overflow-y: auto;max-height: 80%;width: 100%;"> |
|
||||||
<table style="width: 100%;" mat-table [dataSource]="dataSource" matSort (matSortChange)="sortData($event)" class="mat-elevation-z8"> |
|
||||||
<ng-container matColumnDef="select"> |
|
||||||
<th style="width: 4%;" mat-header-cell *matHeaderCellDef> |
|
||||||
<mat-checkbox (change)="$event ? masterToggle() : null" |
|
||||||
[checked]="selection.hasValue() && isAllSelected()" |
|
||||||
color="primary" |
|
||||||
[indeterminate]="selection.hasValue() && !isAllSelected()"> |
|
||||||
</mat-checkbox> |
|
||||||
</th> |
|
||||||
<td mat-cell *matCellDef="let row"> |
|
||||||
<mat-checkbox (click)="clickCheckBox($event)" |
|
||||||
color="primary" |
|
||||||
(change)="$event ? selection.toggle(row) : null" |
|
||||||
[checked]="selection.isSelected(row)"> |
|
||||||
</mat-checkbox> |
|
||||||
</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<ng-container matColumnDef="name"> |
|
||||||
<th style="width: 63%;" mat-header-cell *matHeaderCellDef> 文件名 </th> |
|
||||||
<td mat-cell *matCellDef="let element"> |
|
||||||
<img *ngIf="element.type == 'pdf'" src="../../../assets/images/pdf.png" alt=""> |
|
||||||
<img *ngIf="element.type == 'jpeg' || element.type == 'jpg' || element.type == 'png' || element.type == 'gif' || element.type == 'svg'|| element.type == 'webp' || element.type == 'bmp'|| element.type == 'JPG'" src="../../../assets/images/img.png" alt=""> |
|
||||||
<img *ngIf="element.type == 'doc' || element.type == 'docx'" src="../../../assets/images/word.png" alt=""> |
|
||||||
<img *ngIf="element.type == 'xlsx'" src="../../../assets/images/excel.png" alt=""> |
|
||||||
<img *ngIf="element.type == 'zip'" src="../../../assets/images/zip.png" alt=""> |
|
||||||
<img *ngIf="element.type == 'MP4' || element.type == 'mp4'" src="../../../assets/images/video.png" alt=""> |
|
||||||
<img *ngIf="element.type == 'txt'" src="../../../assets/images/text.png" alt=""> |
|
||||||
<img *ngIf="element.type == 'pptx'" src="../../../assets/images/ppt.png" alt=""> |
|
||||||
<img *ngIf="element.type == 'cad' || element.type == 'CAD'" src="../../../assets/images/cad.png" alt=""> |
|
||||||
<img *ngIf="element.type == 'avi' || element.type == 'swf'|| element.type == 'mov'" src="../../../assets/images/video.png" alt=""> |
|
||||||
<img *ngIf="element.type == 'mp3' || element.type == 'aif' || element.type == 'wav' || element.type == 'flac'" src="../../../assets/images/music.png" alt=""> |
|
||||||
<img *ngIf="element.isDir" src="../../../assets/images/file.png" alt=""> |
|
||||||
<img *ngIf="element.type == 'gaopenche' || element.type == 'denggao'" src="../../../assets/images/gaopenche.gif" alt=""> |
|
||||||
<img *ngIf="element.type == 'jiqiren' || element.type == 'konghuqi'" src="../../../assets/images/shebei.jpg" alt=""> |
|
||||||
<img *ngIf="element.type == 'waifu' || element.type == 'neifu' || element.type == 'gong' || element.type == 'qiu'" src="../../../assets/images/sheshi.jpg" alt=""> |
|
||||||
|
|
||||||
<span *ngIf="element.isDir == false" class="filename" (click)="clickName($event,element)"> |
|
||||||
{{element.key | name}} |
|
||||||
</span> |
|
||||||
<span *ngIf="element.isDir == true" class="filename" (click)="clickName($event,element)"> |
|
||||||
{{element.key | name2}} |
|
||||||
</span> |
|
||||||
<span class="font3d" *ngIf="element.type == 'waifu' || element.type == 'neifu' || element.type == 'gong' || element.type == 'qiu' || element.type == 'gaopenche' || element.type == 'denggao' || element.type == 'jiqiren' || element.type == 'konghuqi'"> |
|
||||||
3D |
|
||||||
</span> |
|
||||||
</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<ng-container matColumnDef="weight"> |
|
||||||
<th mat-header-cell style="width: 15%;" *matHeaderCellDef> 大小 </th> |
|
||||||
<td mat-cell *matCellDef="let element"> {{element.size | size}} </td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<ng-container matColumnDef="time"> |
|
||||||
<th style="width: 18%;" mat-header-cell *matHeaderCellDef mat-sort-header> 修改日期 </th> |
|
||||||
<td mat-cell *matCellDef="let element"> {{element.lastModified | date:'yyyy-MM-dd HH:mm:ss'}} </td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> |
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;" |
|
||||||
(click)="clickCheckBoxLi($event,row)"> |
|
||||||
</tr> |
|
||||||
</table> |
|
||||||
|
|
||||||
<div class="nofiles" *ngIf="isNoFileTitle && selectedDataBank.includes('/')"> |
|
||||||
<span style="font-size: 14px;cursor: default;">您还没上传过文件哦~</span> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<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> |
|
||||||
</div> |
|
||||||
|
|
||||||
<ul> |
|
||||||
<li *ngFor="let item of checkedAllFiles">{{item.key}}</li> |
|
||||||
</ul> |
|
||||||
|
|
@ -1,265 +0,0 @@ |
|||||||
// @import "//at.alicdn.com/t/font_1863119_sy1f800ck9h.css"; |
|
||||||
.topbox{ |
|
||||||
height: 33px; |
|
||||||
position: relative; |
|
||||||
padding: 11px 10px; |
|
||||||
.leftbox{ |
|
||||||
float: left; |
|
||||||
display: flex; |
|
||||||
.upload{ |
|
||||||
margin-left:16px; |
|
||||||
background-color: #09AAFF; |
|
||||||
border-radius: 4px; |
|
||||||
cursor: pointer; |
|
||||||
.btn{ |
|
||||||
position: relative; |
|
||||||
color: white; |
|
||||||
font-size: 13px; |
|
||||||
mat-icon{ |
|
||||||
position: absolute; |
|
||||||
top: 5px; |
|
||||||
left: 10px; |
|
||||||
} |
|
||||||
span{ |
|
||||||
position: absolute; |
|
||||||
left: 41px; |
|
||||||
top: 9px; |
|
||||||
} |
|
||||||
input{ |
|
||||||
width: 88px; |
|
||||||
height: 33px; |
|
||||||
opacity: 0; |
|
||||||
} |
|
||||||
} |
|
||||||
.openbtn{ |
|
||||||
background-color: white; |
|
||||||
width: 86px; |
|
||||||
text-align: center; |
|
||||||
font-size: 12px; |
|
||||||
border-radius: 0px 0px 4px 4px; |
|
||||||
border: 1px solid #09AAFF; |
|
||||||
div{ |
|
||||||
position: relative; |
|
||||||
height: 30px; |
|
||||||
line-height: 30px; |
|
||||||
color: #09AAFF; |
|
||||||
input{ |
|
||||||
width: 86px; |
|
||||||
height: 30px; |
|
||||||
opacity: 0; |
|
||||||
position: absolute; |
|
||||||
left: 0; |
|
||||||
top: 0; |
|
||||||
} |
|
||||||
} |
|
||||||
div:hover{ |
|
||||||
background-color: whitesmoke; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
.newFile{ |
|
||||||
cursor: pointer; |
|
||||||
background-color: #fff; |
|
||||||
color: #09AAFF; |
|
||||||
border: 1px solid #C3EAFF; |
|
||||||
border-radius: 4px; |
|
||||||
margin-left: 12px; |
|
||||||
height: 33px; |
|
||||||
line-height: 33px; |
|
||||||
font-size: 13px; |
|
||||||
position: relative; |
|
||||||
width: 130px; |
|
||||||
height: 33px; |
|
||||||
float: left; |
|
||||||
mat-icon{ |
|
||||||
position: absolute; |
|
||||||
top: 5px; |
|
||||||
left: 10px; |
|
||||||
} |
|
||||||
span{ |
|
||||||
position: absolute; |
|
||||||
left: 41px; |
|
||||||
} |
|
||||||
} |
|
||||||
.delete{ |
|
||||||
color: rgba(245, 59, 59); |
|
||||||
border: 0.5px solid rgba(245, 59, 59); |
|
||||||
// background-color: red; |
|
||||||
// color: white; |
|
||||||
} |
|
||||||
} |
|
||||||
.rightbox{ |
|
||||||
float: right; |
|
||||||
width: 21%; |
|
||||||
.inputbox{ |
|
||||||
float: right; |
|
||||||
width: 21%; |
|
||||||
min-width: 165px; |
|
||||||
max-width: 315px; |
|
||||||
height: 30px; |
|
||||||
// margin: 12px 8px 12px 0; |
|
||||||
position: relative; |
|
||||||
right: 100px; |
|
||||||
border-radius: 33px; |
|
||||||
padding-left: 15px; |
|
||||||
padding-right: 54px; |
|
||||||
background: #f1f2f4; |
|
||||||
border-radius: 33px; |
|
||||||
input{ |
|
||||||
width: 100%; |
|
||||||
height: 30px; |
|
||||||
background: 0 0; |
|
||||||
border: 0; |
|
||||||
outline: 0; |
|
||||||
line-height: 29px!important; |
|
||||||
position: relative; |
|
||||||
font-size: 12px; |
|
||||||
} |
|
||||||
.search{ |
|
||||||
cursor: pointer; |
|
||||||
position: absolute; |
|
||||||
right: 5px; |
|
||||||
top: 3px; |
|
||||||
color: grey; |
|
||||||
} |
|
||||||
.cancel{ |
|
||||||
cursor: pointer; |
|
||||||
position: absolute; |
|
||||||
right: 22px; |
|
||||||
top: 5px; |
|
||||||
color: #808080; |
|
||||||
} |
|
||||||
.cancel:hover{ |
|
||||||
mat-icon{ |
|
||||||
color: #808090; |
|
||||||
; |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
//进度条 |
|
||||||
.progressBox{ |
|
||||||
position: absolute; |
|
||||||
display: inline-block; |
|
||||||
width: 550px; |
|
||||||
left: 480px; |
|
||||||
} |
|
||||||
.progress{ |
|
||||||
position: absolute; |
|
||||||
width: 350px; |
|
||||||
top: 18px; |
|
||||||
left: 160px; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.titlebox{ |
|
||||||
height: 30px; |
|
||||||
line-height: 30px; |
|
||||||
padding-left: 18px; |
|
||||||
padding-right: 18px; |
|
||||||
span{ |
|
||||||
font-size: 12px; |
|
||||||
} |
|
||||||
.titleleft{ |
|
||||||
float: left; |
|
||||||
.goBack{ |
|
||||||
color: #09aaff; |
|
||||||
} |
|
||||||
.goBack:hover{ |
|
||||||
cursor: pointer; |
|
||||||
text-decoration: underline; |
|
||||||
} |
|
||||||
} |
|
||||||
.titleright{ |
|
||||||
float: right; |
|
||||||
} |
|
||||||
} |
|
||||||
.mainbox{ |
|
||||||
// overflow-y: auto; |
|
||||||
table{ |
|
||||||
td{ |
|
||||||
img{ |
|
||||||
position: relative; |
|
||||||
width: 26px; |
|
||||||
height: 26px; |
|
||||||
top: 6px; |
|
||||||
margin-right: 3px; |
|
||||||
} |
|
||||||
.filename:hover{ |
|
||||||
cursor: pointer; |
|
||||||
color: #09aaff; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.btn{ |
|
||||||
width: 100%; |
|
||||||
text-align: center; |
|
||||||
button{ |
|
||||||
margin: 0 5px; |
|
||||||
} |
|
||||||
} |
|
||||||
.font3d{ |
|
||||||
font-size: 13px; |
|
||||||
background-color: #2cbe4e; |
|
||||||
display: inline-block; |
|
||||||
font-weight: 600; |
|
||||||
line-height: 20px; |
|
||||||
color: #fff; |
|
||||||
text-align: center; |
|
||||||
white-space: nowrap; |
|
||||||
border-radius: 3px; |
|
||||||
box-sizing: border-box; |
|
||||||
} |
|
||||||
|
|
||||||
//上传文件夹弹窗 |
|
||||||
.fixedBox { |
|
||||||
position: fixed; |
|
||||||
bottom: 3%; |
|
||||||
right: 3%; |
|
||||||
width: 500px; |
|
||||||
} |
|
||||||
.nofiles{ |
|
||||||
background: url("../../../assets/images/nofiles.png") no-repeat scroll center 0 transparent; |
|
||||||
padding-top: 150px; |
|
||||||
width: 488px; |
|
||||||
position: absolute; |
|
||||||
left: 50%; |
|
||||||
top: 50%; |
|
||||||
text-align: center; |
|
||||||
margin: -78px 0 0 -244px; |
|
||||||
} |
|
||||||
.openSystem{ |
|
||||||
position: relative; |
|
||||||
a{ |
|
||||||
color: rgba(0, 0, 0, 0.87); |
|
||||||
font-size: 14px; |
|
||||||
display: block; |
|
||||||
width: 100%; |
|
||||||
height: 48px; |
|
||||||
line-height: 48px; |
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.12); |
|
||||||
padding-left: 4%; |
|
||||||
background-color: white; |
|
||||||
img{ |
|
||||||
position: relative; |
|
||||||
width: 26px; |
|
||||||
height: 26px; |
|
||||||
top: 6px; |
|
||||||
margin-right: 8px; |
|
||||||
} |
|
||||||
span{ |
|
||||||
position: absolute; |
|
||||||
right: 31.3%; |
|
||||||
line-height: 48px; |
|
||||||
font-size: 14px; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
|
||||||
|
|
||||||
import { AllFileComponent } from './all-file.component'; |
|
||||||
|
|
||||||
describe('AllFileComponent', () => { |
|
||||||
let component: AllFileComponent; |
|
||||||
let fixture: ComponentFixture<AllFileComponent>; |
|
||||||
|
|
||||||
beforeEach(async(() => { |
|
||||||
TestBed.configureTestingModule({ |
|
||||||
declarations: [ AllFileComponent ] |
|
||||||
}) |
|
||||||
.compileComponents(); |
|
||||||
})); |
|
||||||
|
|
||||||
beforeEach(() => { |
|
||||||
fixture = TestBed.createComponent(AllFileComponent); |
|
||||||
component = fixture.componentInstance; |
|
||||||
fixture.detectChanges(); |
|
||||||
}); |
|
||||||
|
|
||||||
it('should create', () => { |
|
||||||
expect(component).toBeTruthy(); |
|
||||||
}); |
|
||||||
}); |
|
@ -1,14 +0,0 @@ |
|||||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
|
||||||
<mat-form-field> |
|
||||||
<input matInput id="name" name="name" type='text' |
|
||||||
required |
|
||||||
style="font-size: 12px;" |
|
||||||
onfocus="this.select()" |
|
||||||
[(ngModel)]="newFolderName" placeholder="创建文件夹"> |
|
||||||
</mat-form-field> |
|
||||||
|
|
||||||
<div class="btn"> |
|
||||||
<button type="submit" class="savebtn" mat-raised-button color="primary" [disabled]='form.invalid'>确定</button> |
|
||||||
<button type="button" mat-button (click)="onNoClick()" mat-raised-button>取消</button> |
|
||||||
</div> |
|
||||||
</form> |
|
@ -1,12 +0,0 @@ |
|||||||
<div style="position: relative;"> |
|
||||||
<div style="position: absolute;right: 0;top: 0;cursor: pointer;" (click)="closeDialog()"> |
|
||||||
<span><mat-icon>clear</mat-icon></span> |
|
||||||
</div> |
|
||||||
<div class="imgbox" style="text-align: center;"> |
|
||||||
<img *ngIf="data.type == 'img'" style="max-width: 96%;max-height: 100%;margin-top: 20px;" class="imgitemdefault" [src]="Url"> |
|
||||||
<video style="margin-top:18px;" autoplay controls *ngIf="data.type == 'video'" [src]="Url"></video> |
|
||||||
<audio autoplay controls *ngIf="data.type == 'mp3'" [src]="Url"></audio> |
|
||||||
<!-- <pre *ngIf="data.type == 'txt'">{{Url}}</pre> --> |
|
||||||
<!-- <iframe *ngIf="data.type == 'txt'" [src]="Url" frameborder="1" width="100%" height="600"></iframe> --> |
|
||||||
</div> |
|
||||||
</div> |
|
@ -1,54 +0,0 @@ |
|||||||
<div class="box"> |
|
||||||
<div class="createBtn"> |
|
||||||
<button mat-raised-button color="primary" (click)="createTest()">新增考题</button> |
|
||||||
</div> |
|
||||||
<div class="tablebox"> |
|
||||||
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8"> |
|
||||||
<ng-container matColumnDef="name"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>试卷名称</th> |
|
||||||
<td mat-cell *matCellDef="let element">{{element.name}}</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<!-- Name Column --> |
|
||||||
<ng-container matColumnDef="organization"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>考核中队</th> |
|
||||||
<td mat-cell *matCellDef="let element">{{element.organization}}</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<!-- Weight Column --> |
|
||||||
<ng-container matColumnDef="startTime"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>开考时间</th> |
|
||||||
<td mat-cell *matCellDef="let element">{{element.startTime}}</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<!-- Symbol Column --> |
|
||||||
<ng-container matColumnDef="overTime"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>结束时间</th> |
|
||||||
<td mat-cell *matCellDef="let element">{{element.overTime}}</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<!-- Symbol Column --> |
|
||||||
<ng-container matColumnDef="testState"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>考试状态</th> |
|
||||||
<td mat-cell *matCellDef="let element"> |
|
||||||
<i [ngClass]="{'green': element.testState == '2','red':element.testState == '3'}"> |
|
||||||
{{element.testState | testState}} |
|
||||||
</i> |
|
||||||
</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<!-- Symbol Column --> |
|
||||||
<ng-container matColumnDef="operation"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>操作</th> |
|
||||||
<td mat-cell *matCellDef="let element"> |
|
||||||
<span>编辑</span> |
|
||||||
<span>详情</span> |
|
||||||
<span [ngClass]="{'grey': element.testState == '2' || element.testState == '3'}">删除</span> |
|
||||||
</td> |
|
||||||
</ng-container> |
|
||||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> |
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> |
|
||||||
</table> |
|
||||||
<mat-paginator [pageSize]="10"></mat-paginator> |
|
||||||
</div> |
|
||||||
</div> |
|
@ -1,52 +0,0 @@ |
|||||||
.box{ |
|
||||||
width:100%; |
|
||||||
height: 100%; |
|
||||||
margin: 0 auto; |
|
||||||
.createBtn{ |
|
||||||
height: 60px; |
|
||||||
line-height: 60px; |
|
||||||
margin-bottom: 6px; |
|
||||||
margin-left: 20px; |
|
||||||
} |
|
||||||
.tablebox{ |
|
||||||
table{ |
|
||||||
width: 100%; |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
} |
|
||||||
.mat-header-cell{ |
|
||||||
text-align: center; |
|
||||||
} |
|
||||||
.mat-cell{ |
|
||||||
text-align: center; |
|
||||||
span{ |
|
||||||
color: #0000BF; |
|
||||||
margin: 0 3px; |
|
||||||
cursor: pointer; |
|
||||||
} |
|
||||||
span:hover{ |
|
||||||
text-decoration:underline |
|
||||||
} |
|
||||||
.grey{ |
|
||||||
color: grey; |
|
||||||
pointer-events: none; |
|
||||||
} |
|
||||||
.green{ |
|
||||||
color: #70b603; |
|
||||||
} |
|
||||||
.red{ |
|
||||||
color: #d9001b; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.dialog{ |
|
||||||
.title{ |
|
||||||
h1{ |
|
||||||
font-size: 25px; |
|
||||||
font-weight: 900; |
|
||||||
text-align: center; |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
|
||||||
|
|
||||||
import { CreateExamComponent } from './create-exam.component'; |
|
||||||
|
|
||||||
describe('CreateExamComponent', () => { |
|
||||||
let component: CreateExamComponent; |
|
||||||
let fixture: ComponentFixture<CreateExamComponent>; |
|
||||||
|
|
||||||
beforeEach(async(() => { |
|
||||||
TestBed.configureTestingModule({ |
|
||||||
declarations: [ CreateExamComponent ] |
|
||||||
}) |
|
||||||
.compileComponents(); |
|
||||||
})); |
|
||||||
|
|
||||||
beforeEach(() => { |
|
||||||
fixture = TestBed.createComponent(CreateExamComponent); |
|
||||||
component = fixture.componentInstance; |
|
||||||
fixture.detectChanges(); |
|
||||||
}); |
|
||||||
|
|
||||||
it('should create', () => { |
|
||||||
expect(component).toBeTruthy(); |
|
||||||
}); |
|
||||||
}); |
|
@ -1,76 +0,0 @@ |
|||||||
import { Component, OnInit,Inject } from '@angular/core'; |
|
||||||
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog'; |
|
||||||
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
||||||
import {FormControl} from '@angular/forms'; |
|
||||||
const ELEMENT_DATA: any[] = [ |
|
||||||
{name: "富华酒店", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'1'}, |
|
||||||
{name: "富华酒店", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'1'}, |
|
||||||
{name: "富华酒店", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'2'}, |
|
||||||
{name: "富华酒店", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'2'}, |
|
||||||
{name: "富华酒店", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'2'}, |
|
||||||
{name: "富华酒店", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'2'}, |
|
||||||
{name: "富华酒店", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'2'}, |
|
||||||
{name: "富华酒店", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'3'}, |
|
||||||
{name: "富华酒店", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'3'}, |
|
||||||
{name: "富华酒店", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'3'}, |
|
||||||
]; |
|
||||||
@Component({ |
|
||||||
selector: 'app-create-exam', |
|
||||||
templateUrl: './create-exam.component.html', |
|
||||||
styleUrls: ['./create-exam.component.scss'] |
|
||||||
}) |
|
||||||
export class CreateExamComponent implements OnInit { |
|
||||||
|
|
||||||
constructor(public dialog: MatDialog,public snackBar: MatSnackBar) { } |
|
||||||
displayedColumns: string[] = ['name', 'organization', 'startTime', 'overTime', 'testState', 'operation']; |
|
||||||
dataSource = ELEMENT_DATA; |
|
||||||
ngOnInit(): void { |
|
||||||
} |
|
||||||
//新增考题弹出框
|
|
||||||
createTest(){ |
|
||||||
const dialogRef = this.dialog.open(CreateDialog, { |
|
||||||
data: {} |
|
||||||
}); |
|
||||||
dialogRef.afterClosed().subscribe( |
|
||||||
data=>{ |
|
||||||
if(data){ |
|
||||||
|
|
||||||
}
|
|
||||||
} |
|
||||||
); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
// import getISOWeek from 'date-fns/getISOWeek';
|
|
||||||
//创建组织
|
|
||||||
@Component({ |
|
||||||
selector: 'CreateDialog', |
|
||||||
templateUrl: './createDialog.html', |
|
||||||
styleUrls: ['./create-exam.component.scss'] |
|
||||||
}) |
|
||||||
export class CreateDialog { |
|
||||||
myControl = new FormControl(); |
|
||||||
constructor( |
|
||||||
public dialogRef: MatDialogRef<CreateDialog>, |
|
||||||
@Inject(MAT_DIALOG_DATA) public data, |
|
||||||
public snackBar: MatSnackBar) {} |
|
||||||
|
|
||||||
onNoClick(): void { |
|
||||||
this.dialogRef.close(); |
|
||||||
} |
|
||||||
|
|
||||||
onSubmit(value){ |
|
||||||
} |
|
||||||
date = null; |
|
||||||
|
|
||||||
onChange(result: Date[]): void { |
|
||||||
console.log('onChange: ', result); |
|
||||||
} |
|
||||||
// getWeek(result: Date[]): void {
|
|
||||||
// console.log('week: ', result.map(getISOWeek));
|
|
||||||
// }
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,34 +0,0 @@ |
|||||||
<div class="dialog"> |
|
||||||
<div class="title"> |
|
||||||
<h1>试卷新增</h1> |
|
||||||
</div> |
|
||||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
|
||||||
|
|
||||||
<div> |
|
||||||
<span>试卷名称</span> |
|
||||||
<input id="name" name="name" type='text' |
|
||||||
required |
|
||||||
ngModel #name="ngModel"> |
|
||||||
</div> |
|
||||||
|
|
||||||
|
|
||||||
<div> |
|
||||||
<span>考核中队</span> |
|
||||||
<input id="name" name="name" type='text' |
|
||||||
required |
|
||||||
ngModel #name="ngModel"> |
|
||||||
</div> |
|
||||||
<div> |
|
||||||
<span>考试时间</span> |
|
||||||
<!-- <nz-range-picker id="date" name="date" [nzShowTime]="true" [(ngModel)]="date" (ngModelChange)="onChange($event)"></nz-range-picker> --> |
|
||||||
</div> |
|
||||||
|
|
||||||
|
|
||||||
<div class="btn"> |
|
||||||
<button type="submit" class="savebtn" mat-raised-button color="primary" [disabled]='form.invalid'>确定</button> |
|
||||||
<button type="button" mat-button (click)="onNoClick()" mat-raised-button>取消</button> |
|
||||||
</div> |
|
||||||
|
|
||||||
</form> |
|
||||||
</div> |
|
||||||
|
|
@ -1,40 +0,0 @@ |
|||||||
<div class="content"> |
|
||||||
|
|
||||||
<div class="header"> |
|
||||||
<form #form="ngForm"> |
|
||||||
<div class="queryBox"> |
|
||||||
|
|
||||||
<div class="queryField" style="margin-right: 90px;"> |
|
||||||
<!-- <button type="button" mat-raised-button color="primary" style="margin-right: 10px;" (click)='goBack()'><mat-icon style="vertical-align: middle; font-size: 20px;">reply</mat-icon>返回</button> --> |
|
||||||
<button type="button" mat-raised-button color="primary" (click)='queryAll()'>查看全部详情</button> |
|
||||||
</div> |
|
||||||
|
|
||||||
<!-- <div class="queryField"> |
|
||||||
<label style="margin-right: 10px;">开始时间:</label> |
|
||||||
<input matInput [matDatepicker]="start" placeholder="请选择开始时间" readonly (dateChange)="startEvent($event)" [formControl]='startTime'> |
|
||||||
<mat-datepicker-toggle matSuffix [for]="start"></mat-datepicker-toggle> |
|
||||||
<mat-datepicker #start></mat-datepicker> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="queryField"> |
|
||||||
<label style="margin-right: 10px;">结束时间:</label> |
|
||||||
<input matInput [matDatepicker]="end" placeholder="请选择结束时间" readonly (dateChange)="endEvent($event)" [formControl]='endTime'> |
|
||||||
<mat-datepicker-toggle matSuffix [for]="end"></mat-datepicker-toggle> |
|
||||||
<mat-datepicker #end></mat-datepicker> |
|
||||||
</div> --> |
|
||||||
|
|
||||||
|
|
||||||
<div class="btnbox" style="margin-left: 90px;"> |
|
||||||
<button mat-raised-button color="primary" (click)='query()'>查询</button> |
|
||||||
<button mat-raised-button style="margin-left: 10px;" type="button" (click)='getList()'>重置</button> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
</form> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="center" id="center"></div> |
|
||||||
<div class="nofiles" *ngIf="!echartsData.length"> |
|
||||||
<span style="font-size: 14px;cursor: default;">暂无学习记录~</span> |
|
||||||
</div> |
|
||||||
</div> |
|
@ -1,50 +0,0 @@ |
|||||||
.content{ |
|
||||||
width: 100%; |
|
||||||
height: 93%; |
|
||||||
display: flex; |
|
||||||
flex-direction: column; |
|
||||||
} |
|
||||||
|
|
||||||
.header { |
|
||||||
padding: 10px; |
|
||||||
box-sizing: border-box; |
|
||||||
border-bottom: 1px solid #999; |
|
||||||
.queryBox { |
|
||||||
box-sizing: border-box; |
|
||||||
padding: 5px 15px; |
|
||||||
display: flex; |
|
||||||
flex-direction: row; |
|
||||||
flex-wrap: wrap; |
|
||||||
align-items:center; |
|
||||||
justify-content:center; |
|
||||||
.queryField { |
|
||||||
margin: 0 15px; |
|
||||||
font-size: 14px; |
|
||||||
input { |
|
||||||
width: 180px; |
|
||||||
height: 22px; |
|
||||||
line-height: 22px; |
|
||||||
} |
|
||||||
} |
|
||||||
.btnbox{ |
|
||||||
float: right; |
|
||||||
} |
|
||||||
|
|
||||||
} //queryBox |
|
||||||
} |
|
||||||
|
|
||||||
.center { |
|
||||||
flex: 1; |
|
||||||
box-sizing: border-box; |
|
||||||
padding: 10px; |
|
||||||
} |
|
||||||
.nofiles{ |
|
||||||
background: url("../../../assets/images/nofiles.png") no-repeat scroll center 0 transparent; |
|
||||||
padding-top: 150px; |
|
||||||
width: 488px; |
|
||||||
position: absolute; |
|
||||||
left: 50%; |
|
||||||
top: 50%; |
|
||||||
text-align: center; |
|
||||||
margin: -96px 0 0 -244px; |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
|
||||||
|
|
||||||
import { EhartsStatisticsComponent } from './eharts-statistics.component'; |
|
||||||
|
|
||||||
describe('EhartsStatisticsComponent', () => { |
|
||||||
let component: EhartsStatisticsComponent; |
|
||||||
let fixture: ComponentFixture<EhartsStatisticsComponent>; |
|
||||||
|
|
||||||
beforeEach(async(() => { |
|
||||||
TestBed.configureTestingModule({ |
|
||||||
declarations: [ EhartsStatisticsComponent ] |
|
||||||
}) |
|
||||||
.compileComponents(); |
|
||||||
})); |
|
||||||
|
|
||||||
beforeEach(() => { |
|
||||||
fixture = TestBed.createComponent(EhartsStatisticsComponent); |
|
||||||
component = fixture.componentInstance; |
|
||||||
fixture.detectChanges(); |
|
||||||
}); |
|
||||||
|
|
||||||
it('should create', () => { |
|
||||||
expect(component).toBeTruthy(); |
|
||||||
}); |
|
||||||
}); |
|
@ -1,228 +0,0 @@ |
|||||||
import { Component, OnInit } from '@angular/core'; |
|
||||||
import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from '@angular/material/core'; |
|
||||||
import {MatDatepickerInputEvent} from '@angular/material/datepicker'; |
|
||||||
import { HttpClient } from '@angular/common/http'; |
|
||||||
import { FormControl } from '@angular/forms'; |
|
||||||
import { MatSnackBarConfig, MatSnackBar } from '@angular/material/snack-bar'; |
|
||||||
import { ActivatedRoute, Router } from '@angular/router'; |
|
||||||
declare var echarts : any; |
|
||||||
|
|
||||||
@Component({ |
|
||||||
selector: 'app-eharts-statistics', |
|
||||||
templateUrl: './eharts-statistics.component.html', |
|
||||||
styleUrls: ['./eharts-statistics.component.scss'], |
|
||||||
}) |
|
||||||
export class EhartsStatisticsComponent implements OnInit { |
|
||||||
|
|
||||||
constructor(private adapter: DateAdapter<any>,private http:HttpClient,public snackBar: MatSnackBar,private route:ActivatedRoute,private router:Router) { } |
|
||||||
|
|
||||||
ngOnInit(): void { |
|
||||||
this.idCard = this.route.snapshot.queryParams.id || '' |
|
||||||
this.idName = this.route.snapshot.queryParams.name || '' |
|
||||||
this.adapter.setLocale('CH') |
|
||||||
this.getList() |
|
||||||
} |
|
||||||
|
|
||||||
ngAfterViewInit(): void { |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
startTime:any; //查询开始时间
|
|
||||||
endTime:any; //查询结束时间
|
|
||||||
oneMonthDate:number = 30*24*60*60*1000; //一个月的时间戳
|
|
||||||
|
|
||||||
echartsData:any = []; //图表数据
|
|
||||||
|
|
||||||
idCard:string; //用户身份证
|
|
||||||
idName:string; //用户姓名
|
|
||||||
|
|
||||||
//初始化 + 重置
|
|
||||||
getList () { |
|
||||||
this.startTime = new FormControl( new Date((new Date(new Date().getTime()-this.oneMonthDate)).toLocaleDateString()) ) |
|
||||||
this.endTime = new FormControl( new Date() ) |
|
||||||
let msg = { |
|
||||||
Name: this.idCard, |
|
||||||
// StartTime: new Date(new Date().getTime()-this.oneMonthDate).toLocaleDateString(),
|
|
||||||
// EndTime: new Date().toLocaleDateString(),
|
|
||||||
} |
|
||||||
this.http.get('/api/StudyRecords/Statistics',{params:msg}).subscribe((data:any)=>{ |
|
||||||
this.echartsData = data |
|
||||||
if (data.length) { |
|
||||||
this.handleData(data) |
|
||||||
} else { //数据为空时销毁图表
|
|
||||||
let chartHynyxf = echarts.init(document.getElementById('center'), 'skinUpp'); |
|
||||||
chartHynyxf.dispose(); |
|
||||||
} |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//查询
|
|
||||||
query () { |
|
||||||
let msg = { |
|
||||||
Name: this.idCard, |
|
||||||
StartTime: this.getTime(this.startTime.value), //开始时间
|
|
||||||
EndTime: this.getTime(this.endTime.value), //结束时间
|
|
||||||
} |
|
||||||
this.http.get('/api/StudyRecords/Statistics',{params:msg}).subscribe((data:any)=>{ |
|
||||||
this.echartsData = data |
|
||||||
if (data.length) { |
|
||||||
this.handleData(data) |
|
||||||
} else { //数据为空时销毁图表
|
|
||||||
let chartHynyxf = echarts.init(document.getElementById('center'), 'skinUpp'); |
|
||||||
chartHynyxf.dispose(); |
|
||||||
} |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//查询全部详情
|
|
||||||
queryAll () { |
|
||||||
this.router.navigate(['/home/learningrecorddetails'],{queryParams:{'Catalog': '','id':this.idCard}}); |
|
||||||
} |
|
||||||
|
|
||||||
//返回上一页
|
|
||||||
goBack () { |
|
||||||
history.go(-1) |
|
||||||
} |
|
||||||
|
|
||||||
//处理时间 传入 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; |
|
||||||
} |
|
||||||
|
|
||||||
//选择开始时间
|
|
||||||
startEvent (e: MatDatepickerInputEvent<Date>) { |
|
||||||
let nowTime = new Date() |
|
||||||
if (nowTime < e.value) { |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open('选择时间不能大于现在时间段','确定',config); |
|
||||||
this.startTime = new FormControl( new Date(new Date().toLocaleDateString()) ) |
|
||||||
} else { |
|
||||||
this.startTime = new FormControl(e.value) |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
//选择结束时间
|
|
||||||
endEvent (e: MatDatepickerInputEvent<Date>) { |
|
||||||
let oneDay:number = 86399000; //一天的毫秒数
|
|
||||||
let selectDay = (e.value).toLocaleDateString() //选择的年月日
|
|
||||||
let newDay = (new Date()).toLocaleDateString() //现在的年月日
|
|
||||||
let nowTime = new Date() //现在的时间
|
|
||||||
|
|
||||||
if (nowTime < e.value && selectDay!=newDay) { //选择时间段大于现在时间段时
|
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open('选择时间不能大于现在时间段','确定',config); |
|
||||||
this.endTime = new FormControl( new Date() ) |
|
||||||
} else if (nowTime > e.value && selectDay!=newDay) { //正常情况下 时间+1天
|
|
||||||
this.endTime = new FormControl( new Date(e.value.getTime()+oneDay) ) |
|
||||||
} else if ( selectDay == newDay ) { //选择时间段是今天时
|
|
||||||
this.endTime = new FormControl( new Date() ) |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
//处理图表数据
|
|
||||||
handleData (data) { |
|
||||||
let postNames = [] //y轴坐标
|
|
||||||
let catalogs = [] //学习目标
|
|
||||||
let counts = [] //统计次数
|
|
||||||
let newData = data.sort( function (a,b) { |
|
||||||
return b.count - a.count |
|
||||||
} ) |
|
||||||
newData.forEach(element => { |
|
||||||
postNames.push(element.postName ? element.postName : '暂无数据') |
|
||||||
catalogs.push(element.catalog ? element.catalog : '暂无数据') |
|
||||||
counts.push(element.count ? element.count : 0) |
|
||||||
}); |
|
||||||
this.echartsInit(postNames,catalogs,counts) |
|
||||||
} |
|
||||||
|
|
||||||
//图表初始化
|
|
||||||
echartsInit (postNames,catalogs,counts) { |
|
||||||
let that = this |
|
||||||
let chartHynyxf = echarts.init(document.getElementById('center'), 'skinUpp'); |
|
||||||
let option = { |
|
||||||
title: {
|
|
||||||
text: that.idName, |
|
||||||
left:45, |
|
||||||
top:20 |
|
||||||
}, |
|
||||||
tooltip: { |
|
||||||
trigger: 'axis', |
|
||||||
axisPointer: {type: 'shadow'} |
|
||||||
}, |
|
||||||
grid: { |
|
||||||
left: '3%', |
|
||||||
right: '4%', |
|
||||||
bottom: '3%', |
|
||||||
containLabel: true |
|
||||||
}, |
|
||||||
xAxis: { |
|
||||||
show: false, |
|
||||||
type: 'value', |
|
||||||
boundaryGap: [0, 0.01] |
|
||||||
}, |
|
||||||
yAxis: { |
|
||||||
inverse: true, |
|
||||||
"axisLine":{ //y轴
|
|
||||||
"show":false |
|
||||||
}, |
|
||||||
"axisTick":{ //y轴刻度线
|
|
||||||
"show":false, |
|
||||||
}, |
|
||||||
"splitLine": { //网格线
|
|
||||||
"show": false |
|
||||||
}, |
|
||||||
type: 'category', |
|
||||||
data: postNames, |
|
||||||
max: 15 |
|
||||||
}, |
|
||||||
series: [ |
|
||||||
{ |
|
||||||
type: 'bar', |
|
||||||
data: counts, |
|
||||||
barMinWidth: 10, // 最小宽度
|
|
||||||
barMaxWidth: 30, // 最大宽度
|
|
||||||
barCategoryGap: 5, |
|
||||||
itemStyle:{ |
|
||||||
normal:{ |
|
||||||
color:'#40B4E8', |
|
||||||
barBorderRadius:[10, 10, 10, 10], |
|
||||||
label: { |
|
||||||
formatter: function (e) { |
|
||||||
return `${catalogs[e.dataIndex]}`+` (统计次数: ${e.value})` |
|
||||||
}, |
|
||||||
show: true, |
|
||||||
position: 'insideLeft', |
|
||||||
textStyle: { color: '#555'}, |
|
||||||
fontSize: 14, |
|
||||||
fontWeight: 550 |
|
||||||
}, |
|
||||||
}, |
|
||||||
} //itemStyle
|
|
||||||
}, |
|
||||||
|
|
||||||
] //series
|
|
||||||
|
|
||||||
}; |
|
||||||
|
|
||||||
chartHynyxf.setOption(option); |
|
||||||
|
|
||||||
//柱状图点击事件
|
|
||||||
chartHynyxf.on('click', function(e) { |
|
||||||
that.router.navigate(['/home/learningrecorddetails'],{queryParams:{'Catalog':catalogs[e.dataIndex],'id':that.idCard,'PostName':e.name}}); |
|
||||||
}); |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,49 +0,0 @@ |
|||||||
<h2 mat-dialog-title>创建用户</h2> |
|
||||||
|
|
||||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
|
||||||
|
|
||||||
<div> |
|
||||||
<mat-form-field> |
|
||||||
<input matInput id="idNumber" name="idNumber" |
|
||||||
required ngModel placeholder="请输入身份证号" autocomplete="off" pattern="^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$"> |
|
||||||
<mat-error> |
|
||||||
<strong>请输入正确身份证号</strong> |
|
||||||
</mat-error> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div> |
|
||||||
<mat-form-field> |
|
||||||
<input matInput id="realName" name="realName" |
|
||||||
maxlength="100" |
|
||||||
required ngModel placeholder="请输入真实姓名" autocomplete="off"> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div> |
|
||||||
<mat-form-field> |
|
||||||
<mat-select placeholder="请选择职务" [formControl]="toppings" multiple required> |
|
||||||
<div style="float: left;"> |
|
||||||
<mat-option *ngFor="let item of detachmentPosts" [value]="item.id">{{item.name}}</mat-option> |
|
||||||
</div> |
|
||||||
<div style="float: left;"> |
|
||||||
<mat-option *ngFor="let item of brigadePosts" [value]="item.id">{{item.name}}</mat-option> |
|
||||||
</div> |
|
||||||
<div style="float: left;"> |
|
||||||
<mat-option *ngFor="let item of RescueStationPosts" [value]="item.id">{{item.name}}</mat-option> |
|
||||||
</div> |
|
||||||
</mat-select> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
|
|
||||||
<div mat-dialog-content *ngIf="errmsg"> |
|
||||||
<p style="font-size: 14px; color: red;">{{errmsg}}</p> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div mat-dialog-actions> |
|
||||||
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid || toppings.value == null">确定</button> |
|
||||||
<button mat-raised-button mat-dialog-close>取消</button> |
|
||||||
</div> |
|
||||||
|
|
||||||
</form> |
|
@ -1,67 +0,0 @@ |
|||||||
import { Component, OnInit, Inject } from '@angular/core'; |
|
||||||
import { HttpClient } from '@angular/common/http'; |
|
||||||
import {MatDialogRef} from '@angular/material/dialog'; |
|
||||||
import {FormControl} from '@angular/forms'; |
|
||||||
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
||||||
|
|
||||||
@Component({ |
|
||||||
selector: 'addenterpriseuser', |
|
||||||
templateUrl: './addenterpriseuser.component.html', |
|
||||||
styleUrls: ['./enterpriseuser.component.scss'] |
|
||||||
}) |
|
||||||
export class AddEnterpriserUser { |
|
||||||
|
|
||||||
toppings = new FormControl(); |
|
||||||
constructor(private http: HttpClient,public dialogRef: MatDialogRef<AddEnterpriserUser>,public snackBar: MatSnackBar) {} |
|
||||||
errmsg:any; //捕获错误信息
|
|
||||||
detachmentPosts: any = []//支队职务列表
|
|
||||||
brigadePosts: any = []//大队职务列表
|
|
||||||
RescueStationPosts: any = []//救援站职务列表
|
|
||||||
ngOnInit(): void { |
|
||||||
this.getAllPosts() |
|
||||||
} |
|
||||||
|
|
||||||
//获得所有职务
|
|
||||||
getAllPosts(){ |
|
||||||
this.http.get("/api/Posts").subscribe( (data:any) =>{ |
|
||||||
data.forEach(item => { |
|
||||||
if(item.name.indexOf("支队级") != -1){ |
|
||||||
this.detachmentPosts.push(item) |
|
||||||
}else if(item.name.indexOf("大队级") != -1){ |
|
||||||
this.brigadePosts.push(item) |
|
||||||
}else{ |
|
||||||
this.RescueStationPosts.push(item) |
|
||||||
} |
|
||||||
}); |
|
||||||
})
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
//提交创建表单
|
|
||||||
onSubmit (e) { |
|
||||||
let date = new Date() |
|
||||||
let postsArr = this.toppings.value |
|
||||||
let postsObj = [] |
|
||||||
postsArr.forEach((item) => { |
|
||||||
postsObj.push({id:item, name:""}) |
|
||||||
}) |
|
||||||
let body = { |
|
||||||
name : e.idNumber, |
|
||||||
realName : e.realName, |
|
||||||
roleType : 2, |
|
||||||
enabled : true, |
|
||||||
creationTime : date, |
|
||||||
posts : postsObj |
|
||||||
} |
|
||||||
this.http.post("/api/Users",body).subscribe( data => { |
|
||||||
this.dialogRef.close(data); |
|
||||||
},err => { |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open(err,'确定',config); |
|
||||||
}) |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -1,46 +0,0 @@ |
|||||||
<h2 mat-dialog-title>编辑用户</h2> |
|
||||||
|
|
||||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
|
||||||
|
|
||||||
<div> |
|
||||||
<mat-form-field> |
|
||||||
<input matInput id="idNumber" name="idNumber" |
|
||||||
required [(ngModel)]="IdNumber" placeholder="请输入身份证号" autocomplete="off" disabled pattern="^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$"> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div> |
|
||||||
<mat-form-field> |
|
||||||
<input matInput id="realName" name="realName" |
|
||||||
maxlength="100" |
|
||||||
required [(ngModel)]="realName" placeholder="请输入真实姓名" autocomplete="off"> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div> |
|
||||||
<mat-form-field> |
|
||||||
<mat-select placeholder="请选择职务" [formControl]="toppings" multiple required> |
|
||||||
<div style="float: left;"> |
|
||||||
<mat-option *ngFor="let item of detachmentPosts" [value]="item.id">{{item.name}}</mat-option> |
|
||||||
</div> |
|
||||||
<div style="float: left;"> |
|
||||||
<mat-option *ngFor="let item of brigadePosts" [value]="item.id">{{item.name}}</mat-option> |
|
||||||
</div> |
|
||||||
<div style="float: left;"> |
|
||||||
<mat-option *ngFor="let item of RescueStationPosts" [value]="item.id">{{item.name}}</mat-option> |
|
||||||
</div> |
|
||||||
</mat-select> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
|
|
||||||
<div mat-dialog-content *ngIf="errmsg"> |
|
||||||
<p style="font-size: 14px; color: red;">{{errmsg}}</p> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div mat-dialog-actions> |
|
||||||
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid || toppings.value == null">确定</button> |
|
||||||
<button mat-raised-button mat-dialog-close>取消</button> |
|
||||||
</div> |
|
||||||
|
|
||||||
</form> |
|
@ -1,77 +0,0 @@ |
|||||||
<div class="content"> |
|
||||||
<div class="header"> |
|
||||||
<form #form="ngForm"> |
|
||||||
<div class="queryBox"> |
|
||||||
|
|
||||||
<div class="queryField"> |
|
||||||
<label style="margin-right: 10px;">用户姓名:</label> |
|
||||||
<input type="text" [(ngModel)]="name" name="name" autocomplete="off" placeholder="请输入用户姓名"> |
|
||||||
</div> |
|
||||||
<div class="queryField"> |
|
||||||
<label style="margin-right: 10px;">身份证号:</label> |
|
||||||
<input type="text" [(ngModel)]="identityCard" name="identityCard" autocomplete="off" placeholder="请输入身份证号"> |
|
||||||
</div> |
|
||||||
<div class="queryField"> |
|
||||||
<label style="margin-right: 10px;">消防救援站:</label> |
|
||||||
<input type="text" [(ngModel)]="fireTeam" name="fireTeam" autocomplete="off" placeholder="请选择消防救援站"> |
|
||||||
</div> |
|
||||||
<div class="queryField"> |
|
||||||
<button mat-raised-button (click)='initData()' style="background-color: #07CDCF;">查询</button> |
|
||||||
<button mat-raised-button (click)='empty()' style="margin-left: 10px; background-color: #FF8678;">重置</button> |
|
||||||
</div> |
|
||||||
<div class="queryField"> |
|
||||||
<button mat-raised-button (click)='open()' style="background-color: #07CDCF;">新增用户</button> |
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
</form> |
|
||||||
</div> |
|
||||||
|
|
||||||
<table mat-table [dataSource]="dataSource"> |
|
||||||
|
|
||||||
<ng-container matColumnDef="name"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>用户姓名</th> |
|
||||||
<td mat-cell *matCellDef="let element">{{element.realName}}</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<ng-container matColumnDef="identitycard"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>身份证号</th> |
|
||||||
<td mat-cell *matCellDef="let element">{{element.name}}</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<ng-container matColumnDef="post"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>消防救援站</th> |
|
||||||
<td mat-cell *matCellDef="let element">{{element.organizationName}}</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<ng-container matColumnDef="tel"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>手机号</th> |
|
||||||
<td mat-cell *matCellDef="let element">{{element.phone}}</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<ng-container matColumnDef="time"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>创建时间</th> |
|
||||||
<td mat-cell *matCellDef="let element">{{element.creationTime | date:'yyyy-MM-dd'}}</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<ng-container matColumnDef="operation"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>操作</th> |
|
||||||
<td mat-cell *matCellDef="let element"> |
|
||||||
<span class="operationSpan"><span class="spanbtn green" (click)="reset(element)">重置密码</span></span> |
|
||||||
<span class="operationSpan"><span class="spanbtn green" (click)="edit(element)">编辑</span></span> |
|
||||||
<span *ngIf="element.enabled" class="operationSpan"><span class="spanbtn red" (click)="noEnabled(element)">禁用</span></span> |
|
||||||
<span *ngIf="!element.enabled" class="operationSpan"><span class="spanbtn gray" (click)="enabled(element)">禁用</span></span> |
|
||||||
<span class="operationSpan"><span class="spanbtn red" (click)="delete(element)">删除</span></span> |
|
||||||
</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> |
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> |
|
||||||
</table> |
|
||||||
<mat-paginator [length]="length" |
|
||||||
[pageSize]="pageSize" |
|
||||||
[pageSizeOptions]="pageSizeOptions" |
|
||||||
(page)="chagePage($event)"> |
|
||||||
</mat-paginator> |
|
||||||
|
|
||||||
</div> |
|
@ -1,54 +0,0 @@ |
|||||||
table { |
|
||||||
width: 100%; |
|
||||||
text-align: center; |
|
||||||
.cdk-header-cell { |
|
||||||
text-align: center; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.content { |
|
||||||
width: 100%; |
|
||||||
height: 100%; |
|
||||||
overflow: hidden; |
|
||||||
background: #F2F5F6; |
|
||||||
} |
|
||||||
.header { |
|
||||||
width: 100%; |
|
||||||
padding: 10px; |
|
||||||
margin-bottom: 10px; |
|
||||||
box-sizing: border-box; |
|
||||||
.queryBox { |
|
||||||
box-sizing: border-box; |
|
||||||
padding: 5px 15px; |
|
||||||
display: flex; |
|
||||||
flex-direction: row; |
|
||||||
flex-wrap: wrap; |
|
||||||
align-items:center; |
|
||||||
justify-content:center; |
|
||||||
.queryField { |
|
||||||
margin: 0 25px; |
|
||||||
font-size: 14px; |
|
||||||
input { |
|
||||||
width: 160px; |
|
||||||
height: 34px; |
|
||||||
line-height: 34px; |
|
||||||
border-radius: 5px; |
|
||||||
padding-left: 5px; |
|
||||||
outline: none; |
|
||||||
border: 1px solid rgb(226, 211, 211); |
|
||||||
} |
|
||||||
button { color: #fff; } |
|
||||||
} |
|
||||||
} //queryBox |
|
||||||
} |
|
||||||
|
|
||||||
.operationSpan{ |
|
||||||
margin: 0 10px; |
|
||||||
.spanbtn { |
|
||||||
font-weight: 550; |
|
||||||
cursor: pointer; |
|
||||||
} |
|
||||||
.green{ color: #04ced1; } |
|
||||||
.red{ color: #FF8678 } |
|
||||||
.gray{ color: gray; } |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
|
||||||
|
|
||||||
import { EnterpriseuserComponent } from './enterpriseuser.component'; |
|
||||||
|
|
||||||
describe('EnterpriseuserComponent', () => { |
|
||||||
let component: EnterpriseuserComponent; |
|
||||||
let fixture: ComponentFixture<EnterpriseuserComponent>; |
|
||||||
|
|
||||||
beforeEach(async(() => { |
|
||||||
TestBed.configureTestingModule({ |
|
||||||
declarations: [ EnterpriseuserComponent ] |
|
||||||
}) |
|
||||||
.compileComponents(); |
|
||||||
})); |
|
||||||
|
|
||||||
beforeEach(() => { |
|
||||||
fixture = TestBed.createComponent(EnterpriseuserComponent); |
|
||||||
component = fixture.componentInstance; |
|
||||||
fixture.detectChanges(); |
|
||||||
}); |
|
||||||
|
|
||||||
it('should create', () => { |
|
||||||
expect(component).toBeTruthy(); |
|
||||||
}); |
|
||||||
}); |
|
@ -1,273 +0,0 @@ |
|||||||
import { Component, OnInit, ViewChild, Inject } from '@angular/core'; |
|
||||||
import {HttpClient} from '@angular/common/http' |
|
||||||
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
||||||
import { MatPaginator } from '@angular/material/paginator'; |
|
||||||
import { MatTableDataSource } from '@angular/material/table'; |
|
||||||
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', |
|
||||||
styleUrls: ['./enterpriseuser.component.scss'] |
|
||||||
}) |
|
||||||
export class EnterpriseuserComponent implements OnInit { |
|
||||||
|
|
||||||
constructor(public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private router:Router,private route:ActivatedRoute) { } |
|
||||||
|
|
||||||
ngOnInit() { |
|
||||||
this.initData() |
|
||||||
} |
|
||||||
|
|
||||||
displayedColumns: string[] = [ 'name','identitycard', 'post', 'tel', 'time', 'operation',]; |
|
||||||
dataSource:any; //所有企业用户
|
|
||||||
|
|
||||||
name:any //姓名
|
|
||||||
identityCard:any //身份证
|
|
||||||
fireTeam:any; //消防救援站
|
|
||||||
|
|
||||||
//分页
|
|
||||||
@ViewChild(MatPaginator, {static: true})
|
|
||||||
pageEvent: PageEvent; |
|
||||||
paginator: MatPaginator; |
|
||||||
length:any; //共多少条数据
|
|
||||||
pageSize:any; //每页条数
|
|
||||||
pageSizeOptions: number[] = [10] //设置每页条数
|
|
||||||
pageNumber:number = 1; //第几页
|
|
||||||
|
|
||||||
//分页切换
|
|
||||||
chagePage (e) { |
|
||||||
this.pageNumber = e.pageIndex+1 |
|
||||||
let data= { |
|
||||||
Name: this.identityCard || '', |
|
||||||
RealName: this.name || '', |
|
||||||
RoleType: '2', |
|
||||||
PageNumber: String(this.pageNumber), |
|
||||||
} |
|
||||||
this.http.get('/api/ExamUsers',{params:data}).subscribe((data:any)=>{ |
|
||||||
this.length = data.totalCount |
|
||||||
this.pageSize = data.pageSize |
|
||||||
this.dataSource = new MatTableDataSource<any>(data.items) |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//页面初始化 + 查询 + 重置
|
|
||||||
initData () { |
|
||||||
let data= { |
|
||||||
Name: this.identityCard || '', |
|
||||||
RealName: this.name || '', |
|
||||||
RoleType: '2', |
|
||||||
} |
|
||||||
this.http.get('/api/ExamUsers',{params:data}).subscribe((data:any)=>{ |
|
||||||
this.length = data.totalCount |
|
||||||
this.pageSize = data.pageSize |
|
||||||
this.pageEvent.pageIndex = 0 |
|
||||||
this.dataSource = new MatTableDataSource<any>(data.items) |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//更新当前页数据
|
|
||||||
getAllUsers () { |
|
||||||
let data= { |
|
||||||
Name: this.identityCard || '', |
|
||||||
RealName: this.name || '', |
|
||||||
RoleType: '2', |
|
||||||
PageNumber: String(this.pageNumber), |
|
||||||
} |
|
||||||
this.http.get('/api/ExamUsers',{params:data}).subscribe((data:any)=>{ |
|
||||||
this.length = data.totalCount |
|
||||||
this.pageSize = data.pageSize |
|
||||||
this.dataSource = new MatTableDataSource<any>(data.items) |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//清空搜索
|
|
||||||
empty () { |
|
||||||
this.identityCard = '' |
|
||||||
this.name = '' |
|
||||||
this.initData() |
|
||||||
} |
|
||||||
|
|
||||||
//创建用户
|
|
||||||
open(){ |
|
||||||
let dialogRef = this.dialog.open(AddEnterpriserUser, {//调用open方法打开对话框并且携带参数过去
|
|
||||||
width: '250px', |
|
||||||
}); |
|
||||||
dialogRef.afterClosed().subscribe(data=>{ |
|
||||||
if (data) { |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open('创建成功!','确定',config); |
|
||||||
this.getAllUsers() |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
//编辑企业用户
|
|
||||||
edit (e) { |
|
||||||
let dialogRef = this.dialog.open(editenterpriseuser,{ |
|
||||||
width: '250px', |
|
||||||
data:e |
|
||||||
}); |
|
||||||
dialogRef.afterClosed().subscribe(data=>{ |
|
||||||
if (data) { |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open('修改成功!','确定',config);
|
|
||||||
this.getAllUsers() |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
//重置密码
|
|
||||||
reset (e) { |
|
||||||
this.http.put(`/api/ExamUsers/${e.name}/ResetPassword`,{}).subscribe( |
|
||||||
data=>{ |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open('重置密码成功!','确定',config); |
|
||||||
},err=>{ |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open('重置密码失败!','确定',config); |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//启用
|
|
||||||
enabled (e) { |
|
||||||
let date = new Date() |
|
||||||
let body = { |
|
||||||
name : e.name, |
|
||||||
realName : e.realName, |
|
||||||
roleType : e.roleType, |
|
||||||
enabled : true, |
|
||||||
creationTime : date, |
|
||||||
posts : e.posts |
|
||||||
} |
|
||||||
this.http.put(`/api/ExamUsers/${e.name}`,body).subscribe(data => { |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000; |
|
||||||
this.snackBar.open('启用成功!','确定',config); |
|
||||||
this.getAllUsers(); |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//禁用
|
|
||||||
noEnabled (e) { |
|
||||||
let date = new Date() |
|
||||||
let body = { |
|
||||||
name : e.name, |
|
||||||
realName : e.realName, |
|
||||||
roleType : e.roleType, |
|
||||||
enabled : false, |
|
||||||
creationTime : date, |
|
||||||
posts : e.posts |
|
||||||
} |
|
||||||
this.http.put(`/api/ExamUsers/${e.name}`,body).subscribe(data => { |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000; |
|
||||||
this.snackBar.open('禁用成功!','确定',config); |
|
||||||
this.getAllUsers(); |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//删除
|
|
||||||
delete (e) { |
|
||||||
let isTrue = confirm('您确定要删除吗') |
|
||||||
if (isTrue) { |
|
||||||
this.http.delete(`/api/ExamUsers/${e.name}`).subscribe(data=>{ |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open('删除成功!','确定',config); |
|
||||||
this.getAllUsers() |
|
||||||
}) |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//编辑企业用户
|
|
||||||
@Component({ |
|
||||||
selector: 'app-editenterpriseuser', |
|
||||||
templateUrl: './editenterpriseuser.html', |
|
||||||
styleUrls: ['./enterpriseuser.component.scss'] |
|
||||||
}) |
|
||||||
export class editenterpriseuser { |
|
||||||
|
|
||||||
toppings:any = new FormControl(); |
|
||||||
constructor(private http: HttpClient,public dialogRef: MatDialogRef<editenterpriseuser>,@Inject(MAT_DIALOG_DATA) public data) {} |
|
||||||
errmsg:any; //捕获错误信息
|
|
||||||
detachmentPosts: any = []//支队职务列表
|
|
||||||
brigadePosts: any = []//大队职务列表
|
|
||||||
RescueStationPosts: any = []//救援站职务列表
|
|
||||||
|
|
||||||
IdNumber:any //身份证号
|
|
||||||
realName:any //真实姓名
|
|
||||||
ngOnInit(): void { |
|
||||||
this.toppings.value = [] |
|
||||||
this.IdNumber = this.data.name |
|
||||||
this.realName = this.data.realName |
|
||||||
this.data.posts.forEach((item) => { |
|
||||||
this.toppings.value.push(item.id) |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//获得所有职务
|
|
||||||
getAllPosts(){ |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
//提交创建表单
|
|
||||||
onSubmit (e) { |
|
||||||
let date = new Date() |
|
||||||
let postsArr = this.toppings.value |
|
||||||
let postsObj = [] |
|
||||||
postsArr.forEach((item) => { |
|
||||||
postsObj.push({id:item, name:""}) |
|
||||||
}) |
|
||||||
let body = { |
|
||||||
name : this.data.name, |
|
||||||
realName : e.realName, |
|
||||||
roleType : 2, |
|
||||||
enabled : this.data.enabled, |
|
||||||
creationTime : date, |
|
||||||
posts : postsObj |
|
||||||
} |
|
||||||
this.http.put(`/api/ExamUsers/${this.data.name}`,body).subscribe(data => { |
|
||||||
this.dialogRef.close("修改成功"); |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//查看企业用户
|
|
||||||
@Component({ |
|
||||||
selector: 'app-seeenterpriseuser', |
|
||||||
templateUrl: './seeenterpriseuser.html', |
|
||||||
styleUrls: ['./enterpriseuser.component.scss'] |
|
||||||
}) |
|
||||||
export class seeenterpriseuser { |
|
||||||
|
|
||||||
constructor(public http: HttpClient,public dialog: MatDialog, |
|
||||||
@Inject(MAT_DIALOG_DATA) public data) { } |
|
||||||
|
|
||||||
ngOnInit() {} |
|
||||||
|
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
|
||||||
|
|
||||||
import { JoinExamComponent } from './join-exam.component'; |
|
||||||
|
|
||||||
describe('JoinExamComponent', () => { |
|
||||||
let component: JoinExamComponent; |
|
||||||
let fixture: ComponentFixture<JoinExamComponent>; |
|
||||||
|
|
||||||
beforeEach(async(() => { |
|
||||||
TestBed.configureTestingModule({ |
|
||||||
declarations: [ JoinExamComponent ] |
|
||||||
}) |
|
||||||
.compileComponents(); |
|
||||||
})); |
|
||||||
|
|
||||||
beforeEach(() => { |
|
||||||
fixture = TestBed.createComponent(JoinExamComponent); |
|
||||||
component = fixture.componentInstance; |
|
||||||
fixture.detectChanges(); |
|
||||||
}); |
|
||||||
|
|
||||||
it('should create', () => { |
|
||||||
expect(component).toBeTruthy(); |
|
||||||
}); |
|
||||||
}); |
|
@ -1,15 +0,0 @@ |
|||||||
import { Component, OnInit } from '@angular/core'; |
|
||||||
|
|
||||||
@Component({ |
|
||||||
selector: 'app-join-exam', |
|
||||||
templateUrl: './join-exam.component.html', |
|
||||||
styleUrls: ['./join-exam.component.scss'] |
|
||||||
}) |
|
||||||
export class JoinExamComponent implements OnInit { |
|
||||||
|
|
||||||
constructor() { } |
|
||||||
|
|
||||||
ngOnInit(): void { |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -1,49 +0,0 @@ |
|||||||
|
|
||||||
<div style="height: 100%; width: 100%;"> |
|
||||||
<div class="topbox"> |
|
||||||
<div class="backtop"> |
|
||||||
<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: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: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> --> |
|
||||||
</div> |
|
||||||
<div class="btnbox"> |
|
||||||
<button type="button" mat-raised-button color="primary" (click)="onSubmit()">查询</button> |
|
||||||
<button type="button" mat-raised-button (click)="reset()">重置</button> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<mat-divider></mat-divider> |
|
||||||
<div class="listbox" [hidden]="noRecord"> |
|
||||||
<ul> |
|
||||||
<li *ngFor="let item of recordList;let key = index"> |
|
||||||
<p class="timeTitle" *ngIf="key ==0 || item.time != recordList[key - 1].time">{{item.time}}</p> |
|
||||||
<span class="listitem"> |
|
||||||
<span style="margin-right: 5px;">{{item.time2}}</span> |
|
||||||
{{item.operation}} : {{item.target | name3}} |
|
||||||
</span> |
|
||||||
|
|
||||||
</li> |
|
||||||
</ul> |
|
||||||
<mat-paginator |
|
||||||
|
|
||||||
[length]="length" |
|
||||||
[pageSize]="pageSize" |
|
||||||
(page)="chagePage($event)"> |
|
||||||
</mat-paginator> |
|
||||||
</div> |
|
||||||
<div class="nofiles" *ngIf="noRecord"> |
|
||||||
<span style="font-size: 14px;cursor: default;">该时间段未查询到学习记录~</span> |
|
||||||
</div> |
|
||||||
</div> |
|
@ -1,57 +0,0 @@ |
|||||||
.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: 84%; |
|
||||||
overflow-y: auto; |
|
||||||
.timeTitle{ |
|
||||||
font-weight: 800; |
|
||||||
font-size: 18px; |
|
||||||
} |
|
||||||
.listitem{ |
|
||||||
margin-left: 80px; |
|
||||||
font-size: 16px; |
|
||||||
line-height: 30px; |
|
||||||
} |
|
||||||
} |
|
||||||
.mat-paginator { |
|
||||||
background-color: hsla(0,0%,100%,0); |
|
||||||
padding-right: 10%; |
|
||||||
} |
|
||||||
.nofiles{ |
|
||||||
background: url("../../../assets/images/nofiles.png") no-repeat scroll center 0 transparent; |
|
||||||
padding-top: 150px; |
|
||||||
width: 488px; |
|
||||||
position: absolute; |
|
||||||
left: 50%; |
|
||||||
top: 50%; |
|
||||||
text-align: center; |
|
||||||
margin: -88px 0 0 -244px; |
|
||||||
} |
|
@ -1,188 +0,0 @@ |
|||||||
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<any>,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//身份证
|
|
||||||
PostName:any = this.route.snapshot.queryParams.PostName || "" //传过来的职务名称
|
|
||||||
|
|
||||||
recordList:any = false//渲染的100条列表
|
|
||||||
oneMonthDate:number = 30*24*60*60*1000; //一个月的时间戳
|
|
||||||
|
|
||||||
|
|
||||||
noRecord:boolean
|
|
||||||
//分页
|
|
||||||
@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", |
|
||||||
PostName : this.PostName |
|
||||||
} |
|
||||||
this.http.get("/api/StudyRecords",{params:data}).subscribe((data:any) => { |
|
||||||
this.recordList = data.items |
|
||||||
if(data.items.length == 0){ |
|
||||||
this.noRecord = true |
|
||||||
}else{ |
|
||||||
this.noRecord = false |
|
||||||
} |
|
||||||
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, |
|
||||||
Catalog : this.Catalog || "", |
|
||||||
PageNumber : this.PageNumber, |
|
||||||
PageSize:"100", |
|
||||||
PostName:this.PostName |
|
||||||
} |
|
||||||
this.http.get("/api/StudyRecords",{params:data}).subscribe((data:any) => { |
|
||||||
this.recordList = data.items |
|
||||||
if(data.items.length == 0){ |
|
||||||
this.noRecord = true |
|
||||||
}else{ |
|
||||||
this.noRecord = false |
|
||||||
} |
|
||||||
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 |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//返回上一页
|
|
||||||
backtop(){ |
|
||||||
history.go(-1) |
|
||||||
} |
|
||||||
//带查询时间获得所有学习记录
|
|
||||||
getAllStudyRecords2(){ |
|
||||||
let date:any = new Date() |
|
||||||
let data = { |
|
||||||
Name : this.id, |
|
||||||
StartTime : this.startTime, |
|
||||||
EndTime : this.endTime, |
|
||||||
Catalog : this.Catalog || "", |
|
||||||
PageNumber : this.PageNumber, |
|
||||||
PageSize:"100", |
|
||||||
PostName:this.PostName |
|
||||||
} |
|
||||||
this.http.get("/api/StudyRecords",{params:data}).subscribe((data:any) => { |
|
||||||
this.recordList = data.items |
|
||||||
if(data.items.length == 0){ |
|
||||||
this.noRecord = true |
|
||||||
}else{ |
|
||||||
this.noRecord = false |
|
||||||
} |
|
||||||
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.getAllStudyRecords2() |
|
||||||
} |
|
||||||
//重置
|
|
||||||
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() |
|
||||||
} |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
|
||||||
|
|
||||||
import { LookOverTestComponent } from './look-over-test.component'; |
|
||||||
|
|
||||||
describe('LookOverTestComponent', () => { |
|
||||||
let component: LookOverTestComponent; |
|
||||||
let fixture: ComponentFixture<LookOverTestComponent>; |
|
||||||
|
|
||||||
beforeEach(async(() => { |
|
||||||
TestBed.configureTestingModule({ |
|
||||||
declarations: [ LookOverTestComponent ] |
|
||||||
}) |
|
||||||
.compileComponents(); |
|
||||||
})); |
|
||||||
|
|
||||||
beforeEach(() => { |
|
||||||
fixture = TestBed.createComponent(LookOverTestComponent); |
|
||||||
component = fixture.componentInstance; |
|
||||||
fixture.detectChanges(); |
|
||||||
}); |
|
||||||
|
|
||||||
it('should create', () => { |
|
||||||
expect(component).toBeTruthy(); |
|
||||||
}); |
|
||||||
}); |
|
@ -1,15 +0,0 @@ |
|||||||
import { Component, OnInit } from '@angular/core'; |
|
||||||
|
|
||||||
@Component({ |
|
||||||
selector: 'app-look-over-test', |
|
||||||
templateUrl: './look-over-test.component.html', |
|
||||||
styleUrls: ['./look-over-test.component.scss'] |
|
||||||
}) |
|
||||||
export class LookOverTestComponent implements OnInit { |
|
||||||
|
|
||||||
constructor() { } |
|
||||||
|
|
||||||
ngOnInit(): void { |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -1 +0,0 @@ |
|||||||
<p>统计分析</p> |
|
@ -1,25 +0,0 @@ |
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
|
||||||
|
|
||||||
import { StatisticAnalysisComponent } from './statistic-analysis.component'; |
|
||||||
|
|
||||||
describe('StatisticAnalysisComponent', () => { |
|
||||||
let component: StatisticAnalysisComponent; |
|
||||||
let fixture: ComponentFixture<StatisticAnalysisComponent>; |
|
||||||
|
|
||||||
beforeEach(async(() => { |
|
||||||
TestBed.configureTestingModule({ |
|
||||||
declarations: [ StatisticAnalysisComponent ] |
|
||||||
}) |
|
||||||
.compileComponents(); |
|
||||||
})); |
|
||||||
|
|
||||||
beforeEach(() => { |
|
||||||
fixture = TestBed.createComponent(StatisticAnalysisComponent); |
|
||||||
component = fixture.componentInstance; |
|
||||||
fixture.detectChanges(); |
|
||||||
}); |
|
||||||
|
|
||||||
it('should create', () => { |
|
||||||
expect(component).toBeTruthy(); |
|
||||||
}); |
|
||||||
}); |
|
@ -1,15 +0,0 @@ |
|||||||
import { Component, OnInit } from '@angular/core'; |
|
||||||
|
|
||||||
@Component({ |
|
||||||
selector: 'app-statistic-analysis', |
|
||||||
templateUrl: './statistic-analysis.component.html', |
|
||||||
styleUrls: ['./statistic-analysis.component.scss'] |
|
||||||
}) |
|
||||||
export class StatisticAnalysisComponent implements OnInit { |
|
||||||
|
|
||||||
constructor() { } |
|
||||||
|
|
||||||
ngOnInit(): void { |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -1,49 +0,0 @@ |
|||||||
<h2 mat-dialog-title>创建教员</h2> |
|
||||||
|
|
||||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
|
||||||
|
|
||||||
<div> |
|
||||||
<mat-form-field> |
|
||||||
<input matInput id="idNumber" name="idNumber" |
|
||||||
required ngModel placeholder="请输入帐号" autocomplete="off" pattern="^[a-zA-Z][a-zA-Z0-9_]{4,19}$"> |
|
||||||
<mat-error> |
|
||||||
<strong>帐号格式为字母+数字</strong> |
|
||||||
</mat-error> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div> |
|
||||||
<mat-form-field> |
|
||||||
<input matInput id="realName" name="realName" |
|
||||||
maxlength="100" |
|
||||||
required ngModel placeholder="请输入真实姓名" autocomplete="off"> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div> |
|
||||||
<mat-form-field> |
|
||||||
<mat-select placeholder="请选择职务" [formControl]="toppings" multiple required> |
|
||||||
<div style="float: left;"> |
|
||||||
<mat-option *ngFor="let item of detachmentPosts" [value]="item.id">{{item.name}}</mat-option> |
|
||||||
</div> |
|
||||||
<div style="float: left;"> |
|
||||||
<mat-option *ngFor="let item of brigadePosts" [value]="item.id">{{item.name}}</mat-option> |
|
||||||
</div> |
|
||||||
<div style="float: left;"> |
|
||||||
<mat-option *ngFor="let item of RescueStationPosts" [value]="item.id">{{item.name}}</mat-option> |
|
||||||
</div> |
|
||||||
</mat-select> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
|
|
||||||
<div mat-dialog-content *ngIf="errmsg"> |
|
||||||
<p style="font-size: 14px; color: red;">{{errmsg}}</p> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div mat-dialog-actions> |
|
||||||
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid || toppings.value == null">确定</button> |
|
||||||
<button mat-raised-button mat-dialog-close>取消</button> |
|
||||||
</div> |
|
||||||
|
|
||||||
</form> |
|
@ -1,67 +0,0 @@ |
|||||||
import { Component, OnInit, Inject } from '@angular/core'; |
|
||||||
import { HttpClient } from '@angular/common/http'; |
|
||||||
import {MatDialogRef} from '@angular/material/dialog'; |
|
||||||
import {FormControl} from '@angular/forms'; |
|
||||||
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
||||||
|
|
||||||
@Component({ |
|
||||||
selector: 'addenterpriseuser', |
|
||||||
templateUrl: './addenterpriseuser.component.html', |
|
||||||
styleUrls: ['./enterpriseuser.component.scss'] |
|
||||||
}) |
|
||||||
export class AddTeacher { |
|
||||||
|
|
||||||
toppings = new FormControl(); |
|
||||||
constructor(private http: HttpClient,public dialogRef: MatDialogRef<AddTeacher>,public snackBar: MatSnackBar) {} |
|
||||||
errmsg:any; //捕获错误信息
|
|
||||||
detachmentPosts: any = []//支队职务列表
|
|
||||||
brigadePosts: any = []//大队职务列表
|
|
||||||
RescueStationPosts: any = []//救援站职务列表
|
|
||||||
ngOnInit(): void { |
|
||||||
this.getAllPosts() |
|
||||||
} |
|
||||||
|
|
||||||
//获得所有职务
|
|
||||||
getAllPosts(){ |
|
||||||
this.http.get("/api/Posts").subscribe( (data:any) =>{ |
|
||||||
data.forEach(item => { |
|
||||||
if(item.name.indexOf("支队级") != -1){ |
|
||||||
this.detachmentPosts.push(item) |
|
||||||
}else if(item.name.indexOf("大队级") != -1){ |
|
||||||
this.brigadePosts.push(item) |
|
||||||
}else{ |
|
||||||
this.RescueStationPosts.push(item) |
|
||||||
} |
|
||||||
}); |
|
||||||
})
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
//提交创建表单
|
|
||||||
onSubmit (e) { |
|
||||||
let date = new Date() |
|
||||||
let postsArr = this.toppings.value |
|
||||||
let postsObj = [] |
|
||||||
postsArr.forEach((item) => { |
|
||||||
postsObj.push({id:item, name:""}) |
|
||||||
}) |
|
||||||
let body = { |
|
||||||
name : e.idNumber, |
|
||||||
realName : e.realName, |
|
||||||
roleType : 1, |
|
||||||
enabled : true, |
|
||||||
creationTime : date, |
|
||||||
posts : postsObj |
|
||||||
} |
|
||||||
this.http.post("/api/Users",body).subscribe( data => { |
|
||||||
this.dialogRef.close(data); |
|
||||||
},err=>{ |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open(err,'确定',config); |
|
||||||
}) |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -1,46 +0,0 @@ |
|||||||
<h2 mat-dialog-title>编辑教员</h2> |
|
||||||
|
|
||||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
|
||||||
|
|
||||||
<div> |
|
||||||
<mat-form-field> |
|
||||||
<input matInput id="idNumber" name="idNumber" |
|
||||||
required [(ngModel)]="IdNumber" placeholder="请输入帐号" autocomplete="off" disabled pattern="^[a-zA-Z][a-zA-Z0-9_]{4,19}$"> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div> |
|
||||||
<mat-form-field> |
|
||||||
<input matInput id="realName" name="realName" |
|
||||||
maxlength="100" |
|
||||||
required [(ngModel)]="realName" placeholder="请输入真实姓名" autocomplete="off"> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div> |
|
||||||
<mat-form-field> |
|
||||||
<mat-select placeholder="请选择职务" [formControl]="toppings" multiple required> |
|
||||||
<div style="float: left;"> |
|
||||||
<mat-option *ngFor="let item of detachmentPosts" [value]="item.id">{{item.name}}</mat-option> |
|
||||||
</div> |
|
||||||
<div style="float: left;"> |
|
||||||
<mat-option *ngFor="let item of brigadePosts" [value]="item.id">{{item.name}}</mat-option> |
|
||||||
</div> |
|
||||||
<div style="float: left;"> |
|
||||||
<mat-option *ngFor="let item of RescueStationPosts" [value]="item.id">{{item.name}}</mat-option> |
|
||||||
</div> |
|
||||||
</mat-select> |
|
||||||
</mat-form-field> |
|
||||||
</div> |
|
||||||
|
|
||||||
|
|
||||||
<div mat-dialog-content *ngIf="errmsg"> |
|
||||||
<p style="font-size: 14px; color: red;">{{errmsg}}</p> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div mat-dialog-actions> |
|
||||||
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid || toppings.value == null">确定</button> |
|
||||||
<button mat-raised-button mat-dialog-close>取消</button> |
|
||||||
</div> |
|
||||||
|
|
||||||
</form> |
|
@ -1,72 +0,0 @@ |
|||||||
<div class="content"> |
|
||||||
<div class="header"> |
|
||||||
<form #form="ngForm"> |
|
||||||
<div class="queryBox"> |
|
||||||
|
|
||||||
<div class="queryField"> |
|
||||||
<label style="margin-right: 10px;">用户账号:</label> |
|
||||||
<input type="text" [(ngModel)]="identityCard" name="identityCard" autocomplete="off" placeholder="请输入用户账号"> |
|
||||||
</div> |
|
||||||
<div class="queryField"> |
|
||||||
<label style="margin-right: 10px;">用户姓名:</label> |
|
||||||
<input type="text" [(ngModel)]="name" name="name" autocomplete="off" placeholder="请输入用户姓名"> |
|
||||||
</div> |
|
||||||
<div class="queryField"> |
|
||||||
<label style="margin-right: 10px;">消防救援站:</label> |
|
||||||
<input type="text" [(ngModel)]="fireTeam" name="fireTeam" autocomplete="off" placeholder="请选择消防救援站"> |
|
||||||
</div> |
|
||||||
<div class="queryField"> |
|
||||||
<button mat-raised-button (click)='initData()' style="background-color: #07CDCF;">查询</button> |
|
||||||
<button mat-raised-button (click)='empty()' style="margin-left: 10px; background-color: #FF8678;">重置</button> |
|
||||||
</div> |
|
||||||
<div class="queryField"> |
|
||||||
<button mat-raised-button (click)='open()' style="background-color: #07CDCF;">新增用户</button> |
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
||||||
</form> |
|
||||||
</div> |
|
||||||
|
|
||||||
<table mat-table [dataSource]="dataSource"> |
|
||||||
|
|
||||||
<ng-container matColumnDef="identitycard"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>用户帐号</th> |
|
||||||
<td mat-cell *matCellDef="let element">{{element.name}}</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<ng-container matColumnDef="name"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>用户姓名</th> |
|
||||||
<td mat-cell *matCellDef="let element">{{element.realName}}</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<ng-container matColumnDef="post"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>消防救援站</th> |
|
||||||
<td mat-cell *matCellDef="let element">{{element.organizationName}}</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<ng-container matColumnDef="time"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>创建时间</th> |
|
||||||
<td mat-cell *matCellDef="let element">{{element.creationTime | date:'yyyy-MM-dd'}}</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<ng-container matColumnDef="operation"> |
|
||||||
<th mat-header-cell *matHeaderCellDef>操作</th> |
|
||||||
<td mat-cell *matCellDef="let element"> |
|
||||||
<span class="operationSpan"><span class="spanbtn green" (click)="reset(element)">重置密码</span></span> |
|
||||||
<span class="operationSpan"><span class="spanbtn green" (click)="edit(element)">编辑</span></span> |
|
||||||
<span *ngIf="element.enabled" class="operationSpan"><span class="spanbtn red" (click)="noEnabled(element)">禁用</span></span> |
|
||||||
<span *ngIf="!element.enabled" class="operationSpan"><span class="spanbtn gray" (click)="enabled(element)">禁用</span></span> |
|
||||||
<span class="operationSpan"><span class="spanbtn red" (click)="delete(element)">删除</span></span> |
|
||||||
</td> |
|
||||||
</ng-container> |
|
||||||
|
|
||||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> |
|
||||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> |
|
||||||
</table> |
|
||||||
<mat-paginator [length]="length" |
|
||||||
[pageSize]="pageSize" |
|
||||||
[pageSizeOptions]="pageSizeOptions" |
|
||||||
(page)="chagePage($event)"> |
|
||||||
</mat-paginator> |
|
||||||
|
|
||||||
</div> |
|
@ -1,54 +0,0 @@ |
|||||||
table { |
|
||||||
width: 100%; |
|
||||||
text-align: center; |
|
||||||
.cdk-header-cell { |
|
||||||
text-align: center; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
.content { |
|
||||||
width: 100%; |
|
||||||
height: 100%; |
|
||||||
overflow: hidden; |
|
||||||
background: #F2F5F6; |
|
||||||
} |
|
||||||
.header { |
|
||||||
width: 100%; |
|
||||||
padding: 10px; |
|
||||||
margin-bottom: 10px; |
|
||||||
box-sizing: border-box; |
|
||||||
.queryBox { |
|
||||||
box-sizing: border-box; |
|
||||||
padding: 5px 15px; |
|
||||||
display: flex; |
|
||||||
flex-direction: row; |
|
||||||
flex-wrap: wrap; |
|
||||||
align-items:center; |
|
||||||
justify-content:center; |
|
||||||
.queryField { |
|
||||||
margin: 0 25px; |
|
||||||
font-size: 14px; |
|
||||||
input { |
|
||||||
width: 160px; |
|
||||||
height: 34px; |
|
||||||
line-height: 34px; |
|
||||||
border-radius: 5px; |
|
||||||
padding-left: 5px; |
|
||||||
outline: none; |
|
||||||
border: 1px solid rgb(226, 211, 211); |
|
||||||
} |
|
||||||
button { color: #fff; } |
|
||||||
} |
|
||||||
} //queryBox |
|
||||||
} |
|
||||||
|
|
||||||
.operationSpan{ |
|
||||||
margin: 0 10px; |
|
||||||
.spanbtn { |
|
||||||
font-weight: 550; |
|
||||||
cursor: pointer; |
|
||||||
} |
|
||||||
.green{ color: #04ced1; } |
|
||||||
.red{ color: #FF8678 } |
|
||||||
.gray{ color: gray; } |
|
||||||
} |
|
@ -1,272 +0,0 @@ |
|||||||
import { Component, OnInit, ViewChild, Inject } from '@angular/core'; |
|
||||||
import {HttpClient} from '@angular/common/http' |
|
||||||
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
||||||
import { MatPaginator } from '@angular/material/paginator'; |
|
||||||
import { MatTableDataSource } from '@angular/material/table'; |
|
||||||
import { PageEvent } from '@angular/material/paginator'; |
|
||||||
import { AddTeacher } from './addenterpriseuser.component' |
|
||||||
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
||||||
import {FormControl} from '@angular/forms'; |
|
||||||
|
|
||||||
@Component({ |
|
||||||
selector: 'app-enterpriseuser', |
|
||||||
templateUrl: './enterpriseuser.component.html', |
|
||||||
styleUrls: ['./enterpriseuser.component.scss'] |
|
||||||
}) |
|
||||||
export class TeacherManagementComponent implements OnInit { |
|
||||||
|
|
||||||
constructor(public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { } |
|
||||||
|
|
||||||
ngOnInit() { |
|
||||||
this.initData() |
|
||||||
} |
|
||||||
|
|
||||||
displayedColumns: string[] = ['identitycard', 'name', 'post', 'time', 'operation',]; |
|
||||||
dataSource:any; //所有企业用户
|
|
||||||
|
|
||||||
name:any //用户姓名
|
|
||||||
identityCard:any //用户账号
|
|
||||||
fireTeam:any; //消防救援站
|
|
||||||
|
|
||||||
//分页
|
|
||||||
@ViewChild(MatPaginator, {static: true})
|
|
||||||
pageEvent: PageEvent; |
|
||||||
paginator: MatPaginator; |
|
||||||
length:any; //共多少条数据
|
|
||||||
pageSize:any; //每页条数
|
|
||||||
pageSizeOptions: number[] = [10] //设置每页条数
|
|
||||||
pageNumber:number = 1; //第几页
|
|
||||||
|
|
||||||
//分页切换
|
|
||||||
chagePage (e) { |
|
||||||
this.pageNumber = e.pageIndex+1 |
|
||||||
let data= { |
|
||||||
Name: this.identityCard || '', |
|
||||||
RealName: this.name || '', |
|
||||||
RoleType: '1', |
|
||||||
PageNumber: String(this.pageNumber), |
|
||||||
} |
|
||||||
this.http.get('/api/ExamUsers',{params:data}).subscribe((data:any)=>{ |
|
||||||
this.length = data.totalCount |
|
||||||
this.pageSize = data.pageSize |
|
||||||
this.dataSource = new MatTableDataSource<any>(data.items) |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//页面初始化 + 查询 + 重置
|
|
||||||
initData () { |
|
||||||
let data= { |
|
||||||
Name: this.identityCard || '', |
|
||||||
RealName: this.name || '', |
|
||||||
RoleType: '1', |
|
||||||
} |
|
||||||
this.http.get('/api/ExamUsers',{params:data}).subscribe((data:any)=>{ |
|
||||||
this.length = data.totalCount |
|
||||||
this.pageSize = data.pageSize |
|
||||||
this.pageEvent.pageIndex = 0 |
|
||||||
this.dataSource = new MatTableDataSource<any>(data.items) |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//更新当前页数据
|
|
||||||
getAllUsers () { |
|
||||||
let data= { |
|
||||||
Name: this.identityCard || '', |
|
||||||
RealName: this.name || '', |
|
||||||
RoleType: '1', |
|
||||||
PageNumber: String(this.pageNumber), |
|
||||||
} |
|
||||||
this.http.get('/api/ExamUsers',{params:data}).subscribe((data:any)=>{ |
|
||||||
this.length = data.totalCount |
|
||||||
this.pageSize = data.pageSize |
|
||||||
this.dataSource = new MatTableDataSource<any>(data.items) |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//清空搜索
|
|
||||||
empty () { |
|
||||||
this.identityCard = '' |
|
||||||
this.name = '' |
|
||||||
this.initData() |
|
||||||
} |
|
||||||
|
|
||||||
//创建教员
|
|
||||||
open(){ |
|
||||||
let dialogRef = this.dialog.open(AddTeacher, {//调用open方法打开对话框并且携带参数过去
|
|
||||||
width: '250px', |
|
||||||
}); |
|
||||||
dialogRef.afterClosed().subscribe(data=>{ |
|
||||||
if (data) { |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open('创建成功!','确定',config); |
|
||||||
this.getAllUsers() |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
//编辑企业用户
|
|
||||||
edit (e) { |
|
||||||
let dialogRef = this.dialog.open(editTeacher,{ |
|
||||||
width: '250px', |
|
||||||
data:e |
|
||||||
}); |
|
||||||
dialogRef.afterClosed().subscribe(data=>{ |
|
||||||
if (data) { |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open('修改成功!','确定',config);
|
|
||||||
this.getAllUsers() |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
//重置密码
|
|
||||||
reset (e) { |
|
||||||
this.http.put(`/api/ExamUsers/${e.name}/ResetPassword`,{}).subscribe( |
|
||||||
data=>{ |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open('重置密码成功!','确定',config); |
|
||||||
},err=>{ |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open('重置密码失败!','确定',config); |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//启用
|
|
||||||
enabled (e) { |
|
||||||
let date = new Date() |
|
||||||
let body = { |
|
||||||
name : e.name, |
|
||||||
realName : e.realName, |
|
||||||
roleType : e.roleType, |
|
||||||
enabled : true, |
|
||||||
creationTime : date, |
|
||||||
posts : e.posts |
|
||||||
} |
|
||||||
this.http.put(`/api/ExamUsers/${e.name}`,body).subscribe(data => { |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000; |
|
||||||
this.snackBar.open('启用成功!','确定',config); |
|
||||||
this.getAllUsers(); |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//禁用
|
|
||||||
noEnabled (e) { |
|
||||||
let date = new Date() |
|
||||||
let body = { |
|
||||||
name : e.name, |
|
||||||
realName : e.realName, |
|
||||||
roleType : e.roleType, |
|
||||||
enabled : false, |
|
||||||
creationTime : date, |
|
||||||
posts : e.posts |
|
||||||
} |
|
||||||
this.http.put(`/api/ExamUsers/${e.name}`,body).subscribe(data => { |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000; |
|
||||||
this.snackBar.open('禁用成功!','确定',config); |
|
||||||
this.getAllUsers(); |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//删除
|
|
||||||
delete (e) { |
|
||||||
let isTrue = confirm('您确定要删除吗') |
|
||||||
if (isTrue) { |
|
||||||
this.http.delete(`/api/ExamUsers/${e.name}`).subscribe(data=>{ |
|
||||||
const config = new MatSnackBarConfig(); |
|
||||||
config.verticalPosition = 'top'; |
|
||||||
config.duration = 3000 |
|
||||||
this.snackBar.open('删除成功!','确定',config); |
|
||||||
this.getAllUsers() |
|
||||||
}) |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//编辑企业用户
|
|
||||||
@Component({ |
|
||||||
selector: 'app-editenterpriseuser', |
|
||||||
templateUrl: './editenterpriseuser.html', |
|
||||||
styleUrls: ['./enterpriseuser.component.scss'] |
|
||||||
}) |
|
||||||
export class editTeacher { |
|
||||||
|
|
||||||
toppings:any = new FormControl(); |
|
||||||
constructor(private http: HttpClient,public dialogRef: MatDialogRef<editTeacher>,@Inject(MAT_DIALOG_DATA) public data) {} |
|
||||||
errmsg:any; //捕获错误信息
|
|
||||||
detachmentPosts: any = []//支队职务列表
|
|
||||||
brigadePosts: any = []//大队职务列表
|
|
||||||
RescueStationPosts: any = []//救援站职务列表
|
|
||||||
|
|
||||||
IdNumber:any //身份证号
|
|
||||||
realName:any //真实姓名
|
|
||||||
ngOnInit(): void { |
|
||||||
this.toppings.value = [] |
|
||||||
this.IdNumber = this.data.name |
|
||||||
this.realName = this.data.realName |
|
||||||
this.data.posts.forEach((item) => { |
|
||||||
this.toppings.value.push(item.id) |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
//获得所有职务
|
|
||||||
getAllPosts(){ |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
//提交创建表单
|
|
||||||
onSubmit (e) { |
|
||||||
let date = new Date() |
|
||||||
let postsArr = this.toppings.value |
|
||||||
let postsObj = [] |
|
||||||
postsArr.forEach((item) => { |
|
||||||
postsObj.push({id:item, name:""}) |
|
||||||
}) |
|
||||||
let body = { |
|
||||||
name : this.data.name, |
|
||||||
realName : e.realName, |
|
||||||
roleType : 1, |
|
||||||
enabled : this.data.enabled, |
|
||||||
creationTime : date, |
|
||||||
posts : postsObj |
|
||||||
} |
|
||||||
this.http.put(`/api/ExamUsers/${this.data.name}`,body).subscribe(data => { |
|
||||||
this.dialogRef.close("修改成功"); |
|
||||||
}) |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//查看企业用户
|
|
||||||
@Component({ |
|
||||||
selector: 'app-seeenterpriseuser', |
|
||||||
templateUrl: './seeenterpriseuser.html', |
|
||||||
styleUrls: ['./enterpriseuser.component.scss'] |
|
||||||
}) |
|
||||||
export class seeTeacher { |
|
||||||
|
|
||||||
constructor(public http: HttpClient,public dialog: MatDialog, |
|
||||||
@Inject(MAT_DIALOG_DATA) public data) { } |
|
||||||
|
|
||||||
ngOnInit() {} |
|
||||||
|
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
|
||||||
|
|
||||||
import { TestRecordsComponent } from './test-records.component'; |
|
||||||
|
|
||||||
describe('TestRecordsComponent', () => { |
|
||||||
let component: TestRecordsComponent; |
|
||||||
let fixture: ComponentFixture<TestRecordsComponent>; |
|
||||||
|
|
||||||
beforeEach(async(() => { |
|
||||||
TestBed.configureTestingModule({ |
|
||||||
declarations: [ TestRecordsComponent ] |
|
||||||
}) |
|
||||||
.compileComponents(); |
|
||||||
})); |
|
||||||
|
|
||||||
beforeEach(() => { |
|
||||||
fixture = TestBed.createComponent(TestRecordsComponent); |
|
||||||
component = fixture.componentInstance; |
|
||||||
fixture.detectChanges(); |
|
||||||
}); |
|
||||||
|
|
||||||
it('should create', () => { |
|
||||||
expect(component).toBeTruthy(); |
|
||||||
}); |
|
||||||
}); |
|
@ -1,15 +0,0 @@ |
|||||||
import { Component, OnInit } from '@angular/core'; |
|
||||||
|
|
||||||
@Component({ |
|
||||||
selector: 'app-test-records', |
|
||||||
templateUrl: './test-records.component.html', |
|
||||||
styleUrls: ['./test-records.component.scss'] |
|
||||||
}) |
|
||||||
export class TestRecordsComponent implements OnInit { |
|
||||||
|
|
||||||
constructor() { } |
|
||||||
|
|
||||||
ngOnInit(): void { |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -1,23 +0,0 @@ |
|||||||
<div class="content"> |
|
||||||
<div class="header"> |
|
||||||
<label style="font-size: 14px;">{{thatFile.uploadProgress2}} 上传中...</label> |
|
||||||
<button mat-raised-button style="margin-left: 60%;" *ngIf="isShow" (click)='toggle()'><mat-icon>keyboard_arrow_down</mat-icon></button> |
|
||||||
<button mat-raised-button style="margin-left: 60%;" *ngIf="!isShow" (click)='toggle()'><mat-icon>keyboard_arrow_up</mat-icon></button> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div style="margin-top: 10px; border-top: 1px solid #e2e2e2;" [hidden]="!isShow"> |
|
||||||
|
|
||||||
<p class="dataStyle" *ngFor="let item of filesData"> |
|
||||||
<span class="dataName">{{item.name}}</span> |
|
||||||
<span class="dataSize">{{item.size | size}}</span> |
|
||||||
<span class="dataState" style="position: relative;"> |
|
||||||
<label *ngIf="item.state==0">等待中...</label> |
|
||||||
<label *ngIf="item.state==1"><mat-spinner diameter=24></mat-spinner></label> |
|
||||||
<label *ngIf="item.state==2" style="color: green;">√</label> |
|
||||||
</span> |
|
||||||
<span class="dataState" *ngIf="item.state==1 && item.size > 5242880" style="font-size: 22px; cursor:pointer;" title='取消上传' (click)='cancel()'> × </span> |
|
||||||
</p> |
|
||||||
|
|
||||||
</div> |
|
||||||
|
|
||||||
</div> |
|
@ -1,72 +0,0 @@ |
|||||||
.content { |
|
||||||
width: 100%; |
|
||||||
max-height: 250px; |
|
||||||
overflow-y: auto; |
|
||||||
overflow-x: hidden; |
|
||||||
background-color: #fff; |
|
||||||
border: 1px solid #e2e2e2; |
|
||||||
box-shadow: 0 0 10px #ccc; |
|
||||||
border-radius: 10px; |
|
||||||
box-sizing: border-box; |
|
||||||
padding: 10px; |
|
||||||
} |
|
||||||
.header { |
|
||||||
box-sizing: border-box; |
|
||||||
height: 30px; |
|
||||||
line-height: 30px; |
|
||||||
button { |
|
||||||
height: 30px; |
|
||||||
line-height: 30px; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
//每一行数据 |
|
||||||
.dataStyle { |
|
||||||
height: 30px; |
|
||||||
line-height: 30px; |
|
||||||
margin: 5px 0; |
|
||||||
box-sizing: border-box; |
|
||||||
padding: 0 3px; |
|
||||||
span{ |
|
||||||
display: inline-block; |
|
||||||
font-size: 12px; |
|
||||||
white-space: nowrap; |
|
||||||
overflow: hidden; |
|
||||||
text-overflow: ellipsis; |
|
||||||
line-height: 30px; |
|
||||||
} |
|
||||||
.dataName { |
|
||||||
width: 40%; |
|
||||||
margin-right: 10px; |
|
||||||
} |
|
||||||
.dataSize { |
|
||||||
width: 20%; |
|
||||||
} |
|
||||||
.dataState { |
|
||||||
width: 15%; |
|
||||||
} |
|
||||||
} |
|
||||||
.dataStyle:hover { |
|
||||||
background-color: #e2e2e2; |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//滚动条样式 |
|
||||||
.content::-webkit-scrollbar { |
|
||||||
/*滚动条整体样式*/ |
|
||||||
width : 6px; /*高宽分别对应横竖滚动条的尺寸*/ |
|
||||||
height: 1px; |
|
||||||
} |
|
||||||
.content::-webkit-scrollbar-thumb { |
|
||||||
/*滚动条里面小方块*/ |
|
||||||
border-radius: 10px; |
|
||||||
box-shadow : inset 0 0 5px #999; |
|
||||||
background : #535353; |
|
||||||
} |
|
||||||
.content::-webkit-scrollbar-track { |
|
||||||
/*滚动条里面轨道*/ |
|
||||||
box-shadow : inset 0 0 5px #999; |
|
||||||
border-radius: 10px; |
|
||||||
background : #ededed; |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
|
||||||
|
|
||||||
import { UploadFilesComponent } from './upload-files.component'; |
|
||||||
|
|
||||||
describe('UploadFilesComponent', () => { |
|
||||||
let component: UploadFilesComponent; |
|
||||||
let fixture: ComponentFixture<UploadFilesComponent>; |
|
||||||
|
|
||||||
beforeEach(async(() => { |
|
||||||
TestBed.configureTestingModule({ |
|
||||||
declarations: [ UploadFilesComponent ] |
|
||||||
}) |
|
||||||
.compileComponents(); |
|
||||||
})); |
|
||||||
|
|
||||||
beforeEach(() => { |
|
||||||
fixture = TestBed.createComponent(UploadFilesComponent); |
|
||||||
component = fixture.componentInstance; |
|
||||||
fixture.detectChanges(); |
|
||||||
}); |
|
||||||
|
|
||||||
it('should create', () => { |
|
||||||
expect(component).toBeTruthy(); |
|
||||||
}); |
|
||||||
}); |
|
@ -1,67 +0,0 @@ |
|||||||
import { Component, OnInit,Input } from '@angular/core'; |
|
||||||
|
|
||||||
@Component({ |
|
||||||
selector: 'app-upload-files', |
|
||||||
templateUrl: './upload-files.component.html', |
|
||||||
styleUrls: ['./upload-files.component.scss'] |
|
||||||
}) |
|
||||||
export class UploadFilesComponent implements OnInit { |
|
||||||
|
|
||||||
constructor() { } |
|
||||||
|
|
||||||
ngOnInit(): void { |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
@Input( ) thatFile:any //父组件
|
|
||||||
|
|
||||||
isShow:boolean = true; //弹出框最大/化最小化
|
|
||||||
filesData:any = []; //上传文件夹数据
|
|
||||||
|
|
||||||
//上传文件夹弹窗显隐
|
|
||||||
toggle () { |
|
||||||
this.isShow = !this.isShow |
|
||||||
} |
|
||||||
|
|
||||||
//处理数据格式
|
|
||||||
handleData () { |
|
||||||
this.filesData = [] |
|
||||||
for (let i=0; i<this.thatFile.fileArr.length; i++) { |
|
||||||
this.thatFile.fileArr[i].state = 0 |
|
||||||
this.filesData.push(this.thatFile.fileArr[i]) |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
//当前上传文件正在上传
|
|
||||||
uploading (e) { |
|
||||||
this.filesData.forEach(element => { |
|
||||||
if (element.name == e.name) { |
|
||||||
element.state = 1
|
|
||||||
return |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
//当前上传文件上传成功
|
|
||||||
endUpload (e) { |
|
||||||
this.filesData.forEach(element => { |
|
||||||
if (element.name == e.name) { |
|
||||||
element.state = 2
|
|
||||||
return |
|
||||||
} |
|
||||||
}); |
|
||||||
} |
|
||||||
|
|
||||||
//清空数据
|
|
||||||
delete () { |
|
||||||
this.filesData = [] |
|
||||||
} |
|
||||||
|
|
||||||
//取消上传
|
|
||||||
cancel () { |
|
||||||
this.thatFile.cancel2() |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} |
|
Loading…
Reference in new issue