|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
* @Author: sueRimn |
|
|
|
|
* @Date: 2020-12-11 09:06:03 |
|
|
|
|
* @LastEditors: sueRimn |
|
|
|
|
* @LastEditTime: 2021-02-23 17:04:01 |
|
|
|
|
* @LastEditTime: 2021-02-24 15:37:32 |
|
|
|
|
*/ |
|
|
|
|
import { Component, OnInit, ViewChild, Inject,Input } from '@angular/core'; |
|
|
|
|
import {HttpClient} from '@angular/common/http' |
|
|
|
@ -430,6 +430,7 @@ export class editorsDia{
|
|
|
|
|
this.startTime=this.datas.startTime.split("+")[0] |
|
|
|
|
this.endTime=this.datas.endTime.split("+")[0] |
|
|
|
|
this.examName=this.datas.title |
|
|
|
|
console.log(this.datas) |
|
|
|
|
} |
|
|
|
|
//获取登录账号的个人资料
|
|
|
|
|
Profiles:any
|
|
|
|
@ -463,15 +464,41 @@ export class editorsDia{
|
|
|
|
|
endTime:this.endTime, |
|
|
|
|
title:this.examName |
|
|
|
|
} |
|
|
|
|
let params = { |
|
|
|
|
id: null, |
|
|
|
|
title: this.examName, |
|
|
|
|
duration: this.datas.duration, |
|
|
|
|
modifiedTime: new Date(), |
|
|
|
|
deleted: false, |
|
|
|
|
startTime: this.startTime, |
|
|
|
|
endTime: this.endTime, |
|
|
|
|
organizationId: this.datas.organizationId, |
|
|
|
|
creatorId: this.datas.creatorId, |
|
|
|
|
paperDataInfo: null |
|
|
|
|
} |
|
|
|
|
this.http.put(`/api/Papers/${this.datas.id}`,body).subscribe(data => { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('修改名称时间成功','确定',config); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
sessionStorage.setItem("paperId",this.datas.id) |
|
|
|
|
//this.router.navigateByUrl("/examiner/create-test-score?pattern=edit")
|
|
|
|
|
this.router.navigateByUrl("/createexam-index/examiner-new-one?pattern=edit") |
|
|
|
|
this.http.get(`/api/Papers/${this.datas.id}`).subscribe((data:any) => { |
|
|
|
|
if(data.paperDataInfo.length==0){ |
|
|
|
|
this.http.delete(`/api/Papers/${this.datas.id}`).subscribe((data:any) => { |
|
|
|
|
}) |
|
|
|
|
this.http.post('/api/Papers',params).subscribe(data => { |
|
|
|
|
//sessionStorage.removeItem("checkedWork")
|
|
|
|
|
sessionStorage.setItem("paperId",this.datas.id) |
|
|
|
|
this.router.navigate(['/home/createexam-index/examiner-new-one']) //跳转试卷列表页面
|
|
|
|
|
},err => { |
|
|
|
|
this.snackBar.open(err,'确定',config); |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
sessionStorage.setItem("paperId",this.datas.id) |
|
|
|
|
this.router.navigateByUrl("/examiner/create-test-score?pattern=edit") |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
}, 1000); |
|
|
|
|
}) |
|
|
|
|