|
|
|
@ -86,11 +86,11 @@ |
|
|
|
|
<span class="ellipsis">{{ status[scope.row.status] }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="实验状态" align="center"> |
|
|
|
|
<template slot-scope="scope" v-if="scope.row.show"> |
|
|
|
|
<span class="ellipsis">{{ stuState[scope.row.stuState] }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<!-- <el-table-column label="实验状态" align="center">--> |
|
|
|
|
<!-- <template slot-scope="scope" v-if="scope.row.show">--> |
|
|
|
|
<!-- <span class="ellipsis">{{ stuState[scope.row.stuState] }}</span>--> |
|
|
|
|
<!-- </template>--> |
|
|
|
|
<!-- </el-table-column>--> |
|
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
|
<template slot-scope="scope" v-if="scope.row.show"> |
|
|
|
|
<!--status:考核状态(0、待开始 1、进行中 2、已结束); stuState:学生考试状态(0、未考 1、在考 2、已考)--> |
|
|
|
@ -190,7 +190,16 @@ export default { |
|
|
|
|
invitationCode: "", |
|
|
|
|
searchTimer: null, |
|
|
|
|
curRow: {}, |
|
|
|
|
ticker: null // 倒计时定时器 |
|
|
|
|
ticker: null, // 倒计时定时器 |
|
|
|
|
item:{ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
projectId:null, |
|
|
|
|
url:'', |
|
|
|
|
cid:null, |
|
|
|
|
systemId:null, |
|
|
|
|
assessmentId:'', |
|
|
|
|
classId:'', |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
@ -254,11 +263,11 @@ export default { |
|
|
|
|
if (item.countDown > 0) { |
|
|
|
|
item.countDown--; |
|
|
|
|
} else { |
|
|
|
|
if (item.status === 0 && item.type === 2) { // 待开始-定时发布 |
|
|
|
|
if (item.status == 0 && item.type == 2) { // 待开始-定时发布 |
|
|
|
|
item.status = 1; |
|
|
|
|
item.countDown = (new Date(item.stopTime).getTime() - new Date().getTime()) / 1000; |
|
|
|
|
} else if (item.status === 1) { |
|
|
|
|
item.status = 2; |
|
|
|
|
} else if (item.status == 1) { |
|
|
|
|
// item.status = 2; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
item.show = true; |
|
|
|
@ -282,22 +291,22 @@ export default { |
|
|
|
|
this.totals = res.total; |
|
|
|
|
this.listData.forEach(i => { |
|
|
|
|
i.show = false; |
|
|
|
|
if (i.status === 2) { // 已结束 |
|
|
|
|
if (i.status == 2) { // 已结束 |
|
|
|
|
i.countDown = 0; |
|
|
|
|
} else { |
|
|
|
|
if (i.type === 2) { // 定时发布 |
|
|
|
|
if (i.status === 0) { |
|
|
|
|
if (i.type == 2) { // 定时发布 |
|
|
|
|
if (i.status == 0) { |
|
|
|
|
// 待开始 |
|
|
|
|
i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; // 获得两个日期时间的秒数差 |
|
|
|
|
} else if (i.status === 1) { |
|
|
|
|
} else if (i.status == 1) { |
|
|
|
|
// 进行中 |
|
|
|
|
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; |
|
|
|
|
} |
|
|
|
|
} else if (i.type === 1) { // 手动发布 |
|
|
|
|
if (i.status === 0) { |
|
|
|
|
} else if (i.type == 1) { // 手动发布 |
|
|
|
|
if (i.status == 0) { |
|
|
|
|
// 待开始 |
|
|
|
|
i.countDown = 0; |
|
|
|
|
} else if (i.status === 1) { |
|
|
|
|
} else if (i.status == 1) { |
|
|
|
|
// 进行中 |
|
|
|
|
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; |
|
|
|
|
} |
|
|
|
@ -331,26 +340,27 @@ export default { |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
entry(row) { // 进入考核 |
|
|
|
|
if (row.status === 0) { |
|
|
|
|
this.item = row |
|
|
|
|
this.assessmentId =this.item.assessmentId |
|
|
|
|
this.classId = this.item.classId |
|
|
|
|
if (row.status == 0) { |
|
|
|
|
return util.warningMsg("该实验尚未开始"); |
|
|
|
|
} else if (row.status === 2) { |
|
|
|
|
} else if (row.status == 2) { |
|
|
|
|
return util.warningMsg("该实验已经结束"); |
|
|
|
|
} else { |
|
|
|
|
this.curRow = row; |
|
|
|
|
if (row.isCode === 0) { // 是否启用邀请码(0、未启用 1、启用) |
|
|
|
|
this.goSubSystem(); |
|
|
|
|
} else { |
|
|
|
|
this.$get(this.api.checkInvitationCode, { |
|
|
|
|
userId: this.userId, |
|
|
|
|
id: row.id |
|
|
|
|
}).then(res => { |
|
|
|
|
if (res.errmessage == "false") { |
|
|
|
|
this.icVisible = true; |
|
|
|
|
} else { |
|
|
|
|
this.goSubSystem(); |
|
|
|
|
} |
|
|
|
|
if (row.isEnableCode == 0) { // 是否启用邀请码(0、未启用 1、启用) |
|
|
|
|
this.$post(`${this.api.enterExam}?assessmentId=${row.assessmentId}&classId=${row.classId}`).then(res => { |
|
|
|
|
console.log(res) |
|
|
|
|
this.projectId = res.projectId |
|
|
|
|
this.url = res.url |
|
|
|
|
this.cid = res.info.cid |
|
|
|
|
this.systemId = res.info.systemId |
|
|
|
|
this.goSubSystem(); |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.icVisible = true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -360,14 +370,14 @@ export default { |
|
|
|
|
saveIc() { |
|
|
|
|
if (!this.invitationCode) return util.warningMsg("请输入邀请码"); |
|
|
|
|
if (!this.invitationCode || String(this.invitationCode).length < 6 || isNaN(this.invitationCode)) return util.warningMsg("请输入6位纯数字邀请码"); |
|
|
|
|
let data = { |
|
|
|
|
id: this.curRow.id, |
|
|
|
|
userId: this.userId, |
|
|
|
|
invitationCode: Number(this.invitationCode) |
|
|
|
|
}; |
|
|
|
|
this.$post(this.api.joinPractice, data).then(res => { |
|
|
|
|
this.$post(`${this.api.enterExam}?assessmentId=${this.item.assessmentId}&classId=${this.item.classId}&invitationCode=${this.invitationCode}`).then(res => { |
|
|
|
|
util.successMsg("验证成功!"); |
|
|
|
|
console.log(res) |
|
|
|
|
this.icVisible = false; |
|
|
|
|
this.projectId = res.projectId |
|
|
|
|
this.url = res.url |
|
|
|
|
this.cid = res.info.cid |
|
|
|
|
this.systemId = res.info.systemId |
|
|
|
|
setTimeout(() => { |
|
|
|
|
this.goSubSystem(); |
|
|
|
|
}, 1000); |
|
|
|
@ -382,37 +392,41 @@ export default { |
|
|
|
|
util.cookies.set("assessmentId", this.curRow.id); |
|
|
|
|
util.cookies.set("studentId", this.studentId); |
|
|
|
|
util.cookies.set("userId", this.userId); |
|
|
|
|
util.cookies.set("projectId", this.curRow.projectId); |
|
|
|
|
util.cookies.set("projectId", this.projectId); |
|
|
|
|
util.cookies.set("startTime", this.curRow.startTime); |
|
|
|
|
util.cookies.set("stopTime", this.curRow.stopTime); |
|
|
|
|
let curriculumId = this.curRow.curriculumId; |
|
|
|
|
let token = util.local.get(Setting.tokenKey); |
|
|
|
|
let href = ""; |
|
|
|
|
switch (curriculumId) { |
|
|
|
|
case 1: |
|
|
|
|
href = `${host}pyTrials/#/`; |
|
|
|
|
break; |
|
|
|
|
case 4: |
|
|
|
|
href = `${host}pyFinance/#/`; |
|
|
|
|
break; |
|
|
|
|
case 5: |
|
|
|
|
href = `${host}pyProjects/#/`; |
|
|
|
|
break; |
|
|
|
|
case 6: |
|
|
|
|
href = `${host}pyRandom/#/`; |
|
|
|
|
break; |
|
|
|
|
case 7: |
|
|
|
|
href = `${host}pyQuantification/#/`; |
|
|
|
|
break; |
|
|
|
|
case 8: |
|
|
|
|
href = `${host}pyAnalysis/#/`; |
|
|
|
|
break; |
|
|
|
|
case 9: |
|
|
|
|
href = `${host}pyDataclean/#/`; |
|
|
|
|
break; |
|
|
|
|
case 10: |
|
|
|
|
href = `${host}pyAcquisition/#/`; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
let aaa = '' |
|
|
|
|
aaa = host.slice(0,host.length-6) |
|
|
|
|
href = `${aaa}/${this.url}/#/index/list?token=${token}&cid=${this.cid}&systemId=${this.systemId}&projectId=${this.projectId}&assessmentId=${this.assessmentId}&classId=${this.classId}`; |
|
|
|
|
// switch (curriculumId) { |
|
|
|
|
// // case 1: |
|
|
|
|
// href = `${host}${this.url}/#/?projectId=${this.projectId}`; |
|
|
|
|
// break; |
|
|
|
|
// // case 4: |
|
|
|
|
// // href = `${host}pyFinance/#/?projectId=${this.projectId}`; |
|
|
|
|
// // break; |
|
|
|
|
// // case 5: |
|
|
|
|
// // href = `${host}pyProjects/#/?projectId=${this.projectId}`; |
|
|
|
|
// // break; |
|
|
|
|
// // case 6: |
|
|
|
|
// // href = `${host}pyRandom/#/?projectId=${this.projectId}`; |
|
|
|
|
// // break; |
|
|
|
|
// // case 7: |
|
|
|
|
// // href = `${host}pyQuantification/#/?projectId=${this.projectId}`; |
|
|
|
|
// // break; |
|
|
|
|
// // case 8: |
|
|
|
|
// // href = `${host}pyAnalysis/#/?projectId=${this.projectId}`; |
|
|
|
|
// // break; |
|
|
|
|
// // case 9: |
|
|
|
|
// // href = `${host}pyDataclean/#/?projectId=${this.projectId}`; |
|
|
|
|
// // break; |
|
|
|
|
// // case 10: |
|
|
|
|
// // href = `${host}pyAcquisition/#/?projectId=${this.projectId}`; |
|
|
|
|
// // break; |
|
|
|
|
// } |
|
|
|
|
if (!href) return util.errorMsg("该考核非Python考核,请选择其他考核"); |
|
|
|
|
location.href = href; |
|
|
|
|
// location.href = 'http://192.168.31.154:8080/' |
|
|
|
|