提交 a408c8a8 authored 作者: matian's avatar matian

fix:删除增加弹框提示

上级 1a5a9f94
...@@ -25,7 +25,15 @@ ...@@ -25,7 +25,15 @@
</el-dropdown> </el-dropdown>
</div> </div>
<template v-slot:table-x="{ row }"> <template v-slot:table-x="{ row }">
<el-button type="text" @click="handleDetail(row)">查看详情</el-button> <router-link
:to="{
path: 'markingPaper',
query: { eid: exam_id, sid: row.student_id }
}"
target="_blank"
>
<el-button type="text">查看详情</el-button>
</router-link>
</template> </template>
<el-dialog title="转移考生" :visible.sync="dialogVisible" width="40%"> <el-dialog title="转移考生" :visible.sync="dialogVisible" width="40%">
<div> <div>
...@@ -144,7 +152,6 @@ export default { ...@@ -144,7 +152,6 @@ export default {
}, },
methods: { methods: {
handleDetail(row) { handleDetail(row) {
// console.log(row)
this.$router.push({ this.$router.push({
path: 'markingPaper', path: 'markingPaper',
query: { eid: this.exam_id, sid: row.student_id } query: { eid: this.exam_id, sid: row.student_id }
...@@ -205,11 +212,15 @@ export default { ...@@ -205,11 +212,15 @@ export default {
}, },
// 删除考生 // 删除考生
delStudent() { delStudent() {
this.$confirm('确认删除该考试吗?删除后不可恢复').then(_ => {
const studentId = this.multipleSelection.map(item => item.student_id).toString() const studentId = this.multipleSelection.map(item => item.student_id).toString()
deleteStudent({ id: studentId }).then(res => { deleteStudent({ id: studentId }).then(res => {
if (res.code === 0) {
this.$message.success('删除成功') this.$message.success('删除成功')
}
}) })
this.$refs.list.refetch() this.$refs.list.refetch()
})
}, },
// 导出明细 // 导出明细
exportDetail() { exportDetail() {
......
...@@ -104,10 +104,12 @@ export default { ...@@ -104,10 +104,12 @@ export default {
// 单个删除 // 单个删除
handleDelete(row) { handleDelete(row) {
this.$confirm('确认删除考试吗?删除后不可恢复').then(_ => { this.$confirm('确认删除考试吗?删除后不可恢复').then(_ => {
const params = { id: row.exam_id } const params = { id: row.exam_id }
delExamPaper(params).then(res => { delExamPaper(params).then(res => {
if (res.code === 0) {
this.$message.success('删除考试成功') this.$message.success('删除考试成功')
}
}) })
this.$refs.list.refetch() this.$refs.list.refetch()
}) })
......
...@@ -140,6 +140,7 @@ export default { ...@@ -140,6 +140,7 @@ export default {
}, },
// 删除选中试题 // 删除选中试题
handleRemove() { handleRemove() {
this.$confirm('确认删除选中试题吗?删除后不可恢复').then(_ => {
this.questions = this.questions.filter(item => { this.questions = this.questions.filter(item => {
if (item.children) { if (item.children) {
item.children = item.children.filter(item => !this.multipleSelection.includes(item.id)) item.children = item.children.filter(item => !this.multipleSelection.includes(item.id))
...@@ -147,6 +148,7 @@ export default { ...@@ -147,6 +148,7 @@ export default {
return !this.multipleSelection.includes(item.id) return !this.multipleSelection.includes(item.id)
}) })
this.multipleSelection = [] this.multipleSelection = []
})
}, },
// 保存试卷 // 保存试卷
handleSubmit() { handleSubmit() {
......
...@@ -90,7 +90,9 @@ export default { ...@@ -90,7 +90,9 @@ export default {
}, },
methods: { methods: {
removeChidren(n) { removeChidren(n) {
this.$confirm('确认删除该考试吗?删除后不可恢复').then(_ => {
this.chidrenList.splice(n, 1) this.chidrenList.splice(n, 1)
})
}, },
submitForm() { submitForm() {
let flag = false let flag = false
......
...@@ -174,14 +174,18 @@ export default { ...@@ -174,14 +174,18 @@ export default {
// 删除试题 // 删除试题
handleDelete(id) { handleDelete(id) {
console.log(id) console.log(id)
this.$confirm('确认删除该试题吗?删除后不可恢复').then(_ => {
const ids = id ? [id] : this.deleteQuestions const ids = id ? [id] : this.deleteQuestions
deleteQuestion({ ids: ids }).then(res => { deleteQuestion({ ids: ids }).then(res => {
if (res.code === 0) {
this.$message({ this.$message({
message: '删除成功', message: '删除成功',
type: 'success' type: 'success'
}) })
}
this.$refs.list.refetch() this.$refs.list.refetch()
}) })
})
}, },
// 创建成功刷新列表 // 创建成功刷新列表
handleCreateSuccess() { handleCreateSuccess() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论