From fd58747d3c425748f3218eb79b142b0ab4af28b8 Mon Sep 17 00:00:00 2001 From: 龚焕茏 <2842157468@qq.com> Date: 星期四, 11 七月 2024 10:34:50 +0800 Subject: [PATCH] feat:缺考展示 --- src/views/answer/detail.vue | 37 +++++++++++++++++++------------------ 1 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/views/answer/detail.vue b/src/views/answer/detail.vue index 3c1a44b..5915cec 100644 --- a/src/views/answer/detail.vue +++ b/src/views/answer/detail.vue @@ -30,10 +30,10 @@ <el-divider></el-divider> <el-row class="do-exam-title"> <el-col :span="24"> - <span :key="item.itemOrder" v-for="item in form.navbar"> - <el-tag :type="questionDoRightTag(item.right)" class="do-exam-title-tag" - @click="goAnchor('#question-' + item.itemOrder)">{{ item.itemOrder }}</el-tag> - </span> + <span :key="item.itemOrder" v-for="item in form.navbar"> + <el-tag :type="questionDoRightTag(item.right)" class="do-exam-title-tag" + @click="goAnchor('#question-' + item.itemOrder)">{{ item.itemOrder }}</el-tag> + </span> </el-col> </el-row> </el-card> @@ -44,14 +44,15 @@ <h3>{{ titleItem.title }}</h3> <el-card class="exampaper-item-box" v-if="titleItem.questionList.length !== 0"> <el-form-item :key="questionItem.itemOrder" :label="questionItem.itemOrder + '.'" - v-for="questionItem in titleItem.questionList" class="exam-question-item" - label-width="50px" :id="'question-' + questionItem.itemOrder"> - <MarkPaperShow :qType="questionItem.questionType" :question="questionItem" :answer="form.navbar"/> + v-for="questionItem in titleItem.questionList" class="exam-question-item" label-width="50px" + :id="'question-' + questionItem.itemOrder"> + <MarkPaperShow :qType="questionItem.questionType" :question="questionItem" :answer="form.navbar" /> </el-form-item> </el-card> </el-row> </el-form> </div> + <el-empty v-if="empty" style="width:1200px;height:500px;"></el-empty> </div> </template> @@ -63,20 +64,21 @@ export default { name: 'MarkPaperDetail', components: { MarkPaperShow }, - mounted () { + mounted() { let id = this.$route.query.id if (id && parseInt(id) !== 0) { this.formLoading = true examPaperAnswerApi.read(id).then(re => { this.formLoading = true this.form = re.data - console.log('this.form', this.form); + if (!this.form.titleItems) this.empty = true; this.formLoading = false }) } }, - data () { + data() { return { + empty: false, paperQuestionList: [], form: {}, formLoading: false, @@ -86,7 +88,7 @@ } }, methods: { - open () { + open() { this.$confirm('纭鏄惁鎻愪氦鎴愮哗鎵规敼?', '鎻愮ず', { confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', @@ -103,20 +105,20 @@ }) }) }, - goAnchor (selector) { + goAnchor(selector) { this.$el.querySelector(selector).scrollIntoView({ behavior: 'instant', block: 'center', inline: 'nearest' }) }, - questionDoRightTag (status) { + questionDoRightTag(status) { return this.enumFormat(this.doRightTag, status) }, - getStudentPaper () { + getStudentPaper() { getStudentExam(this.examInfo.examId, this.userId).then(res => { this.examInfo = res.data.data }) } }, computed: { - formattedDoTime () { + formattedDoTime() { const totalSeconds = this.form.doTime const minutes = Math.floor(totalSeconds / 60) const seconds = totalSeconds % 60 @@ -131,7 +133,6 @@ </script> <style scoped> - .paper-container { display: flex; flex-direction: row; @@ -146,7 +147,8 @@ } .paper-form { - flex: 1; /* 鍗犳嵁鍓╀綑绌洪棿 */ + flex: 1; + /* 鍗犳嵁鍓╀綑绌洪棿 */ margin-left: 300px; } @@ -157,5 +159,4 @@ font-size: 14px; margin-top: 10px; } - </style> -- Gitblit v1.8.0