Эх сурвалжийг харах

试卷详情展示与返回

Michael Wang 6 жил өмнө
parent
commit
719bd509f7

+ 2 - 2
src/components/MainLayout/MainLayout.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="main-layout">
     <header class="header qm-primary-text">
-      <a style="float: left; padding-left: 20px" @click="goBack">
-        <Icon type="ios-arrow-back" />返回</a>
+      <!-- <a style="float: left; padding-left: 20px" @click="goBack">
+        <Icon type="ios-arrow-back" />返回</a> -->
       <Poptip trigger="hover" width="300">
         <span class="name-arrow">{{user.displayName}} &nbsp;
           <i class="ivu-icon ivu-icon-md-arrow-dropdown" style="vertical-align: middle;"></i>

+ 14 - 2
src/features/OnlinePractice/OnlinePracticeRecordDetail.vue

@@ -46,7 +46,12 @@
       </div>
     </div>
 
-    <ExamPaper :examId="examId" :examRecordDataId="examRecordDataId" />
+    <div style="margin: 20px; display: grid; grid-template-columns: repeat( auto-fit, minmax(100px, 1fr) ); grid-gap: 20px">
+      <i-button class="qm-primary-button" @click="shouldShowPaper= !shouldShowPaper">展开试卷</i-button>
+      <i-button v-if="!disableGoBack" class="qm-primary-button" @click="goBack">返回</i-button>
+    </div>
+
+    <ExamPaper v-if="shouldShowPaper" :examId="examId" :examRecordDataId="examRecordDataId" />
   </main-layout>
 </template>
 
@@ -60,7 +65,11 @@ import ExamPaper from "../OnlineExam/Examing/ExamPaper.vue";
 export default {
   name: "OnlinePracticeRecordDetail",
   data() {
-    return { examRecordResult: [] };
+    return {
+      examRecordResult: [],
+      shouldShowPaper: false,
+      disableGoBack: this.$route.query.disableGoBack
+    };
   },
   async created() {
     try {
@@ -83,6 +92,9 @@ export default {
     },
     formatTime(ms) {
       return moment.utc(ms).format("HH:mm:ss") || "";
+    },
+    goBack() {
+      this.$router.back();
     }
   },
   computed: {