林旭祥 пре 9 месеци
родитељ
комит
6f13b26e33

+ 1 - 1
src/components/ChooseStudent/index.vue

@@ -171,7 +171,7 @@ const handleSelectionChange = (data: any) => {
 //确定
 const confirm = () => {
   if (!selectValue.value.id) {
-    proxy?.$modal.msgError(`请选择!`);
+    proxy?.$modal.msgWarning(`请选择!`);
     return false;
   }
   close();

+ 1 - 1
src/components/FaceWindow/index.vue

@@ -59,7 +59,7 @@ const open = (data?: any) => {
 };
 
 //关闭
-const close = (type?: any) => {
+const close = () => {
   faceState.value = false;
 };
 

+ 2 - 2
src/views/train/multiple.vue

@@ -74,7 +74,7 @@ const getStopFace = async () => {
   //   }
   // }
   // if (!flag) {
-  //   proxy?.$modal.msgError("请选择人员!");
+  //   proxy?.$modal.msgWarning("请选择人员!");
   //   return false;
   // }
   examState.value = 43;
@@ -97,7 +97,7 @@ const getStartOneTest = () => {
     }
   }
   if (!flag) {
-    proxy?.$modal.msgError("请选择人员!");
+    proxy?.$modal.msgWarning("请选择人员!");
     return false;
   }
   examState.value = 42;

+ 2 - 2
src/views/train/run.vue

@@ -226,7 +226,7 @@ const getStartOneTest = () => {
     return item.student_id;
   })
   if (!list.length) {
-    proxy?.$modal.msgError("请选择人员!");
+    proxy?.$modal.msgWarning("请选择人员!");
     return false;
   }
   startOneTest(data == null, () => {
@@ -313,7 +313,7 @@ const getClearTimer = (data?: any) => {
 */
 const getChooseStudent = (track: number) => {
   if (examState.value < 41) {
-    proxy?.$modal.msgError("请点击开始人脸识别");
+    proxy?.$modal.msgWarning("请点击开始人脸识别");
     return false;
   }
   currentTrack.value = track;

+ 25 - 13
src/views/train/test.vue

@@ -31,7 +31,7 @@
               :leave-active-class="proxy?.animate.dialog.leave">
               <div class="time" v-show="needStart && [42].includes(examState)">{{
                 time.countdownNum
-              }}</div>
+                }}</div>
             </transition>
             <div class="tips" v-if="examState == 41">
               <img v-if="parameter.gesture" src="@/assets/images/test/ready1.png" />
@@ -56,10 +56,13 @@
             </div>
 
             <div class="foulBox" v-if="examState == 42 && backReason.length">
-              <div class="foul" v-for="(item, index) in backReason" :key="index">
-                <div class="lable">!</div>
-                <div class="value">{{ item }}</div>
-              </div>
+              <transition :enter-active-class="proxy?.animate.mask.enter"
+                :leave-active-class="proxy?.animate.mask.leave">
+                <div class="foul" v-show="backReasonStr ? true : false">
+                  <div class="lable">!</div>
+                  <div class="value">{{ backReasonStr }}</div>
+                </div>
+              </transition>
             </div>
 
             <div v-if="examState == 43 && time.ready">
@@ -86,8 +89,6 @@
               </div>
             </div>
 
-
-
             <div class="btn" @click="getReady" v-if="needStart && examState == 43 && !time.ready">开 始</div>
             <!-- <div v-if="needStart"> -->
             <!-- <div class="btn" @click="getOpenOneTestAndStartFace" v-if="examState == 3 || examState == 40">开始识别</div> -->
@@ -166,12 +167,13 @@ const data = reactive<any>({
   faceCheckStu: {},//人脸信息
   unit: "",//单位
   backReason: [],//犯规项
+  backReasonStr: "",//犯规提示
   needStart: false,//是否需要按钮
   showTestAgain: false,//再测一次按钮
   reportList: [],//测试列表
   date: "",//当前时间
 });
-const { timerManager, parameter, time, userInfo, examState, resultId, faceCheckStu, currentResultObj, unit, backReason, needStart, showTestAgain, reportList, date } = toRefs(data);
+const { timerManager, parameter, time, userInfo, examState, resultId, faceCheckStu, currentResultObj, unit, backReason, backReasonStr, needStart, showTestAgain, reportList, date } = toRefs(data);
 
 /**
  * 接收消息
@@ -226,7 +228,6 @@ const getMessage = (e: any) => {
       getFaceWindow(true);
     }
     if (e.data == 43) {
-
     }
     if (e.data == 42) {
       getClearTimer("readyTimer");
@@ -277,7 +278,9 @@ const getStopFace = async () => {
   //   return false;
   // }
   getClearTimer("face");
-  speckText(faceCheckStu.value.name + ",请准备");
+  if (needStart.value) {
+    speckText(faceCheckStu.value.name + parameter.value.gesture ? ",请举手开始测试" : ",请准备");
+  }
   await stopFace();
   if (faceCheckStu.value.student_id) {
     getFaceConfirmOnly();
@@ -421,7 +424,7 @@ const getClearTimer = (data?: any) => {
 */
 const getChooseStudent = () => {
   if (examState.value < 41) {
-    proxy?.$modal.msgError("请等待");
+    proxy?.$modal.msgWarning("请等待");
   }
   if (examState.value == 41) {
     chooseStudentRef.value.open();
@@ -621,7 +624,6 @@ const getAchievement = (data: any) => {
       }
     }
   }
-  arr.push("哈哈哈哈");
   backReason.value = arr;
   if (data.isfinish) {
     if (['jump'].includes(type) && backReason.value.length) {
@@ -680,7 +682,7 @@ const getReady = () => {
   time.value.ready = 5;
   speckText(time.value.ready);
   timerManager.value.readyTimer = setInterval(() => {
-    if (time.value.ready <= 1) {
+    if (time.value.ready <= 0) {
       getClearTimer("readyTimer");
       getStartOneTest();
     } else {
@@ -690,6 +692,16 @@ const getReady = () => {
   }, 1000);
 };
 
+/**
+ * 输出犯规
+*/
+watch(() => backReason.value.length, (v) => {
+  backReasonStr.value = backReason.value[backReason.value.length - 1];
+  setTimeout(() => {
+    backReasonStr.value = "";
+  }, 1500)
+}, { immediate: true });
+
 onMounted(() => {
   setDate();
   parameter.value = route.query;