From 9c211c0a699bd762c7ac85cf1371551244055f51 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期五, 07 六月 2024 14:07:53 +0800
Subject: [PATCH] feat:成绩管理-试卷内容展示

---
 src/views/Manage/ScoreInquiry/detail.vue |  114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 114 insertions(+), 0 deletions(-)

diff --git a/src/views/Manage/ScoreInquiry/detail.vue b/src/views/Manage/ScoreInquiry/detail.vue
index e69de29..9235034 100644
--- a/src/views/Manage/ScoreInquiry/detail.vue
+++ b/src/views/Manage/ScoreInquiry/detail.vue
@@ -0,0 +1,114 @@
+<template>
+    <div style="background-color: #FFFFFF; padding-top: 50px;min-height: 900px;">
+        <el-row class="do-exam-title" style="background-color: #F5F5DC">
+            <el-col :span="24">
+                <span :key="item.itemOrder" v-for="item in answer.answerItems">
+                    <el-tag :type="questionDoRightTag(item.doRight)" class="do-exam-title-tag"
+                        @click="goAnchor('#question-' + item.itemOrder)">{{ item.itemOrder }}</el-tag>
+                </span>
+            </el-col>
+        </el-row>
+        <el-row class="do-exam-title-hidden">
+            <el-col :span="24">
+                <span :key="item.itemOrder" v-for="item in answer.answerItems">
+                    <el-tag class="do-exam-title-tag">{{ item.itemOrder }}</el-tag>
+                </span>
+            </el-col>
+        </el-row>
+        <el-container class="app-item-contain">
+            <el-header class="align-center">
+                <h1>{{ form.name }}</h1>
+                <div>
+                    <span class="question-title-padding">璇曞嵎寰楀垎锛歿{ answer.score }}</span>
+                    <span class="question-title-padding">璇曞嵎鑰楁椂锛歿{ formatSeconds(answer.doTime) }}</span>
+                </div>
+            </el-header>
+            <el-main>
+                <el-form :model="form" ref="form" v-loading="formLoading" label-width="100px">
+                    <el-row :key="index" v-for="(titleItem, index) in form.titleItems">
+                        <h3>{{ titleItem.name }}</h3>
+                        <el-card class="exampaper-item-box" v-if="titleItem.questionItems.length !== 0">
+                            <el-form-item :key="questionItem.itemOrder" :label="questionItem.itemOrder + '.'"
+                                v-for="questionItem in titleItem.questionItems" class="exam-question-item"
+                                label-width="50px" :id="'question-' + questionItem.itemOrder">
+                                <QuestionAnswerShow :qType="questionItem.questionType" :question="questionItem"
+                                    :answer="answer.answerItems[questionItem.itemOrder - 1]" />
+                            </el-form-item>
+                        </el-card>
+                    </el-row>
+                </el-form>
+            </el-main>
+        </el-container>
+    </div>
+</template>
+
+<script>
+import { mapState, mapGetters } from 'vuex'
+import { formatSeconds } from '@/utils'
+import QuestionAnswerShow from '@/components/exam/QuestionAnswerShow.vue'
+import examPaperAnswerApi from '@/api/examPaperAnswer'
+export default {
+    components: { QuestionAnswerShow },
+    data() {
+        return {
+            form: {},
+            formLoading: false,
+            answer: {
+                id: null,
+                score: 0,
+                doTime: 0,
+                answerItems: [],
+                doRight: false
+            }
+        }
+    },
+    created() {
+        let id = this.$route.query.id
+        let _this = this
+        if (id && parseInt(id) !== 0) {
+            _this.formLoading = true
+            examPaperAnswerApi.read(id).then(re => {
+                _this.form = re.data.paper
+                _this.answer = re.data.answer
+                _this.formLoading = false
+            })
+        }
+    },
+    methods: {
+        formatSeconds(theTime) {
+            return formatSeconds(theTime)
+        },
+        questionDoRightTag(status) {
+            return this.enumFormat(this.doRightTag, status)
+        },
+        goAnchor(selector) {
+            this.$el.querySelector(selector).scrollIntoView({ behavior: 'instant', block: 'center', inline: 'nearest' })
+        }
+    },
+    computed: {
+        ...mapGetters('enumItem', ['enumFormat']),
+        ...mapState('enumItem', {
+            doRightTag: state => state.exam.question.answer.doRightTag
+        })
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.align-center {
+    text-align: center
+}
+
+.exam-question-item {
+    padding: 10px;
+
+    .el-form-item__label {
+        font-size: 15px !important;
+    }
+}
+
+.question-title-padding {
+    padding-left: 25px;
+    padding-right: 25px;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.8.0