diff --git a/src/app/student/examination-details/examination-details.component.html b/src/app/student/examination-details/examination-details.component.html index 5431c31..aa1ab18 100644 --- a/src/app/student/examination-details/examination-details.component.html +++ b/src/app/student/examination-details/examination-details.component.html @@ -1 +1,13 @@ -

11111123

+
+
+
+ +
+
单位列表
总分:
+
单位名称
总分
+
单位名称
总分
+
+
+ +
+
diff --git a/src/app/student/examination-details/examination-details.component.scss b/src/app/student/examination-details/examination-details.component.scss index e69de29..a23667a 100644 --- a/src/app/student/examination-details/examination-details.component.scss +++ b/src/app/student/examination-details/examination-details.component.scss @@ -0,0 +1,43 @@ +.content{ + width: 100%; + height: 100%; + overflow: hidden; + display: flex; + flex-direction: column; + box-sizing: border-box; + .cneter { + flex: 1; + overflow: hidden; + background-color: #F2F5F6; + display: flex; + box-sizing: border-box; + padding: 25px; + >div { background-color: #fff; border-radius: 10px; } + .left { + flex: 20%; + margin-right: 25px; + } + .right { + flex: 80%; + } + } +} + +//左侧 +.headerLeft{ + display: flex; + align-items: center; + >div {flex: 1;} + height: 36px; + padding: 0 25px; +} +.centerLeft { + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + >div {flex: 1; overflow: hidden; text-align: center;} + height: 36px; + padding: 0 25px; + margin: 0 30px; +} \ No newline at end of file diff --git a/src/app/student/examination-details/examination-details.component.ts b/src/app/student/examination-details/examination-details.component.ts index 4597353..5effe16 100644 --- a/src/app/student/examination-details/examination-details.component.ts +++ b/src/app/student/examination-details/examination-details.component.ts @@ -1,4 +1,8 @@ +import { HttpClient } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; +import { MatDialog } from '@angular/material/dialog'; +import { MatSnackBar } from '@angular/material/snack-bar'; +import { ActivatedRoute } from '@angular/router'; @Component({ selector: 'app-examination-details', @@ -7,9 +11,18 @@ import { Component, OnInit } from '@angular/core'; }) export class ExaminationDetailsComponent implements OnInit { - constructor() { } + constructor(public http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public route:ActivatedRoute) { } ngOnInit(): void { + this.getTestInfo() + } + + //获取考卷 + getTestInfo () { + let id = this.route.snapshot.queryParams.paperId + this.http.get(`/api/Papers/${id}`).subscribe((data:any)=>{ + console.log(data) + }) } } diff --git a/src/app/student/student-index/student-index.component.ts b/src/app/student/student-index/student-index.component.ts index 2292bc2..9d3ef14 100644 --- a/src/app/student/student-index/student-index.component.ts +++ b/src/app/student/student-index/student-index.component.ts @@ -92,6 +92,12 @@ export class StudentIndexComponent implements OnInit { //参加考试 takeTest (e) { - window.open(`/examinationDetails?testId=${e.id}`) + let body = { + name: e.title, + paperId: e.id, + } + this.http.post('/api/Examinations',body).subscribe((data:any)=>{ + window.open(`/examinationDetails?paperId=${e.id}&examId=${data.id}`) + }) } }