From 80561b2bc83bb35582ba62e0c21a63c3ee5a0e82 Mon Sep 17 00:00:00 2001
From: lohir <3399054449@qq.com>
Date: 星期三, 16 十月 2024 17:15:00 +0800
Subject: [PATCH] bug
---
src/views/class-management/Class.vue | 2
src/api/exam.js | 16 ++++++++
src/views/exam/exam/ExamManage.vue | 47 +++++++++++++++++++++--
3 files changed, 59 insertions(+), 6 deletions(-)
diff --git a/src/api/exam.js b/src/api/exam.js
index b586aef..f5a9dbf 100644
--- a/src/api/exam.js
+++ b/src/api/exam.js
@@ -108,3 +108,19 @@
data: data
})
}
+
+// 鑰冭瘯璁板綍浣滃簾
+export const cancel = (id) => {
+ return axios({
+ url: '/api/admin/exam/cancel/' + id,
+ method: 'PUT'
+ })
+}
+
+// 鑰冭瘯璁板綍鎭㈠
+export const recover = (id) => {
+ return axios({
+ url: "/api/admin/exam/recover/" + id,
+ method: "PUT"
+ })
+}
diff --git a/src/views/class-management/Class.vue b/src/views/class-management/Class.vue
index 7cf959e..4248781 100644
--- a/src/views/class-management/Class.vue
+++ b/src/views/class-management/Class.vue
@@ -322,7 +322,7 @@
this.page()
})
},
- recover(id) {
+ recover (id) {
recover(id).then(res => {
this.$message.success(res.data.message)
this.page()
diff --git a/src/views/exam/exam/ExamManage.vue b/src/views/exam/exam/ExamManage.vue
index 53261b4..97a4c6c 100644
--- a/src/views/exam/exam/ExamManage.vue
+++ b/src/views/exam/exam/ExamManage.vue
@@ -75,21 +75,43 @@
size="small"
@click="handlerEdit(scope.row)"
v-if="scope.row.status === 'not_start'"
+ v-show="scope.row.status !== 'cancel'"
>淇敼
</el-button>
<el-popconfirm
v-if="scope.row.status === 'not_start'"
+ v-show="scope.row.status !== 'cancel'"
style="margin: 0 5px"
title="纭畾瑕佸垹闄よ鑰冭瘯鍚楋紵"
@confirm="deleteExam(scope.row.id)"
>
- <el-button slot="reference" type="danger" size="small">鍒犻櫎</el-button>
+ <el-button slot="reference" type="danger" size="small" v-show="scope.row.status !== 'cancel'">鍒犻櫎</el-button>
</el-popconfirm>
- <el-button v-if="scope.row.status === 'finished'" type="success" size="small" @click="markPaper(scope.row)">
+ <el-button v-if="scope.row.status === 'finished'" type="success" size="small" @click="markPaper(scope.row)" v-show="scope.row.status !== 'cancel'">
闃呭嵎
</el-button>
- <el-button v-if="scope.row.status === 'ing'" type="warning" size="small" @click="monitor(scope.row)">鐩戞帶</el-button>
+ <el-button v-if="scope.row.status === 'ing'" type="warning" size="small" @click="monitor(scope.row)" v-show="scope.row.status !== 'cancel'">鐩戞帶</el-button>
+ <el-popconfirm
+ class="confirm"
+ style="margin: 0 5px"
+ title="纭畾瑕佷綔搴熻鑰冭瘯璁板綍鍚楋紵"
+ @confirm="cancel(scope.row.id)"
+ >
+ <el-button slot="reference" v-show="scope.row.status !== 'cancel'" type="danger"
+ size="small"
+ v-if="scope.row.status !== 'ing'">浣滃簾
+ </el-button>
+ </el-popconfirm>
+ <el-popconfirm
+ class="confirm"
+ title="纭畾瑕佹仮澶嶈鑰冭瘯璁板綍鍚楋紵"
+ @confirm="recover(scope.row.id)"
+ >
+ <el-button slot="reference" v-show="scope.row.status === 'cancel'" type="success"
+ size="small">鎭㈠姝e父
+ </el-button>
+ </el-popconfirm>
</template>
</el-table-column>
</el-table>
@@ -150,8 +172,7 @@
<script>
import Pagination from '@/components/Pagination'
-import { getExams, addExam, editExam, deleteExamById } from '@/api/exam'
-import { myClasses } from '@/api/classes'
+import { getExams, addExam, editExam, deleteExamById, cancel, recover } from '@/api/exam'
import examPaperAPI from '@/api/examPaper'
export default {
@@ -211,6 +232,20 @@
this.MyExamPaperList()
},
methods: {
+ // 浣滃簾鑰冭瘯
+ cancel (id) {
+ cancel(id).then(res => {
+ this.$message.success(res.data.message)
+ this.page()
+ })
+ },
+ // 鎭㈠鑰冭瘯
+ recover (id) {
+ recover(id).then(res => {
+ this.$message.success(res.data.message)
+ this.page()
+ })
+ },
// 鑰冭瘯鐩戞帶鍒楄〃
monitor (row) {
this.$router.push({ path: '/exam/monitor', query: { examId: row.id } })
@@ -229,6 +264,8 @@
return '鏈紑濮�'
} else if (row.status === 'finished') {
return '宸茬粨鏉�'
+ } else if (row.status === 'cancel') {
+ return '宸蹭綔搴�'
}
},
MyExamPaperList () {
--
Gitblit v1.8.0