林旭祥 преди 8 месеца
родител
ревизия
e57cc3fa38
променени са 4 файла, в които са добавени 100 реда и са изтрити 34 реда
  1. 45 0
      src/assets/styles/index.scss
  2. 4 4
      src/plugins/modal.ts
  3. 1 1
      src/views/train/run.vue
  4. 50 29
      src/views/train/test.vue

+ 45 - 0
src/assets/styles/index.scss

@@ -49,6 +49,51 @@ ul li {
     }
   }
 }
+.messageBoxClass {
+  background: radial-gradient(96% 96% at 2% 32%, #ffffff 0%, #fcfdfd 54%, #e1e4e7 100%);
+  width: 40% !important;
+  --el-messagebox-width: auto !important;
+  height: auto !important;
+  --el-messagebox-height: 40% !important;
+  border-radius: 1.6rem !important;
+  border: 0.55rem solid #13ed84;
+  .el-message-box__header {
+    color: #000000;
+    padding-top: 2%;
+    padding-bottom: 0%;
+    font-size: 1.2rem;
+  }
+  .el-message-box__content {
+    height: 20vh;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    font-size: 2.3rem;
+    color: #1a293a;
+  }
+  .btn-custom-cancel {
+    color: #1a293a;
+    padding: 3.5% 12%;
+    font-size: 1.6rem;
+    border: 1px solid #c9c4c4;
+    box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.5577);
+    &:hover {
+      color: #1a293a;
+    }
+  }
+  .btn-custom-confirm {
+    color: #1a293a;
+    background: radial-gradient(141% 126% at 5% 93%, #8effa9 0%, #07ffe7 100%);
+    box-shadow: inset 0px 1px 0px 2px rgba(255, 255, 255, 0.5577);
+    --el-button-border-color: none;
+    padding: 3.5% 12%;
+    font-size: 1.6rem;
+    border: 1px solid #c9c4c4;
+    &:hover {
+      color: #1a293a;
+    }
+  }
+}
 
 .basketballv1 {
   .el-loading-spinner {

+ 4 - 4
src/plugins/modal.ts

@@ -53,8 +53,8 @@ export default {
   // 确认窗体
   confirm(content: any): Promise<MessageBoxData> {
     return ElMessageBox.confirm(content, '系统提示', {
-      confirmButtonText: '确定',
-      cancelButtonText: '取消',
+      confirmButtonText: '确 定',
+      cancelButtonText: '取 消',
       type: 'warning',
       center: true,
       draggable: true,
@@ -66,8 +66,8 @@ export default {
   // 提交内容
   prompt(content: any) {
     return ElMessageBox.prompt(content, '系统提示', {
-      confirmButtonText: '确定',
-      cancelButtonText: '取消',
+      confirmButtonText: '确 定',
+      cancelButtonText: '取 消',
       type: 'warning'
     });
   },

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

@@ -4,7 +4,7 @@
     <Transition :enter-active-class="proxy?.animate.dialog.enter" :leave-active-class="proxy?.animate.dialog.leave">
       <div class="time" v-show="[42].includes(examState)">{{
         countdownNumFormat
-        }}</div>
+      }}</div>
     </Transition>
     <div class="main">
       <template v-if="isLongRun">

+ 50 - 29
src/views/train/test.vue

@@ -21,7 +21,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" />
@@ -157,7 +157,7 @@ const getMessage = (e: any) => {
   //console.log("WS响应:", e)
   //获取sid
   if (e.cmd === 'mySid') {
-    console.log("e.data.sid", e.data.id)
+    console.log("e.data.sid", e.data.sid)
     sid.value = e.data.sid;
   }
   //实时状态
@@ -170,11 +170,18 @@ const getMessage = (e: any) => {
   }
   //测试违规
   if (e.cmd === 'warning_result') {
-
+    console.log("eeeeeeeeeee", e)
+    if ((e.status + "")[0] === "2") {
+      proxy?.$modal.msgError(e.data.message);
+      speckText(e.data.message);
+    }
   }
   //后端播报语音
   if (e.cmd === 'return_audio_msg') {
-
+    if (e.data.message) {
+      proxy?.$modal.msgError(e.data.message);
+      speckText(e.data.message);
+    }
   }
   //错误提示
   if (e.cmd === 'info_result') {
@@ -186,7 +193,14 @@ const getMessage = (e: any) => {
   }
   //测试中违规提示
   if (e.cmd === 'warning_notify') {
-
+    let message = e.data.message;
+    if (message) {
+      proxy?.$modal.msgError(message);
+      speckText(message);
+    }
+    if (message == "工作站已断开!") {
+      getExit();
+    }
   }
   //断线状态
   if (e.cmd === 'disconnect_request') {
@@ -202,10 +216,6 @@ const getMessage = (e: any) => {
     examState.value = e.data;
     if (e.data === 3) {
       initProject();
-      if (faceCheckStu.value.student_id) {
-        reportListRef.value.getIniReportList();
-        faceWindowRef.value.open("right");
-      }
     }
     if (e.data === 40) {
       cleanData();
@@ -512,7 +522,8 @@ const getCounting = (type: string) => {
 /**
  * 人脸窗口
 */
-const getFaceWindow = (data: boolean) => {
+const getFaceWindow = (data: boolean, num: number = 0) => {
+  let total = num + 1;//叠加三次后不再播放
   let txt = parameter.value.gesture === true ? "请举右手看摄像头人脸识别" : "请看摄像头进行人脸识别";
   speckText(txt);
   //data=true为弹出框,data=false为不要弹出框
@@ -526,12 +537,13 @@ const getFaceWindow = (data: boolean) => {
     }, 3000)
   }
   //定时检查如果一直停留在人脸识别就提示
+  let timeout = 15000;
   timerManager.value.face = setInterval(() => {
     getClearTimer("face");
-    if (examState.value == 41) {
-      getFaceWindow(false);
+    if (examState.value == 41 && total < 3) {
+      getFaceWindow(false, total);
     }
-  }, 15000)
+  }, timeout)
 };
 
 /**
@@ -566,14 +578,17 @@ const getAchievement = (data: any) => {
     if (['jump', 'longjump', 'verticaljump'].includes(type)) {
       if (data?.startline_check == 0) {
         let txt = "踩线违规";
+        speckText(txt);
         arr.push(txt)
       }
       if (data?.singleleg_jump_check == 0) {
         let txt = "单脚跳违规";
+        speckText(txt);
         arr.push(txt)
       }
       if (data?.outside_check == 0) {
         let txt = "跳出测试区违规";
+        speckText(txt);
         arr.push(txt)
       }
     }
@@ -581,6 +596,7 @@ const getAchievement = (data: any) => {
       data?.elbow_check == false
     ) {
       let txt = "肘部违规";
+      speckText(txt);
       arr.push(txt);
     }
     if (
@@ -588,39 +604,42 @@ const getAchievement = (data: any) => {
       data?.knee_check === false
     ) {
       let txt = "腿部违规";
-      if (!arr.includes(txt)) {
-        arr.push(txt);
-      }
+      speckText(txt);
+      if (!arr.includes(txt)) { }
+      arr.push(txt);
+
     }
     if (["situp"].indexOf(type) > -1 && data?.hand_check === false) {
       let txt = "手部违规";
-      if (!arr.includes(txt)) {
-        arr.push(txt);
-      }
+      speckText(txt);
+      if (!arr.includes(txt)) { }
+      arr.push(txt);
     }
     if (
       ["pullup"].indexOf(type) > -1 &&
       data?.["0"]?.elbow_check === false
     ) {
       let txt = "手部违规";
-      if (!arr.includes(txt)) {
-        arr.push(txt);
-      }
+      speckText(txt);
+      if (!arr.includes(txt)) { }
+      arr.push(txt);
+
     }
     if (["situp"].indexOf(type) > -1 && data?.["0"]?.back_check === false) {
       let txt = "背部违规";
-      if (!arr.includes(txt)) {
-        arr.push(txt);
-      }
+      speckText(txt);
+      if (!arr.includes(txt)) { }
+      arr.push(txt);
+
     }
     if (
       ["sidepullup", "situp"].indexOf(type) > -1 &&
       data?.["0"]?.hip_check === false
     ) {
       let txt = "臀部违规";
-      if (!arr.includes(txt)) {
-        arr.push(txt);
-      }
+      speckText(txt);
+      if (!arr.includes(txt)) { }
+      arr.push(txt);
     }
   }
   backReason.value = arr;
@@ -635,6 +654,8 @@ const getAchievement = (data: any) => {
     } else {
       speckText(faceCheckStu?.value.name + "成绩为" + (chineseNumber(count) || 0) + unit.value + ",请下一位准备!" || "");
     }
+    reportListRef.value.getIniReportList();
+    faceWindowRef.value.open("right");
     //然后定时自动关闭
     setTimeout(() => {
       faceWindowRef.value.close();
@@ -760,7 +781,7 @@ watch(() => time.value.countdownNum, (newData) => {
 /**
  * 成绩整数播报
 */
-watch(() => currentResultObj, (newData: any, oldData: any) => {
+watch(() => currentResultObj.value, (newData: any, oldData: any) => {
   if (examState.value != 42 || newData.count <= 0) {
     return false;
   }