From fe9bf9b495671b6b0463cec83c7d148d384ada70 Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Mon, 17 Oct 2022 14:04:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../competitionManage/bankList/index.vue | 5 +- .../bankList/previewAnswer.vue | 60 ++++++++++++++----- 2 files changed, 47 insertions(+), 18 deletions(-) diff --git a/src/views/competitionManage/bankList/index.vue b/src/views/competitionManage/bankList/index.vue index 0128b0ad5..389f87a87 100644 --- a/src/views/competitionManage/bankList/index.vue +++ b/src/views/competitionManage/bankList/index.vue @@ -39,7 +39,7 @@ export default { type: 'select', label: '类 型', config: { - data: this.$ConstSelect.QuestionTypeList + data: this.$ConstSelect.QuestionTypeList.filter(item => { return !['fill', 'answer'].includes(item.value); }) } }, topic: { @@ -63,7 +63,8 @@ export default { columns: [ { title: '题 目', - prop: 'topic' + prop: 'topic', + type: 'html' }, { title: '标 签', diff --git a/src/views/competitionManage/bankList/previewAnswer.vue b/src/views/competitionManage/bankList/previewAnswer.vue index cab30fbc3..f2c43ccb4 100644 --- a/src/views/competitionManage/bankList/previewAnswer.vue +++ b/src/views/competitionManage/bankList/previewAnswer.vue @@ -1,13 +1,14 @@ @@ -47,9 +50,14 @@ +
+ {{ isCorrect ? '答案正确!' : '答案错误!' }} +
提交 关闭 @@ -71,6 +79,8 @@ export default { return { active: '', show: false, + showAnswer: false, + isCorrect: false, form: { type: '', optionList: [] @@ -86,10 +96,19 @@ export default { }, type() { return this.form.type; + }, + mapType() { + const obj = {}; + const list = this.$ConstSelect.QuestionTypeList; + list.forEach(item => { + obj[item.value] = item.label; + }); + return obj; } }, watch: { questionId(val) { + this.showAnswer = false; this.getQuestionInfo(); }, type(val) { @@ -131,13 +150,10 @@ export default { } testAnswer(this.questionId, data).then(res => { if (val) { - if (res.data) { - this.$message.success('答案正确!'); - } else { - this.$message.warning('答案错误!'); - } + this.showAnswer = true; + this.isCorrect = res.data; } - this.doClose(); + // this.doClose(); }).catch(err => { console.log(err, '===err===='); }); @@ -159,4 +175,16 @@ export default { color: #000; padding-left: 15px; } + .show-answer { + padding: 15px; + span { + font-size: 18px; + } + .correct { + color: green; + } + .error { + color: red; + } + }