From 45dbe6e15268e874d6bbc7ce68801f6db0a1c0ae Mon Sep 17 00:00:00 2001 From: 龚焕茏 <2842157468@qq.com> Date: 星期三, 08 五月 2024 17:46:56 +0800 Subject: [PATCH] fix:禁用的人不能被查出来考试、题目去重 --- src/views/feedback/list.vue | 34 +++++++++++++++++++++++++--------- src/api/feedback.js | 4 ++-- src/views/exam/paper/edit.vue | 5 ++++- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/api/feedback.js b/src/api/feedback.js index 0db7357..35ce153 100644 --- a/src/api/feedback.js +++ b/src/api/feedback.js @@ -2,6 +2,6 @@ export default { getFeedbackPageList: query => post('/api/admin/feedback/page', query), - deleteFeedback: id => get('/api/admin/feedback/delete/' + id), - settleFeedback: id => get('/api/admin/feedback/settleFeedback/' + id), + deleteFeedback: id => post('/api/admin/feedback/delete/' + id), + settleFeedback: id => post('/api/admin/feedback/settleFeedback/' + id), } diff --git a/src/views/exam/paper/edit.vue b/src/views/exam/paper/edit.vue index a3b03fd..ed5dbd1 100644 --- a/src/views/exam/paper/edit.vue +++ b/src/views/exam/paper/edit.vue @@ -340,6 +340,7 @@ }) }, addQuestion (titleItem) { + console.log('titleItem', titleItem) this.currentTitleItem = titleItem this.questionPage.showDialog = true this.search() @@ -358,7 +359,9 @@ let _this = this this.questionPage.multipleSelection.forEach(q => { questionApi.select(q.id).then(re => { - _this.currentTitleItem.questionItems.push(re.response) + if (!_this.currentTitleItem.questionItems.some(obj => obj.id === re.response.id)) { + _this.currentTitleItem.questionItems.push(re.response) + } }) }) this.questionPage.showDialog = false diff --git a/src/views/feedback/list.vue b/src/views/feedback/list.vue index 7d7f9a9..780d652 100644 --- a/src/views/feedback/list.vue +++ b/src/views/feedback/list.vue @@ -4,17 +4,21 @@ <el-table-column prop="questionTitle" label="鍙嶉棰樼洰" /> <el-table-column prop="describe" label="鍙嶉鎻忚堪" /> <el-table-column prop="userName" label="鍙嶉鐢ㄦ埛" /> - <el-table-column prop="fix" label="鏄惁澶勭悊" width="100px"> + <el-table-column prop="fix" label="鏄惁澶勭悊" width="100px" align="center"> <template slot-scope="{row}"> <el-tag :type="row.fix ? 'success' : 'warning'">{{ row.fix ? '宸插鐞�' : '鏈鐞�' }}</el-tag> </template> </el-table-column> - <el-table-column prop="fixTime" label="澶勭悊鏃堕棿" width="120px"/> - <el-table-column label="鎿嶄綔" align="center" width="260px"> + <el-table-column prop="fixTime" label="澶勭悊鏃堕棿" width="160px"/> + <el-table-column label="鎿嶄綔" align="center" width="300px"> <template slot-scope="{row}"> - <el-button size="mini" @click="showQuestion(row)" class="link-left">鏌ョ湅</el-button> - <el-button size="mini" @click="hanldSettleFeedback(row)" type="info" class="link-left">纭澶勭悊</el-button> - <el-button size="mini" @click="hanldDeleteFeedback(row)" type="danger" class="link-left">鍒犻櫎</el-button> + <el-button size="mini" @click="showQuestion(row)" class="link-left">棰樼洰棰勮</el-button> + <el-popconfirm title="纭畾宸插鐞嗗悧锛�" @confirm="hanldSettleFeedback(row)"> + <el-button slot="reference" v-if="!row.fix" size="mini" type="primary" class="link-left">纭澶勭悊</el-button> + </el-popconfirm> + <el-popconfirm title="纭畾瑕佸垹闄ゅ悧锛�" @confirm="hanldDeleteFeedback(row)"> + <el-button slot="reference" size="mini" type="danger" class="link-left">鍒犻櫎</el-button> + </el-popconfirm> </template> </el-table-column> </el-table> @@ -51,7 +55,7 @@ dialog: false, question: null, loading: false - } + }, } }, created() { @@ -79,10 +83,22 @@ }) }, hanldSettleFeedback(row) { - + feedbackApi.settleFeedback(row.id).then(res => { + this.$message({ + message: '鎿嶄綔鎴愬姛', + type: 'success' + }) + this.search() + }) }, hanldDeleteFeedback(row) { - + feedbackApi.deleteFeedback(row.id).then(res => { + this.$message({ + message: '鎿嶄綔鎴愬姛', + type: 'success' + }) + this.search() + }) } } } -- Gitblit v1.8.0