考试上下架控制调整

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

View File

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