修复加快倒计时bug

dev_2022-05-11
yujialong 3 years ago
parent ed3ddcae85
commit 6d08208a24
  1. 10
      src/pages/assessment/list/index.vue

@ -5,7 +5,7 @@
<ul class="filter"> <ul class="filter">
<li> <li>
<label>考核时间</label> <label>考核时间</label>
<el-radio-group v-model="form.month" @change="initData"> <el-radio-group v-model="form.month">
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio> <el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{ item.name }}</el-radio>
</el-radio-group> </el-radio-group>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" style="width: 300px;margin-left: 10px;" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker> <el-date-picker v-model="date" align="right" unlink-panels type="daterange" style="width: 300px;margin-left: 10px;" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
@ -50,7 +50,7 @@
</div> </div>
</div> </div>
<el-table ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table v-loading="listLoading" ref="table" :data="listData" class="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" :selectable="row => row.status !== 1" width="50" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" :selectable="row => row.status !== 1" width="50" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -191,6 +191,7 @@ export default {
total: 0, // total: 0, //
listData: [], // listData: [], //
multipleSelection: [], // multipleSelection: [], //
listLoading:false,//
ticker: null // ticker: null //
}; };
}, },
@ -252,7 +253,6 @@ export default {
if (item.status === 0 && item.type === 2) { // - if (item.status === 0 && item.type === 2) { // -
item.status = 1; item.status = 1;
item.countDown = (new Date(item.stopTime).getTime() - new Date().getTime()) / 1000; item.countDown = (new Date(item.stopTime).getTime() - new Date().getTime()) / 1000;
console.log(item.countDown);
} else if (item.status === 1) { } else if (item.status === 1) {
item.status = 2; item.status = 2;
} }
@ -263,6 +263,7 @@ export default {
}, 1000); }, 1000);
}, },
getData() { getData() {
this.listLoading = true;
this.listData.splice(0); this.listData.splice(0);
if (this.ticker) { if (this.ticker) {
clearInterval(this.ticker); clearInterval(this.ticker);
@ -302,8 +303,9 @@ export default {
} }
}); });
this.beginTimer(); this.beginTimer();
this.listLoading = false;
}).catch(err => { }).catch(err => {
console.log(err); this.listLoading = false;
}); });
}, },
initData() { initData() {

Loading…
Cancel
Save