修改考核列表倒计时为零自动结束

UI_2022-02-10
e 3 years ago
parent a7be2f73b8
commit 4e8c20187f
  1. 21
      src/pages/ass/list/index.vue

@ -78,7 +78,7 @@
<el-table-column prop="stopTime" label="结束时间" align="center"></el-table-column>
<el-table-column label="倒计时" align="center">
<template slot-scope="scope">
<span>{{ scope.row.countDown | timeFilter }}</span>
<span>{{ timeFilter(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column label="考核状态" align="center">
@ -244,19 +244,22 @@ export default {
this.getCourseData();
this.getClassData();
},
filters: {
methods: {
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);
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);
return `${h > 9 ? h : `0${h}`}:${m > 9 ? m : `0${m}`}:${s > 9 ? s : `0${s}`}`;
} else {
if (countDown.status == 2){
}else{
countDown.status = 2
}
return "00:00:00";
}
}
},
methods: {
},
beginTimer() {
this.ticker = setInterval(() => {
for (let i = 0; i < this.listData.length; i++) {

Loading…
Cancel
Save