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