邵佳豪 4 years ago
parent
commit
b10696108d
  1. 4
      src/app/app-routing.module.ts
  2. 11
      src/app/examiner/examiner-index/examiner-index.component.ts
  3. 2
      src/app/pages/lockscreen/lockscreen.component.ts
  4. 1
      src/app/student/examination-details/examination-details.component.html
  5. 0
      src/app/student/examination-details/examination-details.component.scss
  6. 25
      src/app/student/examination-details/examination-details.component.spec.ts
  7. 15
      src/app/student/examination-details/examination-details.component.ts
  8. 39
      src/app/student/student-index/student-index.component.html
  9. 35
      src/app/student/student-index/student-index.component.scss
  10. 86
      src/app/student/student-index/student-index.component.ts
  11. 3
      src/app/student/student.module.ts
  12. 9
      src/app/ui/collection-tools/collection-tools.component.ts

4
src/app/app-routing.module.ts

@ -16,6 +16,7 @@ import { LockscreenComponent } from './pages/lockscreen/lockscreen.component';
import {AuthGuard} from './auth.guard'
import { CreateTestScoreComponent } from './examiner/create-test-score/create-test-score.component';
import { CollectionToolsComponent } from './ui/collection-tools/collection-tools.component';
import { ExaminationDetailsComponent } from './student/examination-details/examination-details.component';
@ -30,7 +31,8 @@ const routes: Routes = [
]
},
{ path:'examiner/create-test-score', component:CreateTestScoreComponent,canActivate: [AuthGuard],}, //创建试卷具体分数页面
{ path:'canvasTool', component:CollectionToolsComponent,canActivate: [AuthGuard], }, //编制工具
{ path:'canvasTool', component:CollectionToolsComponent,canActivate: [AuthGuard], }, //考官编制工具
{ path:'examinationDetails', component:ExaminationDetailsComponent,canActivate: [AuthGuard], }, //考生试卷 考试基本信息/作战部署
{ path:'adminLogin', component:LoginComponent}, //管理员登录路由
{ path:'login', component:LockscreenComponent}, //教员学员登录路由

11
src/app/examiner/examiner-index/examiner-index.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-11 09:06:03
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-21 11:03:07
* @LastEditTime: 2020-12-21 14:25:29
*/
import { Component, OnInit, ViewChild, Inject,Input } from '@angular/core';
import {HttpClient} from '@angular/common/http'
@ -167,6 +167,7 @@ export class ExaminerIndexComponent implements OnInit {
this.http.get("/api/Papers",{params:paramsdata}).subscribe((data:any)=>{
this.tabledataSource=data.items
this.length=data.totalCount
//console.log(this.tabledataSource)
})
}
//获取消防救援对信息
@ -191,7 +192,7 @@ export class ExaminerIndexComponent implements OnInit {
//获取optionid
getoption(){
var selectIndex =document.getElementById("cars");
console.log(selectIndex)
//console.log(selectIndex)
//var activeName_value =document.getElementById("usertype").options[selectIndex].id;
}
//查询按钮
@ -208,7 +209,7 @@ export class ExaminerIndexComponent implements OnInit {
})
}
console.log(this.accound) */
console.log(this.jscheck,this.jsId)
//console.log(this.jscheck,this.jsId)
this.PageNumber = 1
this.pageEvent.pageIndex = 0
this.getAlltabledate()
@ -340,7 +341,7 @@ export class FinishDia{
creatorId: this.Profiles.id,
paperDataInfo: null
}
console.log(params)
//console.log(params)
this.http.post('/api/Papers',params).subscribe(data => {
this.snackBar.open('创建成功','确定',config);
this.dialogRef.close();
@ -350,7 +351,7 @@ export class FinishDia{
sessionStorage.setItem("paperId",this.tabledate.id)
this.router.navigate(['/home/createexam-index/examiner-new-one']) //跳转试卷列表页面
},err => {
this.snackBar.open('创建失败','确定',config);
this.snackBar.open(err,'确定',config);
})
}
}

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

@ -35,7 +35,7 @@ export class LockscreenComponent implements OnInit {
sessionStorage.setItem("refreshToken",data.refreshToken);
sessionStorage.setItem("level",data.level);
this.token.startUp(); //登陆成功启动定时器刷新token
this.router.navigate(['/home/createexam-index']) //登陆成功跳转页面
this.roleType == '1'? this.router.navigate(['/home/createexam-index']) : this.router.navigate(['/home/student-index'])
},(err) => {this.errmsg = err})
}

1
src/app/student/examination-details/examination-details.component.html

@ -0,0 +1 @@
<p>11111123</p>

0
src/app/student/examination-details/examination-details.component.scss

25
src/app/student/examination-details/examination-details.component.spec.ts

@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ExaminationDetailsComponent } from './examination-details.component';
describe('ExaminationDetailsComponent', () => {
let component: ExaminationDetailsComponent;
let fixture: ComponentFixture<ExaminationDetailsComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ExaminationDetailsComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ExaminationDetailsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

15
src/app/student/examination-details/examination-details.component.ts

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-examination-details',
templateUrl: './examination-details.component.html',
styleUrls: ['./examination-details.component.scss']
})
export class ExaminationDetailsComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}

39
src/app/student/student-index/student-index.component.html

