Browse Source

[修改]考官阅卷首页面真实数据

master
chenjingyu 4 years ago
parent
commit
1ab99f9000
  1. 21
      src/app/examiner/mark-papers-index/mark-papers-index.component.html
  2. 36
      src/app/examiner/mark-papers-index/mark-papers-index.component.ts
  3. 19
      src/app/examiner/mark-papers-two/mark-papers-two.component.html
  4. 40
      src/app/examiner/mark-papers-two/mark-papers-two.component.ts

21
src/app/examiner/mark-papers-index/mark-papers-index.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-14 16:30:31
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-14 17:39:30
* @LastEditTime: 2020-12-25 08:59:47
-->
<div class="content">
<div class="header">
@ -35,21 +35,22 @@
</thead>
<tbody>
<tr *ngFor="let item of dataSource">
<td>{{item.name}}</td>
<td>{{item.organization}}</td>
<td>{{item.startTime}}</td>
<td>{{item.overTime}}</td>
<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 >
<span id={{item.name}} style="color: #07CDCF;cursor: pointer;" (click)="markTwo(item.name)">阅卷</span>
<span id={{item.name}} style="color: #07CDCF;cursor: pointer;" (click)="markTwo(item.title,item.id)">阅卷</span>
</td>
</tr>
</tbody>
</table>
<mat-paginator [length]="100"
[pageSize]="10"
[pageSizeOptions]="[10]">
</mat-paginator>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
</div>
</div>

36
src/app/examiner/mark-papers-index/mark-papers-index.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-14 16:30:31
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-15 08:53:09
* @LastEditTime: 2020-12-25 09:00:41
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import {HttpClient} from '@angular/common/http'
@ -36,19 +36,47 @@ export class MarkPapersIndexComponent implements OnInit {
constructor(private router: Router,private activatedRoute: ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
ngOnInit(): void {
this.getAlltabledate()
}
dataSource = ELEMENT_DATA;
dataSource
markName//试卷名称
markDate//考试日期
//分页
@ViewChild(MatPaginator, {static: true})
pageEvent: PageEvent;
paginator: MatPaginator;
length:any; //共多少条数据
pageSize:any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any //第几页
//重置功能
resert(){
this.markName=undefined
this.markDate=undefined
}
//点击阅卷跳转
markTwo(e){
markTwo(e,id){
console.log(e)
this.router.navigate(['/home/mark-papers-index/mark-papers-two'],{queryParams:{'level':e}})
this.router.navigate(['/home/mark-papers-index/mark-papers-two'],{queryParams:{'level':e,'id':id}})
}
//获取表格信息
getAlltabledate(){
let paramsdata:any = {
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
Sort: null,
SortType: null,
}
this.http.get("/api/Papers",{params:paramsdata}).subscribe((data:any)=>{
this.dataSource=data.items
this.length=data.totalCount
console.log(this.dataSource)
})
}
//分页事件
chagePage(e){
this.PageNumber = e.pageIndex+1
this.getAlltabledate()
}
}

19
src/app/examiner/mark-papers-two/mark-papers-two.component.html

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-14 17:21:02
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-15 09:21:32
* @LastEditTime: 2020-12-25 11:26:01
-->
<div class="content">
<div class="header">
@ -30,10 +30,10 @@
<tbody>
<tr *ngFor="let item of dataSource">
<td>{{item.name}}</td>
<td>{{item.organization}}</td>
<td>{{item.startTime}}</td>
<td [ngClass]="{'green': item.testState == '已阅卷','red':item.testState == '未阅卷'}">{{item.testState}}</td>
<td>{{item.mark}}</td>
<td>广西总队</td>
<td>{{item.endTime|date:'yyyy-MM-dd HH:mm'}}</td>
<td [ngClass]="{'green': item.isMarked == true,'red':item.isMarked == false}">{{item.isMarked== true?"已阅卷":"未阅卷"}}</td>
<td>90</td>
<td >
<span style="color: #01CFD5;">阅卷</span>
</td>
@ -41,10 +41,11 @@
</tbody>
</table>
<mat-paginator [length]="100"
[pageSize]="10"
[pageSizeOptions]="[10]">
</mat-paginator>
<mat-paginator [length]="length"
[pageSize]="pageSize"
[pageSizeOptions]="pageSizeOptions"
(page)="chagePage($event)">
</mat-paginator>
</div>
</div>

40
src/app/examiner/mark-papers-two/mark-papers-two.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn
* @Date: 2020-12-14 17:21:02
* @LastEditors: sueRimn
* @LastEditTime: 2020-12-15 09:16:29
* @LastEditTime: 2020-12-25 09:15:42
*/
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import {HttpClient} from '@angular/common/http'
@ -19,11 +19,6 @@ const ELEMENT_DATA = [
{name: "张三三", organization: '浦东支队', startTime: "2020-09-19 10:00", mark: '120',testState:'未阅卷'},
{name: "提亚马特", organization: '黄埔支队', startTime: "2020-09-19 10:00", mark: '100',testState:'已阅卷'},
{name: "艾泽拉斯", organization: '徐汇支队', startTime: "2020-09-19 10:00", mark: '90',testState:'已阅卷'},
/* {name: "", organization: '', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:''},
{name: "立新加油站", organization: '浦东支队', startTime: "2020-09-19 10:00", overTime: '2020-09-19 12:00',testState:'开考中'},
{name: "富华酒店", organization: '宝山支队', startTime: "2020-07-19 10:00", overTime: '2020-07-19 12:00',testState:'已结束'},
{name: "裕达国际酒店", organization: '浦东支队', startTime: "2020-08-19 10:00", overTime: '2020-08-19 12:00',testState:'已结束'},
{name: "锦德大酒店", organization: '长宁支队', startTime: "2019-09-19 10:00", overTime: '2019-09-19 12:00',testState:'已结束'}, */
];
@Component({
@ -38,12 +33,43 @@ export class MarkPapersTwoComponent implements OnInit {
ngOnInit(): void {
this.activatedRoute.queryParams.subscribe(param=>{
this.headtext=param.level
this.getid=param.id
//console.log(headName)
});
this.getAlltabledate()
}
headtext
dataSource = ELEMENT_DATA;
getid//试卷id
dataSource
markName//试卷名称
markDate//考试日期
//分页
@ViewChild(MatPaginator, {static: true})
pageEvent: PageEvent;
paginator: MatPaginator;
length:any; //共多少条数据
pageSize:any; //每页条数
pageSizeOptions: number[] = [10] //设置每页条数
PageNumber:any //第几页
//获取表格信息
getAlltabledate(){
let paramsdata:any = {
PaperId:this.getid,
PageNumber: this.PageNumber || '1',
PageSize: this.pageSizeOptions[0],
Sort: null,
SortType: null,
}
this.http.get("/api/Examinations",{params:paramsdata}).subscribe((data:any)=>{
this.dataSource=data.items
this.length=data.totalCount
console.log(this.dataSource)
})
}
//分页事件
chagePage(e){
this.PageNumber = e.pageIndex+1
this.getAlltabledate()
}
}

Loading…
Cancel
Save