|
|
|
@ -351,6 +351,7 @@ export default { |
|
|
|
|
seconds: 0, // 秒数 |
|
|
|
|
minutes: 0, // 分钟数 |
|
|
|
|
hour: 0, // 小时数 |
|
|
|
|
now: '', |
|
|
|
|
projectList: [], // 项目列表 |
|
|
|
|
pd: {}, |
|
|
|
|
experimentTarget: '', //实验目标 |
|
|
|
@ -404,6 +405,8 @@ export default { |
|
|
|
|
mavonEditor |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
this.getNow().then(now => { |
|
|
|
|
this.entryTime = now |
|
|
|
|
// 2:竞赛,1:考核,0:练习 |
|
|
|
|
this.projectPermissions = this.assessmentId ? |
|
|
|
|
1 : |
|
|
|
@ -432,6 +435,7 @@ export default { |
|
|
|
|
this.getUserDetail() |
|
|
|
|
// this.drag() |
|
|
|
|
this.tableHeight = window.innerHeight - 360 |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 获取项目列表 |
|
|
|
@ -515,8 +519,10 @@ export default { |
|
|
|
|
this.text = isPrac ? '已用' : '剩余' |
|
|
|
|
// 竞赛不需要 |
|
|
|
|
if (!this.competitionId) { |
|
|
|
|
this.countVal = isPrac ? 0 : (new Date(this.endTime).getTime() - Date.now()) / 1000 // 如果是考核,取考核的结束时间减去当前时间去做倒计时,练习则直接给0做计时 |
|
|
|
|
this.getNow().then(now => { |
|
|
|
|
this.countVal = isPrac ? 0 : (new Date(this.endTime) - now) / 1000 // 如果是考核,取考核的结束时间减去当前时间去做倒计时,练习则直接给0做计时 |
|
|
|
|
this.startCount() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
resolve() |
|
|
|
|
}).catch(err => { |
|
|
|
@ -524,6 +530,13 @@ export default { |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 获取当前时间 |
|
|
|
|
getNow () { |
|
|
|
|
return new Promise(async (resolve, reject) => { |
|
|
|
|
const res = await this.$get(this.api.getCurrentTime) |
|
|
|
|
resolve(new Date(res.currentTime)) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 关闭父页面的loading,并置加载完成状态为true |
|
|
|
|
closeLoad () { |
|
|
|
|
this.$parent.loadIns.close() |
|
|
|
@ -603,6 +616,7 @@ export default { |
|
|
|
|
const judgmentId = e.judgmentId |
|
|
|
|
promiseList.push(new Promise((resolve, reject) => { |
|
|
|
|
this.$post(this.api.getLastCache, { |
|
|
|
|
competitionId: this.competitionId, |
|
|
|
|
assessmentId: assessmentId ? Number(assessmentId) : '', |
|
|
|
|
bcId: judgmentId, |
|
|
|
|
projectId, // 项目id,同上 |
|
|
|
@ -656,6 +670,7 @@ export default { |
|
|
|
|
// 删除该项目下所有判分规则的缓存代码 |
|
|
|
|
points.map(e => { |
|
|
|
|
e.code && this.$post(this.api.delCache, { |
|
|
|
|
competitionId: this.competitionId, |
|
|
|
|
assessmentId, |
|
|
|
|
bcId: e.judgmentId, |
|
|
|
|
projectId, |
|
|
|
@ -685,20 +700,22 @@ export default { |
|
|
|
|
// 查询竞赛状态(查到竞赛如果结束后,直接提交竞赛) |
|
|
|
|
getCompetitionStatus () { |
|
|
|
|
// 未提交才需要查询状态 |
|
|
|
|
this.isSubmit || this.$post(`${this.api.getCompetition}?competitionId=${this.competitionId}`).then(({ competition }) => { |
|
|
|
|
this.isSubmit || this.$post(`${this.api.getCompetition}?competitionId=${this.competitionId}`).then(async ({ competition }) => { |
|
|
|
|
const stages = competition.competitionStage |
|
|
|
|
if (stages) { |
|
|
|
|
const stage = stages.find(e => e.stageId == this.stageId) |
|
|
|
|
const endTime = new Date(stage.endTime).getTime() |
|
|
|
|
const now = Date.now() |
|
|
|
|
const endTime = new Date(stage.endTime) |
|
|
|
|
|
|
|
|
|
const res = await this.$get(this.api.getCurrentTime) |
|
|
|
|
const now = new Date(res.currentTime) |
|
|
|
|
// 如果已经结束 |
|
|
|
|
if (now >= new Date(stage.endTime)) { |
|
|
|
|
if (now >= endTime) { |
|
|
|
|
this.$alert('竞赛时间已到,系统已自动交卷', '提示', { |
|
|
|
|
confirmButtonText: '确定' |
|
|
|
|
}) |
|
|
|
|
this.submit() |
|
|
|
|
} else { // 没结束,则显示倒计时 |
|
|
|
|
this.countVal = (endTime - Date.now()) / 1000 |
|
|
|
|
this.countVal = (endTime - now) / 1000 |
|
|
|
|
this.startCount() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -747,7 +764,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//重新开始 |
|
|
|
|
reload () { |
|
|
|
|
async reload () { |
|
|
|
|
this.reloadCount() |
|
|
|
|
this.grade = '00' |
|
|
|
|
localStorage.removeItem('codeCache') |
|
|
|
@ -764,6 +781,7 @@ export default { |
|
|
|
|
this.$emit('recoveryCode') |
|
|
|
|
this.startCount() |
|
|
|
|
this.clearReport() |
|
|
|
|
this.entryTime = await this.getNow() |
|
|
|
|
}, |
|
|
|
|
// 页面加载完后重置编辑框大小 |
|
|
|
|
ready () { |
|
|
|
@ -831,7 +849,9 @@ export default { |
|
|
|
|
}).then(({ codeId }) => { |
|
|
|
|
this.$parent.workbench[0].codeId = codeId |
|
|
|
|
this.submit() |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.submiting = false |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.submit() |
|
|
|
|
} |
|
|
|
@ -841,12 +861,12 @@ export default { |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 提交 |
|
|
|
|
submit () { |
|
|
|
|
async submit () { |
|
|
|
|
if (this.isSubmit) return false |
|
|
|
|
const pointList = this.$parent.workbench |
|
|
|
|
const date = new Date() |
|
|
|
|
const date = await this.getNow() |
|
|
|
|
const entryTime = this.entryTime |
|
|
|
|
const timeSum = Math.ceil((date.getTime() - entryTime.getTime()) / 60000) // 计算实验用时(分钟),向上取整 |
|
|
|
|
const timeSum = Math.ceil((date - entryTime) / 60000) // 计算实验用时(分钟),向上取整 |
|
|
|
|
const submitTime = util.formatDate('yyyy-MM-dd hh:mm:ss', date) |
|
|
|
|
const projectId = this.projectId |
|
|
|
|
const pro = this.projectList.find(e => e.projectId == projectId) |
|
|
|
@ -909,12 +929,16 @@ export default { |
|
|
|
|
this.editReport(reportId) |
|
|
|
|
this.submiting = false |
|
|
|
|
// 如果是竞赛,并且勾选了公布成绩详情的选项,则弹框提示 |
|
|
|
|
// this.competitionId && this.resultsDetails == 0 && this.$alert(`提交成功${this.resultAnnouncementTime != 0 ? ',成绩将在' + this.resultAnnouncementTime + '小时后发布,请去参赛信息模块查看' : ''}`, '提示', { |
|
|
|
|
// confirmButtonText: '确定', |
|
|
|
|
// callback: action => { |
|
|
|
|
// this.$parent.back() |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
if (this.competitionId) { |
|
|
|
|
this.$alert(`提交成功!${this.resultsDetails == 0 && this.resultAnnouncementTime != 0 ? '成绩将在' + this.resultAnnouncementTime + '小时后发布,请去参赛信息模块查看' : ''}`, '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
callback: action => { |
|
|
|
|
this.$parent.back() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.$message.success('提交成功!') |
|
|
|
|
} |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.submiting = false |
|
|
|
|
}) |
|
|
|
@ -1188,7 +1212,11 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/deep/.ql-editor { |
|
|
|
|
font-family: 'Microsoft Yahei'; |
|
|
|
|
font-size: 13px; |
|
|
|
|
.ql-syntax { |
|
|
|
|
font-family: 'Microsoft Yahei'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
/deep/.el-collapse-item__wrap { |
|
|
|
|
border-bottom: none; |
|
|
|
@ -1395,11 +1423,18 @@ export default { |
|
|
|
|
/deep/.v-note-wrapper { |
|
|
|
|
min-height: 0; |
|
|
|
|
height: auto; |
|
|
|
|
font-family: 'Microsoft Yahei'; |
|
|
|
|
.v-note-panel .v-note-show { |
|
|
|
|
font-family: 'Microsoft Yahei'; |
|
|
|
|
overflow: visible; |
|
|
|
|
.v-show-content { |
|
|
|
|
font-family: 'Microsoft Yahei'; |
|
|
|
|
overflow: visible; |
|
|
|
|
} |
|
|
|
|
pre, |
|
|
|
|
code { |
|
|
|
|
font-family: 'Microsoft Yahei'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |