|
|
|
/*
|
|
|
|
* @Descripttion:
|
|
|
|
* @version:
|
|
|
|
* @Author: sueRimn
|
|
|
|
* @Date: 2020-12-11 09:06:03
|
|
|
|
* @LastEditors: sueRimn
|
|
|
|
* @LastEditTime: 2020-12-15 14:10:50
|
|
|
|
*/
|
|
|
|
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';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-examiner-index',
|
|
|
|
templateUrl: './examiner-index.component.html',
|
|
|
|
styleUrls: ['./examiner-index.component.scss']
|
|
|
|
})
|
|
|
|
export class ExaminerIndexComponent implements OnInit {
|
|
|
|
|
|
|
|
constructor(private router: Router,private activatedRoute: ActivatedRoute,public http: HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { }
|
|
|
|
//displayedColumns: string[] = ['name', 'organization', 'startTime', 'overTime', 'testState', 'operation'];
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
|
this.getAlltabledate()
|
|
|
|
this.getHelp()
|
|
|
|
}
|
|
|
|
|
|
|
|
displayedColumns: string[] = ['name','startTime','endTime', 'examzhong','scc'];
|
|
|
|
tabledataSource:any
|
|
|
|
accound
|
|
|
|
helpName//消防救援对名称
|
|
|
|
optionId
|
|
|
|
//分页
|
|
|
|
@ViewChild(MatPaginator, {static: true})
|
|
|
|
pageEvent: PageEvent;
|
|
|
|
paginator: MatPaginator;
|
|
|
|
length:any; //共多少条数据
|
|
|
|
pageSize:any; //每页条数
|
|
|
|
pageSizeOptions: number[] = [10] //设置每页条数
|
|
|
|
PageNumber:any //第几页
|
|
|
|
startTime:[]
|
|
|
|
endTime:[]
|
|
|
|
|
|
|
|
//获得查询支队信息
|
|
|
|
help(){
|
|
|
|
let paramsdata:any = {
|
|
|
|
PageNumber: this.PageNumber || '1',
|
|
|
|
PageSize: this.pageSizeOptions[0],
|
|
|
|
Sort: null,
|
|
|
|
SortType: null,
|
|
|
|
}
|
|
|
|
//console.log(paramsdata)
|
|
|
|
this.http.get("/api/Papers",{params:paramsdata}).subscribe((data:any)=>{
|
|
|
|
this.tabledataSource=data
|
|
|
|
console.log(this.tabledataSource)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
//分页事件
|
|
|
|
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,
|
|
|
|
}
|
|
|
|
this.http.get("/api/Papers",{params:paramsdata}).subscribe((data:any)=>{
|
|
|
|
this.tabledataSource=data.items
|
|
|
|
this.length=data.totalCount
|
|
|
|
console.log(data)
|
|
|
|
})
|
|
|
|
//console.log(this.tabledataSource)
|
|
|
|
}
|
|
|
|
//获取消防救援对信息
|
|
|
|
getHelp(){
|
|
|
|
let paramsdata:any={
|
|
|
|
Name:'',
|
|
|
|
IdentityCard:'',
|
|
|
|
Phone:'',
|
|
|
|
RealName:'',
|
|
|
|
OrganizationId:'',
|
|
|
|
PageNumber:'',
|
|
|
|
PageSize:'',
|
|
|
|
Sort:'',
|
|
|
|
RoleType:'1',
|
|
|
|
SortType:''
|
|
|
|
}
|
|
|
|
this.http.get("/api/ExamUsers",{params:paramsdata}).subscribe((data:any)=>{
|
|
|
|
console.log(data)
|
|
|
|
this.helpName=data.items
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取optionid
|
|
|
|
getoption(){
|
|
|
|
var selectIndex =document.getElementById("cars");
|
|
|
|
console.log(selectIndex)
|
|
|
|
//var activeName_value =document.getElementById("usertype").options[selectIndex].id;
|
|
|
|
}
|
|
|
|
//查询按钮
|
|
|
|
findClick(){
|
|
|
|
const config = new MatSnackBarConfig();
|
|
|
|
config.verticalPosition = 'top';
|
|
|
|
config.duration = 3000
|
|
|
|
if(this.accound==undefined){
|
|
|
|
this.snackBar.open('请输入消防救援队名称','确定',config);
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
this.http.get(`/api/Papers/${this.accound}`).subscribe((data:any)=>{
|
|
|
|
console.log(data)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
console.log(this.accound)
|
|
|
|
}
|
|
|
|
//重置按钮
|
|
|
|
Reset(){
|
|
|
|
this.accound=undefined
|
|
|
|
}
|
|
|
|
//删除一套考题
|
|
|
|
deleteExam(examid){
|
|
|
|
const config = new MatSnackBarConfig();
|
|
|
|
config.verticalPosition = 'top';
|
|
|
|
config.duration = 3000
|
|
|
|
this.http.delete(`/api/Papers/${examid}`).subscribe((data:any)=>{
|
|
|
|
this.snackBar.open('删除试卷成功','确定',config);
|
|
|
|
this.getAlltabledate()
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
//新增考题跳转
|
|
|
|
newExamination(){
|
|
|
|
this.router.navigate(['/home/examiner-new-one'])
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|