From 8a7fdd668f6ed415ff0bfa53d9e759cca73a6dbc Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期五, 12 七月 2024 15:20:32 +0800 Subject: [PATCH] 优化 --- src/views/exam/exam/ExamManage.vue | 39 ++++++++++++++++++++++++++++----------- 1 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/views/exam/exam/ExamManage.vue b/src/views/exam/exam/ExamManage.vue index 11054e4..e4c5765 100644 --- a/src/views/exam/exam/ExamManage.vue +++ b/src/views/exam/exam/ExamManage.vue @@ -35,10 +35,10 @@ label="鍙傝�冪彮绾�" prop="className" ></el-table-column> - <el-table-column - label="鐝骇浜烘暟" - prop="studentNum" - ></el-table-column> + <!-- <el-table-column--> + <!-- label="鐝骇浜烘暟"--> + <!-- prop="studentNum"--> + <!-- ></el-table-column>--> <el-table-column label="鑰冭瘯鍦扮偣" prop="examPlace" @@ -72,8 +72,19 @@ @click="handlerEdit(scope.row)" >淇敼 </el-button> - <el-button type="danger" size="small" @click="deleteExam(scope.row.id)">鍒犻櫎</el-button> - <el-button type="success" size="small" @click="markPaper(scope.row)">闃呭嵎</el-button> + <el-popconfirm + v-if="scope.row.status === 'not_start'" + style="margin: 0 5px" + title="纭畾瑕佸垹闄よ鑰冭瘯鍚楋紵" + @confirm="deleteExam(scope.row.id)" + > + <el-button slot="reference" type="danger" size="small">鍒犻櫎</el-button> + </el-popconfirm> + + <el-button v-if="scope.row.status === 'finished'" type="success" size="small" @click="markPaper(scope.row)"> + 闃呭嵎 + </el-button> + <el-button type="danger" size="small" @click="deleteExam(scope.row)">鍒犻櫎</el-button> <el-button type="warning" size="small" @click="monitor(scope.row)">鐩戞帶</el-button> </template> </el-table-column> @@ -236,16 +247,22 @@ this.classesList = res.data.data }) }, - deleteExam (id) { - deleteExamById(id).then(res => { - this.$message.success('鍒犻櫎鎴愬姛') - this.page() + deleteExam (row) { + this.$confirm('纭鏄惁鍒犻櫎' + row.examName + '?', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + deleteExamById(row.id).then(res => { + this.$message.success('鍒犻櫎鎴愬姛') + this.page() + }) }) }, handlerEdit (row) { this.examForm = { ...row, - time: [row.startTime, row.endTime] + time: [row.startTime, row.endTime] } this.title = '淇敼鑰冭瘯' this.open = true -- Gitblit v1.8.0