修复状态会跳动bug

dev_2022-05-11
yujialong 3 years ago
parent b3142c5172
commit ed3ddcae85
  1. 4
      src/pages/assessment/add/index.vue
  2. 8
      src/pages/assessment/list/index.vue

@ -311,7 +311,7 @@ export default {
this.allCheckedNodes = this.allCheckedNodes.filter(i => (i.level === 3 && i.id !== tag.id) || (i.level === 4 && i.parentId !== tag.id)); this.allCheckedNodes = this.allCheckedNodes.filter(i => (i.level === 3 && i.id !== tag.id) || (i.level === 4 && i.parentId !== tag.id));
}, },
handleCheck(data, checked) { // handleCheck(data, checked) { //
console.log(checked); // console.log(checked);
// //
let checkedClass = checked.checkedNodes.filter(i => i.level === 3); let checkedClass = checked.checkedNodes.filter(i => i.level === 3);
@ -355,7 +355,7 @@ export default {
i.nodeKey = `${i.id}-${new Date().getTime()}`; i.nodeKey = `${i.id}-${new Date().getTime()}`;
i.leaf = false; i.leaf = false;
} }
console.log(JSON.stringify(i)); // console.log(JSON.stringify(i));
result.push(i); result.push(i);
}); });
this.$nextTick(() => { this.$nextTick(() => {

@ -90,12 +90,12 @@
</template> </template>
</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" v-if="scope.row.show">
<span>{{ status[scope.row.status] }}</span> <span>{{ status[scope.row.status] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="170"> <el-table-column label="操作" align="center" width="170">
<template slot-scope="scope"> <template slot-scope="scope" v-if="scope.row.show">
<template v-if="scope.row.status == 0"> <template v-if="scope.row.status == 0">
<el-button v-if="auth('启动')" type="text" @click="start(scope.row)">启动</el-button> <el-button v-if="auth('启动')" type="text" @click="start(scope.row)">启动</el-button>
<el-button v-if="auth('修改')" type="text" @click="edit(scope.row)">修改</el-button> <el-button v-if="auth('修改')" type="text" @click="edit(scope.row)">修改</el-button>
@ -252,15 +252,18 @@ 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;
} }
} }
item.show = true;
this.$set(this.listData, i, item); this.$set(this.listData, i, item);
} }
}, 1000); }, 1000);
}, },
getData() { getData() {
this.listData.splice(0);
if (this.ticker) { if (this.ticker) {
clearInterval(this.ticker); clearInterval(this.ticker);
} }
@ -275,6 +278,7 @@ export default {
this.listData = res.list; this.listData = res.list;
this.total = res.total; this.total = res.total;
this.listData.forEach(i => { this.listData.forEach(i => {
i.show = false;
if (i.status === 2) { // if (i.status === 2) { //
i.countDown = 0; i.countDown = 0;
} else { } else {

Loading…
Cancel
Save