|
|
|
@ -146,7 +146,7 @@ |
|
|
|
|
<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 == 1) || (scope.row.status == 2 && scope.row.stuState == 2 && scope.row.reportId == null)" |
|
|
|
|
<el-button v-if="(scope.row.status == 2 && scope.row.stuState == 1) || (scope.row.status == 2 && scope.row.stuState == 2 && !scope.row.reportId)" |
|
|
|
|
type="text" |
|
|
|
|
disabled> |
|
|
|
|
未提交 |
|
|
|
@ -270,8 +270,6 @@ export default { |
|
|
|
|
assessmentId: '', |
|
|
|
|
classId: '', |
|
|
|
|
stopTime: '', |
|
|
|
|
sss: 1, |
|
|
|
|
datassdata: 0, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
@ -313,7 +311,6 @@ export default { |
|
|
|
|
|
|
|
|
|
// 页面离开的时候销毁手机和邮箱验证码定时器 |
|
|
|
|
this.$once("hook:beforeDestroy", function () { |
|
|
|
|
this.sss = 0 |
|
|
|
|
clearInterval(this.ticker); |
|
|
|
|
this.ticker = null; |
|
|
|
|
}); |
|
|
|
@ -322,11 +319,11 @@ export default { |
|
|
|
|
this.getClassData(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
timeFilter (countDown) { |
|
|
|
|
if (countDown.countDown > 0) { |
|
|
|
|
let h = Math.floor(countDown.countDown / (60 * 60)); |
|
|
|
|
let m = Math.floor(countDown.countDown % (60 * 60) / 60); |
|
|
|
|
let s = Math.floor(countDown.countDown % (60 * 60) % 60); |
|
|
|
|
timeFilter (row) { |
|
|
|
|
if (row.countDown > 0) { |
|
|
|
|
let h = Math.floor(row.countDown / (60 * 60)); |
|
|
|
|
let m = Math.floor(row.countDown % (60 * 60) / 60); |
|
|
|
|
let s = Math.floor(row.countDown % (60 * 60) % 60); |
|
|
|
|
return `${h > 9 ? h : `0${h}`}:${m > 9 ? m : `0${m}`}:${s > 9 ? s : `0${s}`}`; |
|
|
|
|
} else { |
|
|
|
|
return "00:00:00"; |
|
|
|
@ -335,35 +332,24 @@ export default { |
|
|
|
|
beginTimer () { |
|
|
|
|
clearInterval(this.ticker) |
|
|
|
|
this.ticker = setInterval(() => { |
|
|
|
|
if (this.sss == 0) { |
|
|
|
|
this.ticker = null; |
|
|
|
|
clearInterval(this.ticker); |
|
|
|
|
} else { |
|
|
|
|
for (let i = 0; i < this.listData.length; i++) { |
|
|
|
|
const item = this.listData[i]; |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
for (let i = 0; i < this.listData.length; i++) { |
|
|
|
|
const item = this.listData[i]; |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.$set(this.listData, i, item); |
|
|
|
|
} |
|
|
|
|
}, 1000); |
|
|
|
|
}, |
|
|
|
|
getData () { |
|
|
|
|
this.listLoading = true; |
|
|
|
|
this.sss = 0 |
|
|
|
|
this.listData.splice(0); |
|
|
|
|
if (this.ticker) { |
|
|
|
|
clearInterval(this.ticker); |
|
|
|
|
} |
|
|
|
|
let data = { |
|
|
|
|
...this.form, |
|
|
|
|
pageNum: this.page, |
|
|
|
@ -371,47 +357,39 @@ export default { |
|
|
|
|
}; |
|
|
|
|
this.$post(this.api.pageStuAssessment, data).then(res => { |
|
|
|
|
this.listData = res.list; |
|
|
|
|
for (var i = 0; i < this.listData.length; i++) { |
|
|
|
|
if (this.listData[i].reportId == undefined) { |
|
|
|
|
this.listData[i].reportId = null |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.totals = res.total; |
|
|
|
|
this.listData.forEach(i => { |
|
|
|
|
let countDown = 0 |
|
|
|
|
if (i.status == 2) { // 已结束 |
|
|
|
|
i.countDown = 0; |
|
|
|
|
countDown = 0; |
|
|
|
|
} else { |
|
|
|
|
if (i.type == 2) { // 定时发布 |
|
|
|
|
if (i.status == 0) { |
|
|
|
|
// 待开始 |
|
|
|
|
i.countDown = (new Date(i.startTime).getTime() - new Date().getTime()) / 1000; // 获得两个日期时间的秒数差 |
|
|
|
|
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; |
|
|
|
|
countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; |
|
|
|
|
} |
|
|
|
|
} else if (i.type == 1) { // 手动发布 |
|
|
|
|
if (i.status == 0) { |
|
|
|
|
// 待开始 |
|
|
|
|
i.countDown = 0; |
|
|
|
|
countDown = 0; |
|
|
|
|
} else if (i.status == 1) { |
|
|
|
|
// 进行中 |
|
|
|
|
i.countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; |
|
|
|
|
countDown = (new Date(i.stopTime).getTime() - new Date().getTime()) / 1000; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.$set(i, 'countDown', countDown) |
|
|
|
|
}); |
|
|
|
|
this.sss = 1; |
|
|
|
|
// if(this.datassdata == 0){ |
|
|
|
|
// this.datassdata = this.datassdata+1 |
|
|
|
|
this.beginTimer() |
|
|
|
|
// } |
|
|
|
|
this.listLoading = false; |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.listLoading = false; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
initData () { |
|
|
|
|
this.sss = 0 |
|
|
|
|
this.page = 1; |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
@ -429,7 +407,6 @@ export default { |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange (val) { // 切换页码 |
|
|
|
|
this.page = val; |
|
|
|
|
this.sss = 0 |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
entry (row) { // 进入考核 |
|
|
|
|