|
|
|
@ -6,96 +6,161 @@
|
|
|
|
|
* @LastEditors: sueRimn |
|
|
|
|
* @LastEditTime: 2021-01-04 16:53:04 |
|
|
|
|
*/ |
|
|
|
|
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 { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
|
|
|
import {FormControl} from '@angular/forms'; |
|
|
|
|
import { Router,ActivatedRoute } from '@angular/router'; |
|
|
|
|
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 { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar"; |
|
|
|
|
import { FormControl } from "@angular/forms"; |
|
|
|
|
import { Router, ActivatedRoute } from "@angular/router"; |
|
|
|
|
const ELEMENT_DATA = [ |
|
|
|
|
{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-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-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:'已结束'}, |
|
|
|
|
{ |
|
|
|
|
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-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-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({ |
|
|
|
|
selector: 'app-mark-papers-index', |
|
|
|
|
templateUrl: './mark-papers-index.component.html', |
|
|
|
|
styleUrls: ['./mark-papers-index.component.scss'] |
|
|
|
|
selector: "app-mark-papers-index", |
|
|
|
|
templateUrl: "./mark-papers-index.component.html", |
|
|
|
|
styleUrls: ["./mark-papers-index.component.scss"], |
|
|
|
|
}) |
|
|
|
|
export class MarkPapersIndexComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
constructor(private router: Router,private activatedRoute: ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { } |
|
|
|
|
constructor( |
|
|
|
|
private router: Router, |
|
|
|
|
private activatedRoute: ActivatedRoute, |
|
|
|
|
public http: HttpClient, |
|
|
|
|
public dialog: MatDialog, |
|
|
|
|
public snackBar: MatSnackBar |
|
|
|
|
) {} |
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.getAlltabledate() |
|
|
|
|
this.getAlltabledate(); |
|
|
|
|
} |
|
|
|
|
dataSource
|
|
|
|
|
markName//试卷名称
|
|
|
|
|
markDate//考试日期
|
|
|
|
|
dataSource; |
|
|
|
|
markName; //试卷名称
|
|
|
|
|
markDate; //考试日期
|
|
|
|
|
//分页
|
|
|
|
|
@ViewChild(MatPaginator, { static: true }) |
|
|
|
|
pageEvent: PageEvent; |
|
|
|
|
paginator: MatPaginator; |
|
|
|
|
length: any; //共多少条数据
|
|
|
|
|
pageSize: any; //每页条数
|
|
|
|
|
pageSizeOptions: number[] = [10] //设置每页条数
|
|
|
|
|
PageNumber:any //第几页
|
|
|
|
|
pageSizeOptions: number[] = [10]; //设置每页条数
|
|
|
|
|
PageNumber: any; //第几页
|
|
|
|
|
//查询
|
|
|
|
|
findClick() { |
|
|
|
|
let paramsdata: any = { |
|
|
|
|
PageNumber: this.PageNumber || '1', |
|
|
|
|
PageNumber: this.PageNumber || "1", |
|
|
|
|
PageSize: this.pageSizeOptions[0], |
|
|
|
|
Title:this.markName||'', |
|
|
|
|
StartTime:this.markDate||'', |
|
|
|
|
Title: this.markName || "", |
|
|
|
|
StartTime: this.markDate || "", |
|
|
|
|
Sort: null, |
|
|
|
|
SortType: null, |
|
|
|
|
} |
|
|
|
|
this.http.get(`/api/Papers`,{params:paramsdata}).subscribe((data:any)=>{ |
|
|
|
|
console.log(data) |
|
|
|
|
this.dataSource=data.items |
|
|
|
|
}) |
|
|
|
|
this.PageNumber = 1 |
|
|
|
|
this.pageEvent.pageIndex = 0 |
|
|
|
|
}; |
|
|
|
|
this.http |
|
|
|
|
.get(`/api/Papers`, { params: paramsdata }) |
|
|
|
|
.subscribe((data: any) => { |
|
|
|
|
console.log(data); |
|
|
|
|
this.dataSource = data.items; |
|
|
|
|
}); |
|
|
|
|
this.PageNumber = 1; |
|
|
|
|
this.pageEvent.pageIndex = 0; |
|
|
|
|
//this.getAlltabledate()
|
|
|
|
|
} |
|
|
|
|
//重置功能
|
|
|
|
|
resert() { |
|
|
|
|
this.markName='' |
|
|
|
|
this.markDate='' |
|
|
|
|
this.getAlltabledate() |
|
|
|
|
this.markName = ""; |
|
|
|
|
this.markDate = ""; |
|
|
|
|
this.getAlltabledate(); |
|
|
|
|
} |
|
|
|
|
//点击阅卷跳转
|
|
|
|
|
markTwo(e, id, name) { |
|
|
|
|
console.log(e) |
|
|
|
|
this.router.navigate(['/home/mark-papers-index/mark-papers-two'],{queryParams:{'level':e,'id':id,'name':name}}) |
|
|
|
|
console.log(e); |
|
|
|
|
this.router.navigate(["/home/mark-papers-index/mark-papers-two"], { |
|
|
|
|
queryParams: { level: e, id: id, name: name }, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
//获取表格信息
|
|
|
|
|
getAlltabledate() { |
|
|
|
|
let paramsdata: any = { |
|
|
|
|
PageNumber: this.PageNumber || '1', |
|
|
|
|
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) |
|
|
|
|
}) |
|
|
|
|
}; |
|
|
|
|
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() |
|
|
|
|
this.PageNumber = e.pageIndex + 1; |
|
|
|
|
this.getAlltabledate(); |
|
|
|
|
} |
|
|
|
|
look(item) { |
|
|
|
|
console.log(item); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|