|
@@ -4,7 +4,7 @@
|
|
<Transition :enter-active-class="proxy?.animate.dialog.enter" :leave-active-class="proxy?.animate.dialog.leave">
|
|
<Transition :enter-active-class="proxy?.animate.dialog.enter" :leave-active-class="proxy?.animate.dialog.leave">
|
|
<div class="time" v-show="[42].includes(examState)">{{
|
|
<div class="time" v-show="[42].includes(examState)">{{
|
|
countdownNumFormat
|
|
countdownNumFormat
|
|
- }}</div>
|
|
|
|
|
|
+ }}</div>
|
|
</Transition>
|
|
</Transition>
|
|
<div class="main">
|
|
<div class="main">
|
|
<template v-if="isLongRun">
|
|
<template v-if="isLongRun">
|
|
@@ -117,7 +117,6 @@
|
|
<script setup name="TrainTest" lang="ts">
|
|
<script setup name="TrainTest" lang="ts">
|
|
import { initSpeech, speckText, speckCancel, chineseNumber } from '@/utils/speech'
|
|
import { initSpeech, speckText, speckCancel, chineseNumber } from '@/utils/speech'
|
|
import { initWs, examEnds, openOneTest, startFace, stopFace, faceConfirmOnly, startOneTest, finishOneTest, closeOneTest, suspendFaceRecognitionChannels, resumeFaceRecognitionChannels } from '@/utils/ws'
|
|
import { initWs, examEnds, openOneTest, startFace, stopFace, faceConfirmOnly, startOneTest, finishOneTest, closeOneTest, suspendFaceRecognitionChannels, resumeFaceRecognitionChannels } from '@/utils/ws'
|
|
-import { handWs } from '@/utils/handController'
|
|
|
|
import dayjs from 'dayjs'
|
|
import dayjs from 'dayjs'
|
|
import dataDictionary from "@/utils/dataDictionary"
|
|
import dataDictionary from "@/utils/dataDictionary"
|
|
import { Swiper, SwiperSlide } from 'swiper/vue';
|
|
import { Swiper, SwiperSlide } from 'swiper/vue';
|
|
@@ -146,9 +145,8 @@ const data = reactive<any>({
|
|
showTestAgain: false,//再测一次按钮
|
|
showTestAgain: false,//再测一次按钮
|
|
isLongRun: false,//是否为长跑项目
|
|
isLongRun: false,//是否为长跑项目
|
|
isBackRun: false,//是否为折返跑项目
|
|
isBackRun: false,//是否为折返跑项目
|
|
- exit: 0,//退出响应次数
|
|
|
|
});
|
|
});
|
|
-const { timerManager, parameter, time, userInfo, examState, resultId, faceStudentList, currentTrack, unit, needStart, showTestAgain, isLongRun, isBackRun, exit } = toRefs(data);
|
|
|
|
|
|
+const { timerManager, parameter, time, userInfo, examState, resultId, faceStudentList, currentTrack, unit, needStart, showTestAgain, isLongRun, isBackRun } = toRefs(data);
|
|
|
|
|
|
/**
|
|
/**
|
|
* 接收消息
|
|
* 接收消息
|
|
@@ -772,69 +770,6 @@ const faceStudentListLongRun: any = computed(() => {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
-/**
|
|
|
|
- * 加载手势WS
|
|
|
|
-*/
|
|
|
|
-const initHand = () => {
|
|
|
|
- handWs((e: any) => {
|
|
|
|
- //左滑动
|
|
|
|
- if (e.data.result == "next_item") {
|
|
|
|
- }
|
|
|
|
- //举左手
|
|
|
|
- if (e.data.result == "left_hand") {
|
|
|
|
- getStartOneTest();
|
|
|
|
- }
|
|
|
|
- //退出
|
|
|
|
- if (e.data.result == "exit") {
|
|
|
|
- // console.log("exit.value", exit.value)
|
|
|
|
- if (exit.value == 0) {
|
|
|
|
- console
|
|
|
|
- //第一次才弹出
|
|
|
|
- confirmExit();
|
|
|
|
- setTimeout(() => {
|
|
|
|
- let keyEvent = null;
|
|
|
|
- let myKey = null;
|
|
|
|
- //如果交叉手两秒后返回超过4次就确认退出
|
|
|
|
- if (exit.value >= 4) {
|
|
|
|
- myKey = 'Enter';
|
|
|
|
- } else {
|
|
|
|
- myKey = 'Esc';
|
|
|
|
- exit.value = 0;
|
|
|
|
- }
|
|
|
|
- if (myKey == 'Esc') {
|
|
|
|
- keyEvent = new KeyboardEvent('keydown', {
|
|
|
|
- key: 'Escape', // 键值
|
|
|
|
- code: 'Escape', // 键盘代码
|
|
|
|
- keyCode: 27, // 旧的键盘代码
|
|
|
|
- which: 27, // 新的键盘代码
|
|
|
|
- shiftKey: false, // 是否按下Shift键
|
|
|
|
- ctrlKey: false, // 是否按下Ctrl键
|
|
|
|
- metaKey: false, // 是否按下Meta键(Win键或Command键)
|
|
|
|
- bubbles: true, // 事件是否冒泡
|
|
|
|
- cancelable: true // 是否可以取消事件的默认行为
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- if (myKey == 'Enter') {
|
|
|
|
- keyEvent = new KeyboardEvent('keydown', {
|
|
|
|
- key: 'Enter', // 键值
|
|
|
|
- code: 'Enter', // 键盘代码
|
|
|
|
- keyCode: 13, // 旧的键盘代码
|
|
|
|
- which: 13, // 新的键盘代码
|
|
|
|
- shiftKey: false, // 是否按下Shift键
|
|
|
|
- ctrlKey: false, // 是否按下Ctrl键
|
|
|
|
- metaKey: false, // 是否按下Meta键(Win键或Command键)
|
|
|
|
- bubbles: true, // 事件是否冒泡
|
|
|
|
- cancelable: true // 是否可以取消事件的默认行为
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- document.activeElement.dispatchEvent(keyEvent);
|
|
|
|
- }, 2500)
|
|
|
|
- }
|
|
|
|
- exit.value = exit.value + 1
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
onBeforeMount(() => {
|
|
onBeforeMount(() => {
|
|
parameter.value = route.query;
|
|
parameter.value = route.query;
|
|
let project = parameter.value.project;
|
|
let project = parameter.value.project;
|
|
@@ -870,8 +805,6 @@ onBeforeMount(() => {
|
|
});
|
|
});
|
|
//初始化语音
|
|
//初始化语音
|
|
initSpeech();
|
|
initSpeech();
|
|
- //初始化手势
|
|
|
|
- initHand();
|
|
|
|
})
|
|
})
|
|
|
|
|
|
onUnmounted(() => {
|
|
onUnmounted(() => {
|