From bcc67be745fd4b1b9a57e0e8cd7c13cab8dfd2fd Mon Sep 17 00:00:00 2001
From: lohir <3399054449@qq.com>
Date: 星期四, 17 十月 2024 19:07:37 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/answer/detail.vue | 256 ++++++++++++++++++++++++++++----------------------
1 files changed, 144 insertions(+), 112 deletions(-)
diff --git a/src/views/answer/detail.vue b/src/views/answer/detail.vue
index 799cd8a..5915cec 100644
--- a/src/views/answer/detail.vue
+++ b/src/views/answer/detail.vue
@@ -1,130 +1,162 @@
<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>
+ <div class="paper-container">
+ <div class="paper-card" v-loading="formLoading">
+ <el-card style="height: 100vh">
+ <el-row style="text-align: left; margin-bottom : 20px; font-size: 20px">璇枃鑰冭瘯</el-row>
+ <el-row>
+ <el-col class="info">
+ <span class="exam-info">瀛﹀憳濮撳悕锛�</span>
+ <span class="exam-info">{{ form.userName }}</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-col class="info">
+ <span class="exam-info">浜ゅ嵎鏃堕棿锛�</span>
+ <span class="exam-info">{{ form.submitTime }}</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>
+ <el-row>
+ <el-col class="info">
+ <span class="exam-info">瀹屾垚鑰楁椂锛�</span>
+ <span class="exam-info">{{ formattedDoTime }}</span>
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col class="info">
+ <span class="exam-info">寰楀垎锛�</span>
+ <span class="exam-info">{{ form.score + ' / ' + form.totalScore }}</span>
+ </el-col>
+ </el-row>
+ <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>
+ </el-col>
+ </el-row>
+ </el-card>
</div>
+ <div class="paper-form">
+ <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.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" />
+ </el-form-item>
+ </el-card>
+ </el-row>
+ </el-form>
+ </div>
+ <el-empty v-if="empty" style="width:1200px;height:500px;"></el-empty>
+ </div>
</template>
<script>
-import { mapState, mapGetters } from 'vuex'
-import QuestionAnswerShow from '@/components/questionAnswerShow'
import examPaperAnswerApi from '@/api/examPaperAnswer'
+import MarkPaperShow from '@/views/answer/components/QuestionAnswerShow'
+import { mapGetters, mapState } from 'vuex'
+
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) {
- let theTime1 = 0
- let theTime2 = 0
- if (theTime > 60) {
- theTime1 = parseInt(theTime / 60)
- theTime = parseInt(theTime % 60)
- if (theTime1 > 60) {
- theTime2 = parseInt(theTime1 / 60)
- theTime1 = parseInt(theTime1 % 60)
- }
- }
- let result = '' + parseInt(theTime) + '绉�'
- if (theTime1 > 0) {
- result = '' + parseInt(theTime1) + '鍒�' + result
- }
- if (theTime2 > 0) {
- result = '' + parseInt(theTime2) + '灏忔椂' + result
- }
- return result
- },
- 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
- })
+ name: 'MarkPaperDetail',
+ components: { MarkPaperShow },
+ 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
+ if (!this.form.titleItems) this.empty = true;
+ this.formLoading = false
+ })
}
+ },
+ data() {
+ return {
+ empty: false,
+ paperQuestionList: [],
+ form: {},
+ formLoading: false,
+ userId: null,
+ userName: '寮犱笁',
+ questionLoading: false
+ }
+ },
+ methods: {
+ open() {
+ this.$confirm('纭鏄惁鎻愪氦鎴愮哗鎵规敼?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ submitMark(this.form).then(re => {
+ if (re.data.code === 1) {
+ console.log('1111111')
+ this.$message.success('鎻愪氦鎴愬姛')
+ this.$router.back()
+ } else {
+ this.$message.error(re.message)
+ }
+ })
+ })
+ },
+ goAnchor(selector) {
+ this.$el.querySelector(selector).scrollIntoView({ behavior: 'instant', block: 'center', inline: 'nearest' })
+ },
+ questionDoRightTag(status) {
+ return this.enumFormat(this.doRightTag, status)
+ },
+ getStudentPaper() {
+ getStudentExam(this.examInfo.examId, this.userId).then(res => {
+ this.examInfo = res.data.data
+ })
+ }
+ },
+ computed: {
+ formattedDoTime() {
+ const totalSeconds = this.form.doTime
+ const minutes = Math.floor(totalSeconds / 60)
+ const seconds = totalSeconds % 60
+ return `${minutes}鍒�${seconds < 10 ? '0' + seconds : seconds}绉抈
+ },
+ ...mapGetters('enumItem', ['enumFormat']),
+ ...mapState('enumItem', {
+ doRightTag: state => state.exam.question.answer.doRightTag
+ })
+ }
}
</script>
-<style lang="scss" scoped>
-.align-center {
- text-align: center
+<style scoped>
+.paper-container {
+ display: flex;
+ flex-direction: row;
+ height: 100%;
+ padding: 20px;
+ min-height: 100%;
}
-.exam-question-item {
- padding: 10px;
-
- .el-form-item__label {
- font-size: 15px !important;
- }
+.paper-card {
+ position: fixed;
+ width: 270px;
}
-.question-title-padding {
- padding-left: 25px;
- padding-right: 25px;
+.paper-form {
+ flex: 1;
+ /* 鍗犳嵁鍓╀綑绌洪棿 */
+ margin-left: 300px;
}
-</style>
\ No newline at end of file
+
+.info {
+ display: flex;
+ flex-direction: row;
+ justify-content: left;
+ font-size: 14px;
+ margin-top: 10px;
+}
+</style>
--
Gitblit v1.8.0