|
|
|
@ -86,21 +86,24 @@ |
|
|
|
|
<span>{{ scope.row.countDown | timeFilter }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="实验状态" align="center"> |
|
|
|
|
<el-table-column label="考核状态" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span class="ellipsis">{{ status[scope.row.status] }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="实验状态" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span class="ellipsis">{{ stuState[scope.row.stuState] }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<!--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" |
|
|
|
|
<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 || scope.row.stuState === 1)" type="text" |
|
|
|
|
@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 === 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> |
|
|
|
@ -140,7 +143,7 @@ export default { |
|
|
|
|
classList: [], |
|
|
|
|
courseList: [], |
|
|
|
|
host: Setting.apiBaseURL, |
|
|
|
|
status: ["待开始", "进行中", "已完成"], |
|
|
|
|
status: ["待开始", "进行中", "已结束"], |
|
|
|
|
statusList: [{ |
|
|
|
|
name: "不限", |
|
|
|
|
value: "" |
|
|
|
@ -151,9 +154,10 @@ export default { |
|
|
|
|
name: "进行中", |
|
|
|
|
value: 1 |
|
|
|
|
}, { |
|
|
|
|
name: "已完成", |
|
|
|
|
name: "已结束", |
|
|
|
|
value: 2 |
|
|
|
|
}], |
|
|
|
|
stuState: ["未考", "在考", "已考"], |
|
|
|
|
listData: [], |
|
|
|
|
date: [], |
|
|
|
|
form: { |
|
|
|
@ -250,10 +254,16 @@ export default { |
|
|
|
|
beginTimer() { |
|
|
|
|
this.ticker = setInterval(() => { |
|
|
|
|
for (let i = 0; i < this.listData.length; i++) { |
|
|
|
|
console.log(i); |
|
|
|
|
const item = this.listData[i]; |
|
|
|
|
if (item.countDown && item.countDown > 0) { |
|
|
|
|
if (item.countDown > 0) { |
|
|
|
|
item.countDown--; |
|
|
|
|
} else { |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.$set(this.listData, i, item); |
|
|
|
|
} |
|
|
|
@ -275,12 +285,24 @@ export default { |
|
|
|
|
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; |
|
|
|
|
// console.log(1, i.countDown); |
|
|
|
|
} else if (i.status === 0) { // 待开始 |
|
|
|
|
i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; // 获得两个日期时间的秒数差 |
|
|
|
|
// console.log(0, i.countDown); |
|
|
|
|
} else { |
|
|
|
|
if (i.type === 2) { // 定时发布 |
|
|
|
|
if (i.status === 0) { |
|
|
|
|
// 待开始 |
|
|
|
|
i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; // 获得两个日期时间的秒数差 |
|
|
|
|
} 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) { |
|
|
|
|
// 待开始 |
|
|
|
|
i.countDown = 0; |
|
|
|
|
} else if (i.status === 1) { |
|
|
|
|
// 进行中 |
|
|
|
|
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
this.beginTimer(); |
|
|
|
|