From 76accea93ff117e6b7d3ad9c82e2c05c04e66ca4 Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Thu, 7 Jan 2021 15:26:25 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E8=80=83=E5=AE=98?= =?UTF-8?q?=E9=98=85=E5=8D=B7=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-test-score.component.ts | 1 - .../review-files/review-files.component.html | 10 +++++----- .../review-files/review-files.component.ts | 20 ++++++++++++------- .../examination-details.component.html | 10 +++++----- .../examination-details.component.ts | 3 +-- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/app/examiner/create-test-score/create-test-score.component.ts b/src/app/examiner/create-test-score/create-test-score.component.ts index e3b89fb..2ebe169 100644 --- a/src/app/examiner/create-test-score/create-test-score.component.ts +++ b/src/app/examiner/create-test-score/create-test-score.component.ts @@ -1187,7 +1187,6 @@ export class CreateTestScoreComponent implements OnInit { //将筛选出来的数据变为服务器提交数据 let paperDataInfo = [] - console.log(111,copyDatas) copyDatas.forEach((item,key) =>{ paperDataInfo[key] = {} paperDataInfo[key].id = null diff --git a/src/app/examiner/review-files/review-files.component.html b/src/app/examiner/review-files/review-files.component.html index 5088e43..bf9b93e 100644 --- a/src/app/examiner/review-files/review-files.component.html +++ b/src/app/examiner/review-files/review-files.component.html @@ -32,7 +32,7 @@ <mat-expansion-panel *ngIf="selectPaper.basicInfoData && selectPaper.basicInfoData.length"> <mat-expansion-panel-header class="panelHeader"> <label class="mariginRight">基本信息</label> - <label>总分: <label class="mark"> {{selectPaper.basicInfoScore}}</label>分, </label><label>单项<label class="mark"></label>分</label> + <label>总分: <label class="mark"> {{selectPaper.basicInfoScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.basicInfoItemScore}}</label>分</label> <button class="headerButton" *ngIf="selectPaper.basicInfoScore == selectPaper.basicInfoTotalPoints">全部正确</button> </mat-expansion-panel-header> <div class="publicTest" *ngFor="let item of selectPaper.basicInfoData;let itemkey = index"> @@ -68,7 +68,7 @@ <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> + <label>总分: <label class="mark"> {{selectPaper.adjoinScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.adjoinItemScore}}</label>分</label> <button class="headerButton" *ngIf="selectPaper.adjoinScore == selectPaper.adjoinTotalPoints">全部正确</button> </mat-expansion-panel-header> <div class="publicTest" *ngFor="let item of selectPaper.adjoinData"> @@ -87,7 +87,7 @@ <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> + <label>总分: <label class="mark"> {{selectPaper.importLocationScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.importLocationItemScore}}</label>分</label> <button class="headerButton" *ngIf="selectPaper.importLocationScore == selectPaper.importLocationTotalPoints">全部正确</button> </mat-expansion-panel-header> <div class="publicTest" *ngFor="let item of selectPaper.importLocationData"> @@ -112,7 +112,7 @@ <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> + <label>总分: <label class="mark"> {{selectPaper.functionalDivisionScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.functionalDivisionItemSocre}}</label>分</label> <button class="headerButton" *ngIf="selectPaper.functionalDivisionScore == selectPaper.functionalDivisionTotalPoints">全部正确</button> </mat-expansion-panel-header> <div class="publicTest" *ngFor="let item of selectPaper.functionalDivisionData"> @@ -137,7 +137,7 @@ <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> + <label>总分: <label class="mark"> {{selectPaper.facilityScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.facilityItemScore}}</label>分</label> <button class="headerButton" *ngIf="selectPaper.facilityScore == selectPaper.facilityTotalPoints">全部正确</button> </mat-expansion-panel-header> <div class="publicTest" *ngFor="let item of selectPaper.facilityData"> diff --git a/src/app/examiner/review-files/review-files.component.ts b/src/app/examiner/review-files/review-files.component.ts index 68c05eb..d61e769 100644 --- a/src/app/examiner/review-files/review-files.component.ts +++ b/src/app/examiner/review-files/review-files.component.ts @@ -32,12 +32,17 @@ export class ReviewFilesComponent implements OnInit { this.http.get(`/api/Examinations/${this.examId}`).subscribe((data:any)=>{ this.paperData = data this.paperId = this.paperData.paperId - this.paperData.examinationDataInfo.forEach(element => { + this.paperData.examinationDataInfo.forEach((element,index) => { element.adjoinData? element.adjoinData = JSON.parse(element.adjoinData) : null element.basicInfoData? element.basicInfoData = JSON.parse(element.basicInfoData) : null element.facilityData? element.facilityData = JSON.parse(element.facilityData) : null element.functionalDivisionData? element.functionalDivisionData = JSON.parse(element.functionalDivisionData) : null element.importLocationData? element.importLocationData = JSON.parse(element.importLocationData) : null + element.adjoinItemScore = data.paperInfo.paperDataInfo[index].adjoinItemScore //四周毗邻单项分 + element.basicInfoItemScore = data.paperInfo.paperDataInfo[index].basicInfoItemScore //基本信息单项分 + element.facilityItemScore = data.paperInfo.paperDataInfo[index].facilityItemScore //消防设施单项分 + element.functionalDivisionItemSocre = data.paperInfo.paperDataInfo[index].functionalDivisionItemSocre //功能分区单选分 + element.importLocationItemScore = data.paperInfo.paperDataInfo[index].importLocationItemScore //重点部位单项分 element.score = element.adjoinScore + element.basicInfoScore + element.facilityScore + element.functionalDivisionScore + element.importLocationScore }); this.paperCompanyData = JSON.parse( JSON.stringify(data.examinationDataInfo) ) //具体考卷 @@ -60,6 +65,7 @@ export class ReviewFilesComponent implements OnInit { await new Promise((resolve,reject)=>{ this.http.get(`/api/ExaminationPlans`,{params:params}).subscribe(data => { item.planList = data + item.planList.forEach(element => { item.planScore = item.planScore + element.paperPlanInfo.score }); if(type == false){ const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; @@ -127,7 +133,7 @@ export class ReviewFilesComponent implements OnInit { //forEach element.adjoinTotalPoints = 0 //四周毗邻 分数 element.adjoinData.forEach(item => { //四周毗邻 - item.children.forEach(items => { items.isRight? element.adjoinTotalPoints = element.adjoinTotalPoints + 1 : null }); + item.children.forEach(items => { items.isRight? element.adjoinTotalPoints = element.adjoinTotalPoints + element.adjoinItemScore : null }); }); element.basicInfoTotalPoints = 0 //基本信息总分 element.basicInfoData.forEach(item => { //基本信息 @@ -138,15 +144,15 @@ export class ReviewFilesComponent implements OnInit { indexList.forEach(ele=>{ if (itemss.data[ele.index].isRight !=undefined && itemss.data[ele.index].isRight === false) { ele.isRight = false } }) }); indexList.forEach(item=>{ - item.isRight? element.basicInfoTotalPoints = element.basicInfoTotalPoints + 1 : null + item.isRight? element.basicInfoTotalPoints = element.basicInfoTotalPoints + element.basicInfoItemScore : null }) } else { //input - item.children.forEach(items => { items.isRight? element.basicInfoTotalPoints = element.basicInfoTotalPoints + 1 : null }); + item.children.forEach(items => { items.isRight? element.basicInfoTotalPoints = element.basicInfoTotalPoints + element.basicInfoItemScore : null }); } }); element.facilityTotalPoints = 0 //消防设施总分 element.facilityData.forEach(item => { //消防设施 - item.children.forEach(items => { items.isRight? element.facilityTotalPoints = element.facilityTotalPoints + 1 : null }); + item.children.forEach(items => { items.isRight? element.facilityTotalPoints = element.facilityTotalPoints + element.facilityItemScore : null }); }); element.functionalDivisionTotalPoints = 0 //功能分区总分 element.functionalDivisionData.forEach(item => { //功能分区 @@ -157,7 +163,7 @@ export class ReviewFilesComponent implements OnInit { indexList.forEach(ele=>{ if (itemss.data[ele.index].isRight !=undefined && itemss.data[ele.index].isRight === false) { ele.isRight = false } }) }); indexList.forEach(item=>{ - item.isRight? element.functionalDivisionTotalPoints = element.functionalDivisionTotalPoints + 1 : null + item.isRight? element.functionalDivisionTotalPoints = element.functionalDivisionTotalPoints + element.functionalDivisionItemSocre : null }) } }); @@ -170,7 +176,7 @@ export class ReviewFilesComponent implements OnInit { indexList.forEach(ele=>{ if (itemss.data[ele.index].isRight !=undefined && itemss.data[ele.index].isRight === false) { ele.isRight = false } }) }); indexList.forEach(item=>{ - item.isRight? element.importLocationTotalPoints = element.importLocationTotalPoints + 1 : null + item.isRight? element.importLocationTotalPoints = element.importLocationTotalPoints + element.importLocationItemScore : null }) } }); diff --git a/src/app/student/examination-details/examination-details.component.html b/src/app/student/examination-details/examination-details.component.html index a758c9a..b93a2d2 100644 --- a/src/app/student/examination-details/examination-details.component.html +++ b/src/app/student/examination-details/examination-details.component.html @@ -30,7 +30,7 @@ <mat-expansion-panel *ngIf="selectPaper.basicInfoData && selectPaper.basicInfoData.length"> <mat-expansion-panel-header class="panelHeader"> <label class="mariginRight">基本信息</label> - <label>总分: <label class="mark"> {{selectPaper.basicInfoScore}}</label>分, </label><label>单项<label class="mark"></label>分</label> + <label>总分: <label class="mark"> {{selectPaper.basicInfoScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.basicInfoItemScore}}</label>分</label> </mat-expansion-panel-header> <div class="publicTest" *ngFor="let item of selectPaper.basicInfoData;let itemkey = index"> <div class="publicTitle">{{item.name}}</div> @@ -55,7 +55,7 @@ <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> + <label>总分: <label class="mark"> {{selectPaper.adjoinScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.adjoinItemScore}}</label>分</label> </mat-expansion-panel-header> <div class="publicTest" *ngFor="let item of selectPaper.adjoinData"> <div class="publicTitle">{{item.name}}</div> @@ -67,7 +67,7 @@ <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> + <label>总分: <label class="mark"> {{selectPaper.importLocationScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.importLocationItemScore}}</label>分</label> </mat-expansion-panel-header> <div class="publicTest" *ngFor="let item of selectPaper.importLocationData"> <div class="publicTitle">{{item.name}}</div> @@ -87,7 +87,7 @@ <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> + <label>总分: <label class="mark"> {{selectPaper.functionalDivisionScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.functionalDivisionItemSocre}}</label>分</label> </mat-expansion-panel-header> <div class="publicTest" *ngFor="let item of selectPaper.functionalDivisionData"> <div class="publicTitle">{{item.name}}</div> @@ -107,7 +107,7 @@ <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> + <label>总分: <label class="mark"> {{selectPaper.facilityScore}}</label>分, </label><label>单项<label class="mark"> {{selectPaper.facilityItemScore}}</label>分</label> </mat-expansion-panel-header> <div class="publicTest" *ngFor="let item of selectPaper.facilityData"> <div class="publicTitle">{{item.name}}</div> diff --git a/src/app/student/examination-details/examination-details.component.ts b/src/app/student/examination-details/examination-details.component.ts index f79eaf6..2c3c79a 100644 --- a/src/app/student/examination-details/examination-details.component.ts +++ b/src/app/student/examination-details/examination-details.component.ts @@ -97,14 +97,13 @@ export class ExaminationDetailsComponent implements OnInit { async getUnitPlans(){ for (let index = 0; index < this.paperCompanyData.length; index++) { const item = this.paperCompanyData[index]; - console.log(888,item) + item.planList = [] let params = { paperId : item.paperId, companyId : item.companyInfo.id } await new Promise((resolve,reject)=>{ this.http.get(`/api/PaperPlans`,{params:params}).subscribe(data => { - item.planList = [] item.planList = data resolve(1) })