|
|
@ -86,7 +86,7 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="倒计时" align="center"> |
|
|
|
<el-table-column label="倒计时" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.countDown | timeFilter }}</span> |
|
|
|
<span>{{ timeFilter(scope.row.countDown) }}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="实验状态" align="center"> |
|
|
|
<el-table-column label="实验状态" align="center"> |
|
|
@ -186,7 +186,8 @@ export default { |
|
|
|
listData: [], // 表格数据 |
|
|
|
listData: [], // 表格数据 |
|
|
|
multipleSelection: [], // 多选 |
|
|
|
multipleSelection: [], // 多选 |
|
|
|
listLoading:false,// 列表加载 |
|
|
|
listLoading:false,// 列表加载 |
|
|
|
ticker: null // 倒计时定时器 |
|
|
|
ticker: null, // 倒计时定时器 |
|
|
|
|
|
|
|
sss:1 |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
@ -218,27 +219,20 @@ export default { |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
// 页面离开的时候销毁手机和邮箱验证码定时器 |
|
|
|
// 页面离开的时候销毁手机和邮箱验证码定时器 |
|
|
|
this.$once("hook:beforeDestroy", function() { |
|
|
|
this.$once("hook:beforeDestroy", function() { |
|
|
|
clearInterval(this.ticker); |
|
|
|
this.sss = 0 |
|
|
|
this.ticker = null; |
|
|
|
// clearInterval(this.ticker); |
|
|
|
|
|
|
|
// this.ticker = null; |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
this.getschoolCourse(); |
|
|
|
this.getschoolCourse(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
filters: { |
|
|
|
|
|
|
|
timeFilter(countDown) { |
|
|
|
|
|
|
|
if (countDown > 0) { |
|
|
|
|
|
|
|
let h = Math.floor(countDown / (60 * 60)); |
|
|
|
|
|
|
|
let m = Math.floor(countDown % (60 * 60) / 60); |
|
|
|
|
|
|
|
let s = Math.floor(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"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
beginTimer() { |
|
|
|
beginTimer() { |
|
|
|
this.ticker = setInterval(() => { |
|
|
|
this.ticker = setInterval(() => { |
|
|
|
|
|
|
|
if(this.sss == 0){ |
|
|
|
|
|
|
|
this.ticker = null; |
|
|
|
|
|
|
|
clearInterval(this.ticker); |
|
|
|
|
|
|
|
}else{ |
|
|
|
for (let i = 0; i < this.listData.length; i++) { |
|
|
|
for (let i = 0; i < this.listData.length; i++) { |
|
|
|
const item = this.listData[i]; |
|
|
|
const item = this.listData[i]; |
|
|
|
if (item.countDown > 0) { |
|
|
|
if (item.countDown > 0) { |
|
|
@ -255,14 +249,23 @@ export default { |
|
|
|
item.show = true; |
|
|
|
item.show = true; |
|
|
|
this.$set(this.listData, i, item); |
|
|
|
this.$set(this.listData, i, item); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, 1000); |
|
|
|
}, 1000); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
timeFilter(countDown) { |
|
|
|
|
|
|
|
if (countDown > 0) { |
|
|
|
|
|
|
|
let h = Math.floor(countDown / (60 * 60)); |
|
|
|
|
|
|
|
let m = Math.floor(countDown % (60 * 60) / 60); |
|
|
|
|
|
|
|
let s = Math.floor(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"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
getData() { |
|
|
|
getData() { |
|
|
|
this.listLoading = true; |
|
|
|
this.listLoading = true; |
|
|
|
this.listData.splice(0); |
|
|
|
this.listData.splice(0); |
|
|
|
if (this.ticker) { |
|
|
|
this.sss = 0 |
|
|
|
clearInterval(this.ticker); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
...this.form, |
|
|
|
...this.form, |
|
|
|
keyWord: this.keyWord, |
|
|
|
keyWord: this.keyWord, |
|
|
@ -272,7 +275,6 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
this.$post(this.api.pageByCondition, data).then(res => { |
|
|
|
this.$post(this.api.pageByCondition, data).then(res => { |
|
|
|
this.listData = res.list; |
|
|
|
this.listData = res.list; |
|
|
|
console.log(this.listData) |
|
|
|
|
|
|
|
this.total = res.total; |
|
|
|
this.total = res.total; |
|
|
|
this.listData.forEach(i => { |
|
|
|
this.listData.forEach(i => { |
|
|
|
i.show = false; |
|
|
|
i.show = false; |
|
|
@ -298,7 +300,8 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.beginTimer(); |
|
|
|
this.sss = 1 |
|
|
|
|
|
|
|
this.beginTimer() |
|
|
|
this.listLoading = false; |
|
|
|
this.listLoading = false; |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
this.listLoading = false; |
|
|
|
this.listLoading = false; |
|
|
@ -307,6 +310,7 @@ export default { |
|
|
|
initData() { |
|
|
|
initData() { |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
this.pageNum = 1; |
|
|
|
this.pageNum = 1; |
|
|
|
|
|
|
|
this.sss = 0 |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
getschoolCourse() { // 获取课程下拉框数据 |
|
|
|
getschoolCourse() { // 获取课程下拉框数据 |
|
|
@ -329,6 +333,7 @@ export default { |
|
|
|
start(row) { |
|
|
|
start(row) { |
|
|
|
this.$post(`${this.api.enableAssessment}?id=${row.id}`).then(res => { |
|
|
|
this.$post(`${this.api.enableAssessment}?id=${row.id}`).then(res => { |
|
|
|
util.successMsg("启动成功!"); |
|
|
|
util.successMsg("启动成功!"); |
|
|
|
|
|
|
|
this.sss = 0 |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
console.log(err); |
|
|
|
console.log(err); |
|
|
@ -345,6 +350,7 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
this.$post(`${this.api.collectPaper}?id=${row.id}`).then(res => { |
|
|
|
this.$post(`${this.api.collectPaper}?id=${row.id}`).then(res => { |
|
|
|
util.successMsg("提前结束成功!"); |
|
|
|
util.successMsg("提前结束成功!"); |
|
|
|
|
|
|
|
this.sss = 0 |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
console.log(err); |
|
|
|
console.log(err); |
|
|
@ -358,6 +364,7 @@ export default { |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.$post(this.api.deleteAssessment, [row.id]).then(res => { |
|
|
|
this.$post(this.api.deleteAssessment, [row.id]).then(res => { |
|
|
|
util.successMsg("删除成功"); |
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
|
|
|
this.sss = 0 |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
}); |
|
|
|
}); |
|
|
@ -376,6 +383,7 @@ export default { |
|
|
|
this.multipleSelection = []; |
|
|
|
this.multipleSelection = []; |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
this.$refs.table.clearSelection(); |
|
|
|
util.successMsg("删除成功"); |
|
|
|
util.successMsg("删除成功"); |
|
|
|
|
|
|
|
this.sss = 0 |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
}); |
|
|
|
}); |
|
|
@ -390,10 +398,12 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
onSearch() { |
|
|
|
onSearch() { |
|
|
|
this.pageNum = 1; |
|
|
|
this.pageNum = 1; |
|
|
|
|
|
|
|
this.sss = 0 |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleCurrentChange(val) { |
|
|
|
handleCurrentChange(val) { |
|
|
|
this.pageNum = val; |
|
|
|
this.pageNum = val; |
|
|
|
|
|
|
|
this.sss = 0 |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
transferTime(date) { |
|
|
|
transferTime(date) { |
|
|
|