考试上下架控制调整

This commit is contained in:
daihh
2022-12-26 17:23:19 +08:00
parent beec863bb1
commit 26c0946ab5
2 changed files with 16 additions and 17 deletions

View File

@@ -784,22 +784,16 @@ export default {
}
this.$refs.comEditPaper.show(row.paperId);
},
open(row,num) {
open(row,flag) {
this.$confirm('确定要下架改考试么?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.enableddata(row,num);
this.$message({
type: 'success',
message: '下架成功!'
});
this.enableddata(row,flag);
this.$message({ type: 'success', message: '下架成功!' });
}).catch(() => {
this.$message({
type: 'info',
message: '已取消下架'
});
this.$message({ type: 'info', message: '已取消下架' });
});
},
exportsList(){
@@ -1086,19 +1080,21 @@ export default {
})
})
},
enableddata(row,num){
console.log(row,num)
enableddata(row,flag){
//console.log(row,flag)
let query = {
id:row.id,
enabled:num
enabled:flag
}
console.log(query)
//console.log(query)
apiTest.enabled(query).then(res =>{
if(res.status == 200){
row.enabled=flag;
}else{
this.$message({ type: 'error', message: res.message})
}
})
this.loadData();
},
releaseData(row,num) {
let publish = num;

View File

@@ -26,7 +26,10 @@
<span>{{tipText}}</span>
</div>
<div v-else>
<span v-if="testPaper.enabled">
<el-button type="primary" :disabled="startButton" v-if="testStatus == 1" @click="startTest()">{{btnText}}</el-button>
</span>
<span v-else style="color: #666666;">此考试已下架</span>
</div>
</div>
<div v-if="examStatus==2" style="text-align: center;color:#6d6d6d; ">考试已结束</div>