Browse Source

[完善] 考卷页面完善

master
陈鹏飞 4 years ago
parent
commit
9379358560
  1. 1
      src/app/app.component.ts
  2. 70
      src/app/student/examination-details/examination-details.component.html
  3. 61
      src/app/student/examination-details/examination-details.component.scss
  4. 8
      src/app/student/examination-details/examination-details.component.ts

1
src/app/app.component.ts

@ -33,6 +33,7 @@ export class AppComponent {
})
} else {
sessionStorage.clear()
localStorage.clear()
this.token.delete()
}

70
src/app/student/examination-details/examination-details.component.html

@ -1,6 +1,6 @@
<div class="content">
<div><app-tabbar></app-tabbar></div>
<div class="cneter">
<div class="center">
<div class="left">
<div class="headerLeft">
@ -24,7 +24,8 @@
<div class="centerRight">
<div class="paperCenter" *ngIf="selectPaperType == '1'">
<mat-accordion>
<mat-accordion multi>
<!-- 基本信息 -->
<mat-expansion-panel>
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">基本信息</label>
@ -32,6 +33,71 @@
</mat-expansion-panel-header>
</mat-expansion-panel>
<!-- 基本信息 -->
<!-- 四周毗邻 -->
<mat-expansion-panel *ngIf="selectPaper.adjoinData && selectPaper.adjoinData.length">
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">四周毗邻</label>
<label>总分: <label class="mark"> {{selectPaper.adjoinScore}}</label>分, </label><label>单项<label class="mark"></label></label>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.adjoinData">
<div class="publicTitle">{{item.name}}</div>
<div class="publicInput" *ngFor="let element of item.children"><label>{{element.name}}:</label><input type="text" [(ngModel)]="element.userAnswer" name="userAnswer"></div>
</div>
</mat-expansion-panel>
<!-- 四周毗邻 -->
<!-- 重点部位 -->
<mat-expansion-panel *ngIf="selectPaper.importLocationData && selectPaper.importLocationData.length">
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">重点部位</label>
<label>总分: <label class="mark"> {{selectPaper.importLocationScore}}</label>分, </label><label>单项<label class="mark"></label></label>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.importLocationData">
<div class="publicTitle">{{item.name}}</div>
<div class="publicTable">
<div class="tableRow" *ngFor="let element of item.tabledata; let key = index">
<div class="tabelHeader">{{element.propertyName}}</div>
<div class="tabelCenter" *ngFor="let elements of element.data">
<label *ngIf="key===0">{{elements.result}}</label>
<input type="text" [(ngModel)]="elements.userAnswer" name="userAnswer" *ngIf="key!=0">
</div>
</div>
</div>
</div>
</mat-expansion-panel>
<!-- 重点部位 -->
<!-- 功能分区 -->
<mat-expansion-panel *ngIf="selectPaper.functionalDivisionData && selectPaper.functionalDivisionData.length">
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">功能分区</label>
<label>总分: <label class="mark"> {{selectPaper.functionalDivisionScore}}</label>分, </label><label>单项<label class="mark"></label></label>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.functionalDivisionData">
<div class="publicTitle">{{item.name}}</div>
<div class="publicTable">
<div class="tableRow" *ngFor="let element of item.tabledata; let key = index">
<div class="tabelHeader">{{element.propertyName}}</div>
<div class="tabelCenter" *ngFor="let elements of element.data">
<label *ngIf="key===0">{{elements.result}}</label>
<input type="text" [(ngModel)]="elements.userAnswer" name="userAnswer" *ngIf="key!=0">
</div>
</div>
</div>
</div>
</mat-expansion-panel>
<!-- 功能分区 -->
<!-- 数据核验 -->
<mat-expansion-panel *ngIf="selectPaper.facilityData && selectPaper.facilityData.length">
<mat-expansion-panel-header class="panelHeader">
<label class="mariginRight">数据核验</label>
<label>总分: <label class="mark"> {{selectPaper.facilityScore}}</label>分, </label><label>单项<label class="mark"></label></label>
</mat-expansion-panel-header>
<div class="publicTest" *ngFor="let item of selectPaper.facilityData">
<div class="publicTitle">{{item.name}}</div>
<div class="publicInput" *ngFor="let element of item.children"><label>{{element.name}}:</label><input type="text" [(ngModel)]="element.userAnswer" name="userAnswer"></div>
</div>
</mat-expansion-panel>
<!-- 数据核验 -->
</mat-accordion>
</div>

61
src/app/student/examination-details/examination-details.component.scss

@ -5,7 +5,7 @@
display: flex;
flex-direction: column;
box-sizing: border-box;
.cneter {
.center {
flex: 1;
overflow: hidden;
background-color: #F2F5F6;
@ -111,4 +111,63 @@
background-color: #F5FDFE;
label { display: inline-block; }
}
}
input {
border-radius: 5px;
border: 1px solid rgb(212, 205, 205);
outline: none;
height: 30px;
padding-left: 10px;
}
//考生 具体考题 通用样式
.publicTest {
display: flex;
flex-direction: row;
flex-wrap: wrap;
padding: 0 10px;
.publicTitle {
margin-top: 10px;
width: 100%;
height: 30px;
line-height: 30px;
padding-left: 10px;
}
.publicInput {
margin: 10px;
width: 48%;
height: 36px;
line-height: 36px;
text-align: left;
overflow: hidden;
label {
display: inline-block;
width: 40%;
text-align: right;
margin-right: 10px;
}
input {
width: 50%;
}
}
.publicTable {
box-sizing: border-box;
width: 100%;
margin: 10px;
display: flex;
padding: 0 25px;
.tableRow {
flex: 1;
overflow: hidden;
.tabelHeader { background: #F5FDFE; }
>div {
width: 100%;
height: 36px;
line-height: 36px;
text-align: center;
margin: 5px;
input { width: 60%; }
}
}
}
}

8
src/app/student/examination-details/examination-details.component.ts

@ -39,7 +39,7 @@ export class ExaminationDetailsComponent implements OnInit {
this.paperCompanyData = JSON.parse( JSON.stringify(data.paperDataInfo) ) //具体考卷
this.selectPaper = this.paperCompanyData[0] || {id:null} //当前选择考卷
this.handlePaperData()
resolve()
resolve(1)
})
})
@ -77,12 +77,13 @@ export class ExaminationDetailsComponent implements OnInit {
this.http.get(`/api/PaperPlans`,{params:params}).subscribe(data => {
item.planList = []
item.planList = data
resolve()
resolve(1)
})
})
}
this.calculateScore()
}
examScore:any = 0//整个试卷的总分
//计算分数
calculateScore(){
@ -108,10 +109,9 @@ export class ExaminationDetailsComponent implements OnInit {
console.log(678,this.paperCompanyData)
}
//交卷
uploadPaper () {
console.log('交卷')
console.log(this.paperCompanyData)
}
}

Loading…
Cancel
Save