|
|
|
@ -90,12 +90,12 @@ |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<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> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<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"> |
|
|
|
|
<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> |
|
|
|
@ -252,15 +252,18 @@ export default { |
|
|
|
|
if (item.status === 0 && item.type === 2) { // 待开始-定时发布 |
|
|
|
|
item.status = 1; |
|
|
|
|
item.countDown = (new Date(item.stopTime).getTime() - new Date().getTime()) / 1000; |
|
|
|
|
console.log(item.countDown); |
|
|
|
|
} else if (item.status === 1) { |
|
|
|
|
item.status = 2; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
item.show = true; |
|
|
|
|
this.$set(this.listData, i, item); |
|
|
|
|
} |
|
|
|
|
}, 1000); |
|
|
|
|
}, |
|
|
|
|
getData() { |
|
|
|
|
this.listData.splice(0); |
|
|
|
|
if (this.ticker) { |
|
|
|
|
clearInterval(this.ticker); |
|
|
|
|
} |
|
|
|
@ -275,6 +278,7 @@ export default { |
|
|
|
|
this.listData = res.list; |
|
|
|
|
this.total = res.total; |
|
|
|
|
this.listData.forEach(i => { |
|
|
|
|
i.show = false; |
|
|
|
|
if (i.status === 2) { // 已结束 |
|
|
|
|
i.countDown = 0; |
|
|
|
|
} else { |
|
|
|
|