Преглед на файлове

fix in code btn,update in photoGet

171250600 преди 5 години
родител
ревизия
0fcd8fc7b2

+ 5 - 1
monitor.md

@@ -1,3 +1,7 @@
 如果要取消监考,只要将exampane中的monitor方法中的具体内容注释掉。
 
-如果输入出现问题,可以先注释掉exampane中的focusauto。
+如果输入出现问题,可以先注释掉exampane中的focusauto。
+
+2021/5/6
+
+考前确认界面添加了新的判断逻辑,只有后端接收到超过100张人脸照片后才会允许进入下一个页面,目前后端没有部署,建议这个页面刷新成不监考的页面然后进入下一页面

+ 4 - 2
src/views/exam/ExamPane.vue

@@ -567,8 +567,9 @@ export default Vue.extend({
             if ((InputFocus as any).codeFlag == 1) {
               _this.flag = _this.flag - 1
               _this.visible1 = true
+              //alert("examp0")
             }
-          }, 100)
+          }, 1)
         } else if (
           this.flag == 1 &&
           this.vCardFlag == 1 &&
@@ -579,10 +580,11 @@ export default Vue.extend({
               _this.allowNum = _this.allowNum - 1
               //alert(y);
               _this.visible = true
+              //alert("examp1")
               _this.changeFlagTo0()
               _this.timeCount()
             }
-          }, 100)
+          }, 10)
         }
         //document.getElementById("demo").innerHTML = y;
       }

+ 8 - 1
src/views/exam/PhotoGet.vue

@@ -136,7 +136,7 @@ export default Vue.extend({
           console.log(videoTracks)
           // 摄像头开启成功
           ;(this.$refs['video'] as any).srcObject = success
-          this.cameraReady = true
+          //this.cameraReady = true
           // 实时拍照效果
           ;(this.$refs['video'] as any).play()
           this.interval = setInterval(this.photoCount, 1000)
@@ -185,6 +185,13 @@ export default Vue.extend({
           //this.imageUrl = res.data.url;
           // this.backgroundUrl = res.data.backgroundUrl;
         })
+        .catch((err)=>{
+          let r = err.data
+          if(r == 1){
+            this.cameraReady = true
+          }
+          console.log(r);
+        })
     }
   },
   beforeDestroy() {

+ 1 - 1
src/views/exam/components/BlankPane.vue

@@ -72,7 +72,7 @@ export default Vue.extend({
         } else {
           ;(InputFocus as any).InputFlag = 1
         }
-      }, 500)
+      }, 2)
     }
   },
   beforeUpdate() {

+ 4 - 4
src/views/exam/components/CodeEditor.vue

@@ -92,14 +92,14 @@ export default Vue.extend({
     CodeMonitor() {
       let _this = this
       setTimeout(function() {
-        if ((InputFocus as any).ExamFlag == 0) {
-          _this.changeCodeFlagTo1()
-          ;(InputFocus as any).cheatFlag = 1
+        if ((InputFocus as any).ExamFlag == 0&&InputFocus.InputFlag == 1) {
+          _this.changeCodeFlagTo1();
+          //(InputFocus as any).cheatFlag = 1
           _this.$emit('focusAuto')
         } else {
           ;(InputFocus as any).codeFlag = 1
         }
-      }, 500)
+      }, 2)
     },
 
     initMonaco() {

+ 22 - 10
src/views/exam/components/CodePane.vue

@@ -104,11 +104,12 @@
                           @click="onShowCode(item.submitAnswer)"
                           @mousedown="
                             changeExamFlagTo1()
-                            preventBlur($event)
+                            changeInputFlagTo0()
+                            changeExamFlagTo1()                         
                           "
                           >详情</v-btn
                         >
-                        <v-tooltip top>
+                        <v-tooltip top >
                           <template v-slot:activator="{ on, attrs }">
                             <v-btn
                               id="rollbackBtn"
@@ -119,8 +120,9 @@
                               outlined
                               @click="onOpenRollbackDialog(item.submitAnswer)"
                               @mousedown="
+                                changeExamFlagTo1()
                                 changeInputFlagTo0()
-                                changeExamFlagTo0()
+                                changeExamFlagTo1()   
                               "
                               v-bind="attrs"
                               v-on="on"
@@ -228,7 +230,11 @@
       <v-card class="pt-3">
         <v-card-title
           >代码详情
-          <v-btn @click="showCode = false" x-small class="mx-2" tile plain
+          <v-btn @click="showCode = false" 
+              @mousedown="
+              changeExamFlagTo1()
+              MonitorLater()" 
+              x-small class="mx-2" tile plain
             >CLOSE</v-btn
           >
         </v-card-title>
@@ -238,7 +244,6 @@
     <v-dialog
       max-width="300"
       v-model="rollbackCodeDialog"
-      @blur="InputMonitor()"
     >
       <v-card>
         <v-card-title>确认恢复代码</v-card-title>
@@ -248,9 +253,8 @@
             color="success darken-1"
             @click="onRollback"
             @mousedown="
-              preventBlur($event)
               changeExamFlagTo1()
-              InputMonitor()
+              MonitorLater()
             "
           >
             确定
@@ -262,7 +266,7 @@
             @mousedown="
               preventBlur($event)
               changeExamFlagTo1()
-              InputMonitor()
+              MonitorLater()
             "
           >
             取消
@@ -393,7 +397,8 @@ export default Vue.extend({
       //alert((InputFocus as any).InputFlag);
     },
     changeInputFlagTo1() {
-      ;(InputFocus as any).InputFlag = 1
+      ;(InputFocus as any).InputFlag = 1      
+      //alert("who")
     },
     changeExamFlagTo0() {
       ;(InputFocus as any).ExamFlag = 0
@@ -409,11 +414,18 @@ export default Vue.extend({
         if ((InputFocus as any).ExamFlag == 0) {
           ;(InputFocus as any).InputFlag = 1
           ;(InputFocus as any).cheatFlag = 1
+          //alert("cheat")
           _this.$emit('focusAuto')
         } else {
           ;(InputFocus as any).InputFlag = 1
+          //_this.$emit('focusAuto')
+          //alert("to1")
         }
-      }, 500)
+      }, 5)
+    },
+
+    MonitorLater(){
+      setTimeout(this.InputMonitor,500);
     },
 
     onShowCode(content: string) {