邵佳豪
4 years ago
7 changed files with 225 additions and 9 deletions
@ -1 +1,54 @@
|
||||
<p>创建考试</p> |
||||
<div class="box"> |
||||
<div class="createBtn"> |
||||
<button mat-raised-button color="primary" (click)="createTest()">新增考题</button> |
||||
</div> |
||||
<div class="tablebox"> |
||||
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8"> |
||||
<ng-container matColumnDef="name"> |
||||
<th mat-header-cell *matHeaderCellDef>试卷名称</th> |
||||
<td mat-cell *matCellDef="let element">{{element.name}}</td> |
||||
</ng-container> |
||||
|
||||
<!-- Name Column --> |
||||
<ng-container matColumnDef="organization"> |
||||
<th mat-header-cell *matHeaderCellDef>考核中队</th> |
||||
<td mat-cell *matCellDef="let element">{{element.organization}}</td> |
||||
</ng-container> |
||||
|
||||
<!-- Weight Column --> |
||||
<ng-container matColumnDef="startTime"> |
||||
<th mat-header-cell *matHeaderCellDef>开考时间</th> |
||||
<td mat-cell *matCellDef="let element">{{element.startTime}}</td> |
||||
</ng-container> |
||||
|
||||
<!-- Symbol Column --> |
||||
<ng-container matColumnDef="overTime"> |
||||
<th mat-header-cell *matHeaderCellDef>结束时间</th> |
||||
<td mat-cell *matCellDef="let element">{{element.overTime}}</td> |
||||
</ng-container> |
||||
|
||||
<!-- Symbol Column --> |
||||
<ng-container matColumnDef="testState"> |
||||
<th mat-header-cell *matHeaderCellDef>考试状态</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
<i [ngClass]="{'green': element.testState == '2','red':element.testState == '3'}"> |
||||
{{element.testState | testState}} |
||||
</i> |
||||
</td> |
||||
</ng-container> |
||||
|
||||
<!-- Symbol Column --> |
||||
<ng-container matColumnDef="operation"> |
||||
<th mat-header-cell *matHeaderCellDef>操作</th> |
||||
<td mat-cell *matCellDef="let element"> |
||||
<span>编辑</span> |
||||
<span>详情</span> |
||||
<span [ngClass]="{'grey': element.testState == '2' || element.testState == '3'}">删除</span> |
||||
</td> |
||||
</ng-container> |
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> |
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> |
||||
</table> |
||||
<mat-paginator [pageSize]="10"></mat-paginator> |
||||
</div> |
||||
</div> |
@ -0,0 +1,52 @@
|
||||
.box{ |
||||
width:100%; |
||||
height: 100%; |
||||
margin: 0 auto; |
||||
.createBtn{ |
||||
height: 60px; |
||||
line-height: 60px; |
||||
margin-bottom: 6px; |
||||
margin-left: 20px; |
||||
} |
||||
.tablebox{ |
||||
table{ |
||||
width: 100%; |
||||
} |
||||
|
||||
} |
||||
} |
||||
.mat-header-cell{ |
||||
text-align: center; |
||||
} |
||||
.mat-cell{ |
||||
text-align: center; |
||||
span{ |
||||
color: #0000BF; |
||||
margin: 0 3px; |
||||
cursor: pointer; |
||||
} |
||||
span:hover{ |
||||
text-decoration:underline |
||||
} |
||||
.grey{ |
||||
color: grey; |
||||
pointer-events: none; |
||||
} |
||||
.green{ |
||||
color: #70b603; |
||||
} |
||||
.red{ |
||||
color: #d9001b; |
||||
} |
||||
} |
||||
|
||||
.dialog{ |
||||
.title{ |
||||
h1{ |
||||
font-size: 25px; |
||||
font-weight: 900; |
||||
text-align: center; |
||||
} |
||||
|
||||
} |
||||
} |
@ -0,0 +1,34 @@
|
||||
<div class="dialog"> |
||||
<div class="title"> |
||||
<h1>试卷新增</h1> |
||||
</div> |
||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||
|
||||
<div> |
||||
<span>试卷名称</span> |
||||
<input id="name" name="name" type='text' |
||||
required |
||||
ngModel #name="ngModel"> |
||||
</div> |
||||
|
||||
|
||||
<div> |
||||
<span>考核中队</span> |
||||
<input id="name" name="name" type='text' |
||||
required |
||||
ngModel #name="ngModel"> |
||||
</div> |
||||
<div> |
||||
<span>考试时间</span> |
||||
<!-- <nz-range-picker id="date" name="date" [nzShowTime]="true" [(ngModel)]="date" (ngModelChange)="onChange($event)"></nz-range-picker> --> |
||||
</div> |
||||
|
||||
|
||||
<div class="btn"> |
||||
<button type="submit" class="savebtn" mat-raised-button color="primary" [disabled]='form.invalid'>确定</button> |
||||
<button type="button" mat-button (click)="onNoClick()" mat-raised-button>取消</button> |
||||
</div> |
||||
|
||||
</form> |
||||
</div> |
||||
|
Loading…
Reference in new issue