|
|
@ -81,7 +81,7 @@ |
|
|
|
<el-table-column prop="stopTime" label="结束时间" align="center"></el-table-column> |
|
|
|
<el-table-column prop="stopTime" label="结束时间" align="center"></el-table-column> |
|
|
|
<el-table-column label="倒计时" align="center"> |
|
|
|
<el-table-column label="倒计时" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!-- <span v-countdown="scope.row.surplusTime">{{ scope.row.surplusTime }}</span>--> |
|
|
|
<span>{{ scope.row.countDown | timeFilter }}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="实验状态" align="center"> |
|
|
|
<el-table-column label="实验状态" align="center"> |
|
|
@ -92,10 +92,16 @@ |
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!--status:考核状态(0、待开始 1、进行中 2、已结束); stuState:学生考试状态(0、未考 1、在考 2、已考)--> |
|
|
|
<!--status:考核状态(0、待开始 1、进行中 2、已结束); stuState:学生考试状态(0、未考 1、在考 2、已考)--> |
|
|
|
<el-button v-if="scope.row.status === 2 && scope.row.stuState === 0" type="text" disabled>未参加</el-button> |
|
|
|
<el-button v-if="scope.row.status === 2 && scope.row.stuState === 0" type="text" disabled>未参加 |
|
|
|
<el-button v-if="scope.row.status !== 2 && scope.row.stuState === 0" type="text" @click="entry(scope.row)" :disabled="scope.row.status !== 1">进入</el-button> |
|
|
|
</el-button> |
|
|
|
<el-button v-if="scope.row.status === 1 && scope.row.stuState === 2" type="text" disabled>已提交</el-button> |
|
|
|
<el-button v-if="scope.row.status !== 2 && scope.row.stuState === 0" type="text" |
|
|
|
<el-button v-if="scope.row.status === 2 && scope.row.stuState === 2" type="text" @click="show(scope.row)">查看成绩</el-button> |
|
|
|
@click="entry(scope.row)" :disabled="scope.row.status !== 1">进入 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
<el-button v-if="scope.row.status === 1 && scope.row.stuState === 2" type="text" disabled>已提交 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
<el-button v-if="scope.row.status === 2 && scope.row.stuState === 2" type="text" |
|
|
|
|
|
|
|
@click="show(scope.row)">查看成绩 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
@ -154,7 +160,7 @@ export default { |
|
|
|
endTime: "", |
|
|
|
endTime: "", |
|
|
|
status: "", |
|
|
|
status: "", |
|
|
|
systemId: "", |
|
|
|
systemId: "", |
|
|
|
classId: "", |
|
|
|
classId: "" |
|
|
|
}, |
|
|
|
}, |
|
|
|
keyword: "", |
|
|
|
keyword: "", |
|
|
|
dateList: [ |
|
|
|
dateList: [ |
|
|
@ -181,8 +187,8 @@ export default { |
|
|
|
icVisible: false, |
|
|
|
icVisible: false, |
|
|
|
invitationCode: "", |
|
|
|
invitationCode: "", |
|
|
|
searchTimer: null, |
|
|
|
searchTimer: null, |
|
|
|
timerList: [], |
|
|
|
curRow: {}, |
|
|
|
curRow: {} |
|
|
|
ticker: null // 倒计时定时器 |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
computed: { |
|
|
@ -217,71 +223,85 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
|
|
|
|
// 页面离开的时候销毁手机和邮箱验证码定时器 |
|
|
|
|
|
|
|
this.$once("hook:beforeDestroy", function() { |
|
|
|
|
|
|
|
clearInterval(this.ticker); |
|
|
|
|
|
|
|
this.ticker = null; |
|
|
|
|
|
|
|
}); |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
this.getCourseData(); |
|
|
|
this.getCourseData(); |
|
|
|
this.getClassData(); |
|
|
|
this.getClassData(); |
|
|
|
this.$once("hook:beforeDestroy", function() { |
|
|
|
|
|
|
|
this.timerList.forEach((n, k) => { |
|
|
|
|
|
|
|
clearInterval(n); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.timerList = []; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
directives: { |
|
|
|
filters: { |
|
|
|
countdown: { |
|
|
|
timeFilter(countDown) { |
|
|
|
bind: function(el, binding, vnode) { |
|
|
|
if (countDown > 0) { |
|
|
|
let that = vnode.context; |
|
|
|
let h = Math.floor(countDown / (60 * 60)); |
|
|
|
let time = binding.value; |
|
|
|
let m = Math.floor(countDown % (60 * 60) / 60); |
|
|
|
let timer = setInterval(() => { |
|
|
|
let s = Math.floor(countDown % (60 * 60) % 60); |
|
|
|
let timeList = time.split(":"); |
|
|
|
return `${h > 9 ? h : `0${h}`}:${m > 9 ? m : `0${m}`}:${s > 9 ? s : `0${s}`}`; |
|
|
|
let total = Number.parseInt(timeList[0] * 60 * 60) + Number.parseInt(timeList[1] * 60) + Number.parseInt(timeList[2]); |
|
|
|
} else { |
|
|
|
if (total > 0) { |
|
|
|
return "00:00:00"; |
|
|
|
--total; |
|
|
|
|
|
|
|
let hours = Math.floor(total / (60 * 60)); |
|
|
|
|
|
|
|
let minutes = Math.floor(total % (60 * 60) / 60); |
|
|
|
|
|
|
|
let seconds = Math.floor(total % (60 * 60) % 60); |
|
|
|
|
|
|
|
time = `${util.formateTime(hours)}:${util.formateTime(minutes)}:${util.formateTime(seconds)}`; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
clearInterval(timer); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
el.innerHTML = time; |
|
|
|
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
that.timerList.push(timer); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getCourseData () { |
|
|
|
beginTimer() { |
|
|
|
|
|
|
|
this.ticker = setInterval(() => { |
|
|
|
|
|
|
|
for (let i = 0; i < this.listData.length; i++) { |
|
|
|
|
|
|
|
const item = this.listData[i]; |
|
|
|
|
|
|
|
if (item.countDown > 0) { |
|
|
|
|
|
|
|
item.countDown = item.countDown - 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$set(this.listData, i, item); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, 1000); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getData() { |
|
|
|
|
|
|
|
if (this.ticker) { |
|
|
|
|
|
|
|
clearInterval(this.ticker); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let data = { |
|
|
|
|
|
|
|
...this.form, |
|
|
|
|
|
|
|
pageNum: this.page, |
|
|
|
|
|
|
|
pageSize: this.pageSize |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
this.$post(this.api.pageStuAssessment, data).then(res => { |
|
|
|
|
|
|
|
if (res.status === 200 && res.list && res.list.length) { |
|
|
|
|
|
|
|
this.listData = res.list; |
|
|
|
|
|
|
|
this.totals = res.total; |
|
|
|
|
|
|
|
this.listData.forEach(i => { |
|
|
|
|
|
|
|
if (i.status === 2) { // 已结束 |
|
|
|
|
|
|
|
i.countDown = 0; |
|
|
|
|
|
|
|
} else if (i.status === 1) { // 进行中 |
|
|
|
|
|
|
|
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; |
|
|
|
|
|
|
|
} else if (i.status === 0) { // 待开始 |
|
|
|
|
|
|
|
i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; // 获得两个日期时间的秒数差 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.beginTimer(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).catch(err => {}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
initData() { |
|
|
|
|
|
|
|
this.page = 1; |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getCourseData() { |
|
|
|
this.$get(this.api.getPythonSysByStuAccountId).then(res => { |
|
|
|
this.$get(this.api.getPythonSysByStuAccountId).then(res => { |
|
|
|
this.courseList = res.list; |
|
|
|
this.courseList = res.list; |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
getClassData () { |
|
|
|
getClassData() { |
|
|
|
this.$post(this.api.myClassByStudent).then(res => { |
|
|
|
this.$post(this.api.myClassByStudent).then(res => { |
|
|
|
if (res.status === 200) { |
|
|
|
if (res.status === 200) { |
|
|
|
this.classList = res.data; |
|
|
|
this.classList = res.data; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
util.errorMsg(res.message); |
|
|
|
util.errorMsg(res.message); |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(err => {}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getData() { |
|
|
|
|
|
|
|
let data = { |
|
|
|
|
|
|
|
...this.form, |
|
|
|
|
|
|
|
pageNum: this.page, |
|
|
|
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
this.$post(this.api.pageStuAssessment, data).then(res => { |
|
|
|
|
|
|
|
this.listData = res.list; |
|
|
|
|
|
|
|
this.totals = res.page.totalCount; |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
initData() { |
|
|
|
|
|
|
|
this.page = 1; |
|
|
|
|
|
|
|
this.getData(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleCurrentChange(val) { // 切换页码 |
|
|
|
handleCurrentChange(val) { // 切换页码 |
|
|
|
this.page = val; |
|
|
|
this.page = val; |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
@ -293,7 +313,7 @@ export default { |
|
|
|
return util.warningMsg("该实验已经结束"); |
|
|
|
return util.warningMsg("该实验已经结束"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.curRow = row; |
|
|
|
this.curRow = row; |
|
|
|
if (row.isCode == 1) { |
|
|
|
if (row.isCode === 0) { // 是否启用邀请码(0、未启用 1、启用) |
|
|
|
this.goSubSystem(); |
|
|
|
this.goSubSystem(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$get(this.api.checkInvitationCode, { |
|
|
|
this.$get(this.api.checkInvitationCode, { |
|
|
|