Pārlūkot izejas kodu

解决iview modal在body添加overflow: hidden的问题

Michael Wang 6 gadi atpakaļ
vecāks
revīzija
bc95a40e19

+ 1 - 0
src/features/OnlineExam/Examing/ExamingEnd.vue

@@ -89,6 +89,7 @@ export default {
       this.cheatingRemark = cheatingRemark.data || "";
     }
 
+    document.body.style = "";
     // this.paperTotalScore = this.paperStruct.defaultPaper.questionGroupList
     //   .map(q => q.groupScore)
     //   .reduce((p, c) => p + c);

+ 13 - 4
src/features/OnlineExam/Examing/ExamingHome.vue

@@ -23,7 +23,7 @@
       <p slot="footer">
       </p>
     </Modal>
-    <FaceTracking v-if="faceEnable" />
+    <FaceTracking v-if="faceEnable && PRODUCTION" />
   </div>
   <div v-else>
     正在等待数据返回... <i-button class="qm-primary-button" v-if="timeouted" @click="reloadPage">重试</i-button>
@@ -46,7 +46,12 @@ const { mapState, mapMutations } = createNamespacedHelpers("examingHomeModule");
 export default {
   name: "ExamingHome",
   data() {
-    return { showFaceId: false, faceEnable: false, timeouted: false };
+    return {
+      showFaceId: false,
+      faceEnable: false,
+      timeouted: false,
+      PRODUCTION: process.env.NODE_ENV === "production"
+    };
   },
   async created() {
     this.timeoutTimeout = setTimeout(() => (this.timeouted = true), 30 * 1000);
@@ -123,6 +128,10 @@ export default {
       10 * 1000 // 10秒检查是否有更改需要提交答案
     );
   },
+  mounted() {
+    // iview bug: https://github.com/iview/iview/issues/4061
+    document.body.style = "";
+  },
   beforeDestroy() {
     clearTimeout(this.timeoutTimeout);
     clearInterval(this.submitInterval);
@@ -476,13 +485,13 @@ export default {
 
 @media screen and (max-height: 768px) {
   .container {
-    grid-template-rows: 50px 1fr;
+    grid-template-rows: 50px minmax(0, 1fr);
   }
   .header {
     height: 50px;
   }
   .side {
-    grid-template-rows: 1fr 200px;
+    grid-template-rows: minmax(0, 1fr) 200px;
   }
 }
 </style>

+ 1 - 1
src/features/OnlineExam/Examing/QuestionView.vue

@@ -1,6 +1,6 @@
 <template>
 
-  <div>
+  <div style="overflow: auto">
     <div class="question-header">
       <Icon :type="examQuestion.isSign ? 'ios-star':'ios-star-outline'" :style="{color: '#ffcc00'}" class="star" @click="toggleSign" />
       <question-index :examQuestion="examQuestion" />

+ 2 - 0
src/features/OnlineExam/OnlineExamOverview.vue

@@ -104,6 +104,8 @@ export default {
     //   faceVerifyMinute: null
     // };
     // this.examRcordId = this.startInfo.id;
+
+    document.body.style = "";
   },
   beforeDestroy() {
     clearInterval(this.intervalId);