上架下架操作

This commit is contained in:
lmj
2022-12-22 19:56:47 +08:00
parent 5a79ebd775
commit 7fbe9e6fc8

View File

@@ -63,6 +63,10 @@
<template slot-scope="scope">
<!-- v-if="scope.row.collectNumber === 0" -->
<el-button type="text" v-if="!scope.row.published" @click="releaseData(scope.row,true)">发布</el-button>
<el-button type="text" v-if="scope.row.enabled == false" @click="enableddata(scope.row,true)">上架</el-button>
<el-button type="text" v-if="scope.row.enabled == true" @click="enableddata(scope.row,false)">下架</el-button>
<!-- // 成绩控制需要结束状态 -->
<el-button type="text" v-if="scope.row.published" @click="viewResults(scope.row)">成绩</el-button>
<el-button type="text" v-if="scope.row.published" @click="pushResults(scope.row)">推送</el-button>
@@ -1040,6 +1044,20 @@ export default {
})
})
},
enableddata(row,num){
console.log(row,num)
let query = {
id:row.id,
enabled:num
}
console.log(query)
apiTest.enabled(query).then(res =>{
if(res.status == 200){
}
})
this.loadData();
},
releaseData(row,num) {
let publish = num;
this.$confirm(`正在${publish? '':'取消'}发布考试, 是否继续?`, '提示', {