Browse Source

[完善]阅卷预案功能完成

master
邵佳豪 4 years ago
parent
commit
dce1328e92
  1. 12
      src/app/examiner/create-test-score/create-test-score.component.ts
  2. 11
      src/app/examiner/examiner-index/examiner-index.component.ts
  3. 16
      src/app/examiner/review-files/review-files.component.html
  4. 9
      src/app/examiner/review-files/review-files.component.scss
  5. 22
      src/app/examiner/review-files/review-files.component.ts
  6. 8
      src/app/ui/collection-tools-examinee/collection-tools.component.ts
  7. 4
      src/app/ui/collection-tools-read/collection-tools.component.html
  8. 142
      src/app/ui/collection-tools-read/collection-tools.component.ts
  9. 14
      src/app/ui/collection-tools-read/score.html
  10. 10
      src/app/ui/collection-tools-read/score.scss
  11. 10
      src/app/ui/collection-tools/collection-tools.component.ts
  12. 4
      src/app/ui/ui.module.ts
  13. 2
      src/app/working-area/working-area.component.ts

12
src/app/examiner/create-test-score/create-test-score.component.ts

@ -1251,11 +1251,6 @@ export class CreateTestScoreComponent implements OnInit {
return
}
}
//设置paperPlan的分数
// console.log(123,this.unitId)
// console.log(456,paperDataInfo)
let _this = this
async function setPlansScore(){
for (let index = 0; index < _this.unitId.length; index++) {
@ -1276,8 +1271,6 @@ export class CreateTestScoreComponent implements OnInit {
}
setPlansScore().then(()=>{
console.log('修改分数成功2222')
let body = {
id:sessionStorage.getItem('paperId'),
valid: true,
@ -1287,7 +1280,10 @@ export class CreateTestScoreComponent implements OnInit {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('创建试卷成功','确定',config);
this.snackBar.open('创建试卷成功,页面将于一秒后退出','确定',config);
setTimeout(() => {
this.router.navigateByUrl('/home/createexam-index')
}, 1000);
})
})

11
src/app/examiner/examiner-index/examiner-index.component.ts

@ -126,8 +126,15 @@ export class ExaminerIndexComponent implements OnInit {
//编辑试卷
editPaper(item){
sessionStorage.setItem("paperId",item.id)
this.router.navigateByUrl("/examiner/create-test-score?pattern=edit")
if(item.status == 2){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('考试结束,不能编辑','确定',config);
}else{
sessionStorage.setItem("paperId",item.id)
this.router.navigateByUrl("/examiner/create-test-score?pattern=edit")
}
}
lookPaper(item){
sessionStorage.setItem("paperId",item.id)

16
src/app/examiner/review-files/review-files.component.html

@ -149,18 +149,22 @@
<td>操作</td>
</tr>
<tr *ngFor="let item of selectPaper.planList">
<td>{{item.title}}</td>
<td>{{item.creatorName}}</td>
<td>{{item.modifiedTime | date:'yyyy-MM-dd'}}</td>
<td>{{item.planLevel | planlevel}}</td>
<td style="color: #FF8678;">xxxx</td>
<td>已阅</td>
<td>{{item.paperPlanInfo.title}}</td>
<td>{{item.paperPlanInfo.creatorName}}</td>
<td>{{item.paperPlanInfo.modifiedTime | date:'yyyy-MM-dd'}}</td>
<td>{{item.paperPlanInfo.planLevel | planlevel}}</td>
<td style="color: #FF8678;">{{item.score || '暂未评分'}}</td>
<td>{{item.score ? '已阅' : '未阅'}}</td>
<td>
<span style="color: #07CDCF;" (click)="readExam(item)">阅卷</span>
</td>
</tr>
</table>
</div>
<div class="refresh">
<mat-icon style="margin-left: 14%;" (click)="refreshTable()">refresh</mat-icon>
<span style="font-size: 12px;">(阅卷完成后请点击此按钮刷新表格数据)</span>
</div>
</div>
<!-- 作战部署 -->
</div>

9
src/app/examiner/review-files/review-files.component.scss

@ -12,4 +12,13 @@
border-radius: 5px;
border: none;
outline: none;
}
.refresh{
width: 100%;
text-align: center;
margin-top: 12px;
mat-icon{
cursor: pointer;
}
}

22
src/app/examiner/review-files/review-files.component.ts

@ -48,24 +48,34 @@ export class ReviewFilesComponent implements OnInit {
})
}
//获得单位预案设定
async getUnitPlans(){
async getUnitPlans(type:boolean = true){
for (let index = 0; index < this.paperCompanyData.length; index++) {
const item = this.paperCompanyData[index];
let params = {
paperId : this.paperData.paperId,
examinationId : this.route.snapshot.queryParams.examId,
companyId : item.companyInfo.id
}
await new Promise((resolve,reject)=>{
this.http.get(`/api/PaperPlans`,{params:params}).subscribe(data => {
this.http.get(`/api/ExaminationPlans`,{params:params}).subscribe(data => {
console.log(111,data)
item.planList = []
item.planList = data
if(type == false){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 5000
this.snackBar.open('刷新成功','确定',config);
}
resolve(1)
})
})
}
// this.calculateScore()
}
//刷新预案设定表格
refreshTable(){
this.getUnitPlans(false)
}
//基本信息表格 是否展示当前行
rowIsShow (children,tag) {
let isShow:boolean = false
@ -99,14 +109,14 @@ export class ReviewFilesComponent implements OnInit {
//作战部署 阅卷
readExam(item){
console.log(this.selectPaper)
console.log(item)
sessionStorage.setItem('companyName',this.selectPaper.companyInfo.name)
sessionStorage.setItem('planId',item.planComponentId)
sessionStorage.setItem('planId',item.paperPlanInfo.planComponentId)
sessionStorage.setItem('buildingTypeId',this.selectPaper.companyInfo.buildingTypes[0].id)
sessionStorage.setItem('companyId',this.selectPaper.companyInfo.id)
let openType
item.examPlanType == 0 ? openType = 1 : openType = 2
window.open(`/canvasToolRead?planName=${item.title}&paperplanId=${item.id}&openType=${openType}&paperId=${this.paperId}&examId=${this.route.snapshot.queryParams.examId}&planComponentId=${item.planComponentId}`)
window.open(`/canvasToolRead?planName=${item.paperPlanInfo.title}&paperplanId=${item.paperPlanId}&openType=${openType}&paperId=${this.paperId}&examId=${this.route.snapshot.queryParams.examId}&planComponentId=${item.paperPlanInfo.planComponentId}`)
}

8
src/app/ui/collection-tools-examinee/collection-tools.component.ts

@ -601,6 +601,10 @@ export class CollectionToolsExamineeComponent implements OnInit {
}
}).subscribe(data => {
console.log('保存基本素材成功')
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存基本素材成功','确定',config);
resolve(1)
},err=>{
console.log('保存基本素材失败')
@ -617,6 +621,10 @@ export class CollectionToolsExamineeComponent implements OnInit {
}
}).subscribe(data => {
console.log('保存基本素材成功')
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('保存基本素材成功','确定',config);
resolve(1)
},err=>{
console.log('保存基本素材失败')

4
src/app/ui/collection-tools-read/collection-tools.component.html

@ -11,8 +11,8 @@
<button style="border: 1px solid #07CDCF; border-radius: 5px; margin: 0 15px;" (click)='lookAnswerDiv()'><mat-icon>visibility</mat-icon>
查看答案
</button>
<button (click)="saveSite()"><mat-icon>description</mat-icon>评分</button>
<button (click)="openUploadQuestions()"><mat-icon>open_in_browser</mat-icon>提交</button>
<button (click)="score()"><mat-icon>description</mat-icon>评分</button>
<button (click)="submitScore()"><mat-icon>open_in_browser</mat-icon>提交</button>
</div>
</div>
<!-- header头部 -->

142
src/app/ui/collection-tools-read/collection-tools.component.ts

@ -210,7 +210,6 @@ export class CollectionToolsReadComponent implements OnInit {
this.refurbishTreeData()
}
})
}
paperId:any = this.route.snapshot.queryParams.paperId
planData:any //当前考题题目
@ -262,12 +261,43 @@ export class CollectionToolsReadComponent implements OnInit {
}
//保存平面图
saveNum :any = []
async saveSite(){
score(){
let data = {score:this.planData.score}
let dialogRef = this.dialog.open(Score,{data});
}
submitScore(){
if(!sessionStorage.getItem('scoreNum')){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请先进行评分!','确定',config);
}else{
if(window.confirm('你确定要提交此阅卷结果吗?')){
let params = {
paperPlanId : this.route.snapshot.queryParams.paperplanId,
examinationId : this.route.snapshot.queryParams.examId,
score : sessionStorage.getItem('scoreNum')
}
this.http.put('/api/ExaminationPlans/ModifyScore','',{params:params}).subscribe(data => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 1000
this.snackBar.open('提交成功,页面将于一秒后关闭!','确定',config);
setTimeout(() => {
window.close()
}, 1000);
})
return true;
}else{
return false;
}
}
}
//获得所有的建筑物
getAllBuildings(){
this.http.get("/api/Buildings",{
@ -398,6 +428,7 @@ export class CollectionToolsReadComponent implements OnInit {
//点击树节点的显示隐藏icon
clickLookItem(node){
//子节点跟随父节点的islook变化
let iconVisibleArr:any = []
  if(node.origin.children && node.origin.children.length != 0){
node.origin.isLook = !node.origin.isLook
      node.origin.children.forEach(item=>{
@ -405,45 +436,23 @@ export class CollectionToolsReadComponent implements OnInit {
        if(item.children && item.children.length != 0){
          item.children.forEach(i=>{
            i.isLook = node.origin.isLook 
if(i.children && i.children.length != 0){
}else{
iconVisibleArr.push(i.Id)
}
          })
        }
        }else{
iconVisibleArr.push(item.Id)
}
      })
     }else{
  node.origin.isLook = !node.origin.isLook
iconVisibleArr.push(node.origin.Id)
}
//canvas上的素材显隐
let iconVisibleArr:any = []
console.log(this.renderData)
this.renderData.forEach(item =>{
if(item.Id && item.isLook == true){
iconVisibleArr.push(item.Id)
}else{
if(item.children && item.children.length != 0){
item.children.forEach(i => {
if(i.Id && i.isLook == true){
iconVisibleArr.push(i.Id)
}else{
if(i.children && i.children.length != 0){
i.children.forEach(element => {
if(element.Id && element.isLook == true){
iconVisibleArr.push(element.Id)
}
})
}
}
})
}
}
})
console.log(iconVisibleArr)
// this.canvasData.originaleveryStoreyData = JSON.parse(JSON.stringify(this.originaleveryStoreyData))
// this.canvasData.originaleveryStoreyData.data? this.canvasData.originaleveryStoreyData.data = JSON.parse(this.canvasData.originaleveryStoreyData.data) : this.canvasData.originaleveryStoreyData.data = {}
// this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0"
// this.canvasData.hiddenBasicInfoFacilities = iconVisibleArr
// this.canvas.onExamineeClickFloor()
this.canvas.setIconVisible(iconVisibleArr,true)
console.log(node.origin.isLook)
this.canvas.setIconVisible(iconVisibleArr, node.origin.isLook)
}
//打开消防设施考题设定
@ -1198,3 +1207,62 @@ export class CollectionToolsReadComponent implements OnInit {
}
//查看需要标记的消防设施按钮
@Component({
selector: 'score',
templateUrl: './score.html',
styleUrls: ['./score.scss',]
})
export class Score {
constructor(private http:HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<any>,
@Inject(MAT_DIALOG_DATA) public data) {}
score:any
scoreNum:any = sessionStorage.getItem('scoreNum') || ''
ngOnInit(): void {
console.log(this.data)
this.score = '请输入分数 ( 此试题满分为' + this.data.score + '分 ) '
}
isSave:boolean = false
inputNum(){
if(this.scoreNum > this.data.score){
// this.scoreNum = this.data.score
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('超出最大分值!','确定',config);
}
if(this.scoreNum < 0){
// this.scoreNum = 0
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('分数不能为负数!','确定',config);
}
}
ok(){
if(this.scoreNum > this.data.score){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('超出最大分值!','确定',config);
}
if(this.scoreNum < 0){
// this.scoreNum = 0
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('分数不能为负数!','确定',config);
}
if(this.scoreNum >= 0 && this.scoreNum < this.data.score){
sessionStorage.setItem('scoreNum',this.scoreNum)
this.dialogRef.close()
}
}
}

14
src/app/ui/collection-tools-read/score.html

@ -0,0 +1,14 @@
<div style="width: 200px;" >
<div style="text-align: center;font-weight: 550;">请为此预案答卷评分</div>
<div class="contant">
<form class="example-form">
<mat-form-field class="example-full-width">
<input name="score" matInput [placeholder]="score" type="number" (input)="inputNum()" [(ngModel)]="scoreNum">
</mat-form-field>
</form>
</div>
<div style="text-align: center;" class="btnbox">
<button mat-raised-button color="primary" style="border: none;" (click)="ok()">确定</button>
<button mat-raised-button mat-dialog-close>取消</button>
</div>
</div>

10
src/app/ui/collection-tools-read/score.scss

@ -0,0 +1,10 @@
.btnbox{
button{
margin: 0 5px;
}
}
.contant{
height: 60px;
width: 100%;
margin: 15px 0;
}

10
src/app/ui/collection-tools/collection-tools.component.ts

@ -1250,7 +1250,10 @@ export class CollectionToolsComponent implements OnInit {
this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0"
this.canvasData.originaleveryStoreyData.sitePlanId? null : this.canvasData.originaleveryStoreyData.sitePlanId = e.id || null
this.renovateTreeData()
this.canvas.onExaminerClickFloor()
// this.canvas.onExaminerClickFloor()
this.canvas.createBackground(this.canvasData.selectStorey.imageUrl, this.canvasData.selectStorey.imageAngle);
this.canvas.createFloorShape(this.canvasData.originaleveryStoreyData.data);
this.canvas.createNodeShape(this.canvasData.selectPanelPoint.Data);
// 隐藏基本信息图形
this.canvas.setNameVisible(false, 0);
})
@ -1278,7 +1281,10 @@ export class CollectionToolsComponent implements OnInit {
this.canvasData.originaleveryStoreyData.version? null : this.canvasData.originaleveryStoreyData.version = "2.0"
this.canvasData.originaleveryStoreyData.buildingAreaId? null : this.canvasData.originaleveryStoreyData.buildingAreaId = e.id || null
this.renovateTreeData()
this.canvas.onExaminerClickFloor()
// this.canvas.onExaminerClickFloor()
this.canvas.createBackground(this.canvasData.selectStorey.imageUrl, this.canvasData.selectStorey.imageAngle);
this.canvas.createFloorShape(this.canvasData.originaleveryStoreyData.data);
this.canvas.createNodeShape(this.canvasData.selectPanelPoint.Data);
// 隐藏基本信息图形
this.canvas.setNameVisible(false, 0);
})

4
src/app/ui/ui.module.ts

@ -65,10 +65,10 @@ import {TeacherManagementComponent,editTeacher,seeTeacher} from './teacherManage
import { CollectionToolsExamineeComponent } from './collection-tools-examinee/collection-tools.component';
import { examinationQuestionsExaminee, uploadDisposalNodesExaminee, uploadQuestionsExaminee } from './collection-tools-examinee/examinationQuestions';
import { saveOneDialogExaminee, saveTwoDialogExaminee } from './collection-tools-examinee/save';
import { CollectionToolsReadComponent } from './collection-tools-read/collection-tools.component';
import { CollectionToolsReadComponent, Score } from './collection-tools-read/collection-tools.component';
import { examinationQuestionsRead, uploadDisposalNodesRead, uploadQuestionsRead } from './collection-tools-read/examinationQuestions';
@NgModule({
declarations: [ChangepasswordComponent,ConfirmpswDirective, ChangeuserdataComponent,testState,CollectionToolsComponent,CreateBuilding,EditBuilding,ViewDetailss,leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeComponent,editDisposalNodeComponent,saveOneDialog,saveTwoDialog,WorkingAreaComponent,examinationQuestions,uploadQuestions,AddEnterpriserUser,EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser,AddTeacher,TeacherManagementComponent,editTeacher,seeTeacher,uploadDisposalNodes,CollectionToolsExamineeComponent,examinationQuestionsExaminee,uploadQuestionsExaminee,uploadDisposalNodesExaminee,saveOneDialogExaminee,saveTwoDialogExaminee,CollectionToolsReadComponent,examinationQuestionsRead,uploadQuestionsRead,uploadDisposalNodesRead],
declarations: [ChangepasswordComponent,ConfirmpswDirective, ChangeuserdataComponent,testState,CollectionToolsComponent,CreateBuilding,EditBuilding,ViewDetailss,leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeComponent,editDisposalNodeComponent,saveOneDialog,saveTwoDialog,WorkingAreaComponent,examinationQuestions,uploadQuestions,AddEnterpriserUser,EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser,AddTeacher,TeacherManagementComponent,editTeacher,seeTeacher,uploadDisposalNodes,CollectionToolsExamineeComponent,examinationQuestionsExaminee,uploadQuestionsExaminee,uploadDisposalNodesExaminee,saveOneDialogExaminee,saveTwoDialogExaminee,CollectionToolsReadComponent,examinationQuestionsRead,uploadQuestionsRead,uploadDisposalNodesRead,Score],
imports: [
NzDatePickerModule,
CommonModule,

2
src/app/working-area/working-area.component.ts

@ -1229,6 +1229,8 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.createNodeShape(this.canvasData.selectPanelPoint.Data);
// 隐藏图标
this.setIconVisible(this.canvasData.hiddenBasicInfoFacilities, false);
// 隐藏基本信息图形
this.setNameVisible(false, 0);
}
/**

Loading…
Cancel
Save