@ -1 +1,38 @@
<p>student-index works!</p>
<!--
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-12-20 15:01:30
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-21 17:10:56
-->
<div class="content">
<div class="centertable">
<table >
<thead>
<th style="width: 15%;">试卷名称</th>
<th style="width: 15%;">考核队站</th>
<th style="width: 20%;">开始时间</th>
<th style="width: 20%;">结束时间</th>
<th style="width: 15%;">考试时长</th>
<th style="width: 15%;">操作</th>
</thead>
<tbody>
<tr *ngFor="let item of tabledataSource">
<td>{{item.title}}</td>
<td>广西总队</td>
<td>{{item.startTime|date:'yyyy-MM-dd HH:mm'}}</td>
<td>{{item.endTime|date:'yyyy-MM-dd HH:mm'}}</td>
<td>{{item.duration}}分钟</td>
<td style="color: #07CDCF;cursor: pointer;" (click)='takeTest(item)'>参加考试</td>
</tr>
</tbody>
</table>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
</div>
</div>

35
src/app/student/student-index/student-index.component.scss

@ -0,0 +1,35 @@
.content {
width: 100%;
height: 100%;
overflow: hidden;
background: #F2F5F6;
overflow-y: auto;
}
.centertable{
width: 95%;
margin-right: 40px;
margin-left: 40px;
margin-top: 40px;
background-color: #FFFFFF;
table{
width: 100%;
td,th{
height: 48px;
font-size: 16px;
}
td{
border-bottom: 1px solid #F2F5F6;
text-align: center;
}
thead{
background-color:#F5FDFE;
width: 100%;
}
.green{
color: #07CDCF;
}
.red{
color: #FF8678;
}
}
}

86
src/app/student/student-index/student-index.component.ts

@ -1,4 +1,23 @@
import { Component, OnInit } from '@angular/core';
/*
* @Descripttion:
* @version:
* @Author: sueRimn
* @Date: 2020-12-20 15:01:30
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-22 10:08:19
*/
import { Component, OnInit, ViewChild, Inject,Input } 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 { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import {FormControl} from '@angular/forms';
import { Router,ActivatedRoute } from '@angular/router';
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { FlatTreeControl } from '@angular/cdk/tree';
import { TreeService } from '../../http-interceptors/tree.service'
@Component({
selector: 'app-student-index',
@ -7,9 +26,72 @@ import { Component, OnInit } from '@angular/core';
})
export class StudentIndexComponent implements OnInit {
constructor() { }
constructor(private router: Router,private activatedRoute: ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,private tree: TreeService) { }
ngOnInit(): void {
this.getAlltabledate()
setInterval(()=>this.getAlltabledate(),60000)
//this.idtime=setInterval(()=>this.jishi("","2020-12-22 11:03"),1000)
//console.log(this.idtime)
}
idtime
//分页
@ViewChild(MatPaginator, {static: true})
pageEvent: PageEvent;
paginator: MatPaginator;
length:any; //共多少条数据
pageSize:any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any //第几页
startTime:[]
endTime:[]
tabledataSource//表格数据
timecha
//分页事件
chagePage(e){
this.PageNumber = e.pageIndex+1
this.getAlltabledate()
}
//获取表格信息
getAlltabledate(){
let paramsdata:any = {
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
Sort: null,
SortType: null,
Status:1
}
this.http.get("/api/Papers",{params:paramsdata}).subscribe((data:any)=>{
this.tabledataSource=data.items
this.length=data.totalCount
console.log(this.tabledataSource)
})
}
//计时器
jishi(startTime,endTime){
startTime=new Date
var nowtime = new Date(startTime), //获取当前时间
endtime = new Date(endTime); //定义结束时间
var lefttime = endtime.getTime() - nowtime.getTime(), //距离结束时间的毫秒数
leftd = Math.floor(lefttime/(1000*60*60*24)), //计算天数
lefth = Math.floor(lefttime/(1000*60*60)), //计算小时数
leftm = Math.floor(lefttime/(1000*60)%60), //计算分钟数
lefts = Math.floor(lefttime/1000%60); //计算秒数
this.timecha=lefth+":"+leftm+":"+lefts
if(this.timecha=='0:0:0'){
this.timecha="已结束"
clearInterval(this.idtime)
}
console.log(this.timecha)
}
//参加考试
takeTest (e) {
window.open(`/examinationDetails?testId=${e.id}`)
}
}

3
src/app/student/student.module.ts

@ -52,10 +52,11 @@ import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
import { StudentRoutingModule } from './student-routing.module';
import { StudentIndexComponent } from './student-index/student-index.component';
import { StudentExamRecordComponent } from './student-exam-record/student-exam-record.component';
import { ExaminationDetailsComponent } from './examination-details/examination-details.component';
@NgModule({
declarations: [StudentIndexComponent, StudentExamRecordComponent],
declarations: [StudentIndexComponent, StudentExamRecordComponent, ExaminationDetailsComponent],
imports: [
CommonModule,
StudentRoutingModule,

9
src/app/ui/collection-tools/collection-tools.component.ts

@ -1095,9 +1095,14 @@ export class CollectionToolsComponent implements OnInit {
openUploadQuestions () {
let treeData = JSON.parse( JSON.stringify(this.dataSource.data) )
let nodes = JSON.parse( JSON.stringify( JSON.parse(sessionStorage.getItem('examNodeList')) ) )
if (treeData && nodes) {
if (nodes) {
let data = { treeData: treeData, question: JSON.parse( JSON.stringify(this.examMsg) ), node: nodes }
let dialogRef = this.dialog.open(uploadQuestions,{data});
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('未选择考核处置节点','确定',config);
}
}
@ -1846,7 +1851,7 @@ export class CollectionToolsComponent implements OnInit {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('暂无数据节点','确定',config);
this.snackBar.open('暂无处置节点','确定',config);
}
}

Loading…
Cancel
Save