|
@@ -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" />
|
|
@@ -48,8 +48,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="foulBox" v-if="examState == 42 && backReason.length">
|
|
|
- <Transition :enter-active-class="proxy?.animate.mask.enter"
|
|
|
- :leave-active-class="proxy?.animate.mask.leave">
|
|
|
+ <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>
|
|
@@ -116,10 +115,10 @@
|
|
|
// import { useWs } from '@/utils/trainWs';
|
|
|
import { initWs, examEnds, openOneTest, startFace, stopFace, faceConfirmOnly, startOneTest, finishOneTest, closeOneTest, suspendFaceRecognitionChannels, resumeFaceRecognitionChannels } from '@/utils/ws'
|
|
|
import { initSpeech, speckText, playMusic, controlMusic, speckCancel, chineseNumber } from '@/utils/speech'
|
|
|
-import { useWebSocket } from '@/utils/handWs';
|
|
|
+import { useWebSocket } from '@/utils/handWs';
|
|
|
import dayjs from 'dayjs'
|
|
|
import dataDictionary from "@/utils/dataDictionary"
|
|
|
-const { handWs } = useWebSocket();
|
|
|
+const { handWs, startDevice, startHand, stateHand } = useWebSocket();
|
|
|
// const { initWs, examEnds, openOneTest, startFace, stopFace, faceConfirmOnly, startOneTest, finishOneTest, closeOneTest, suspendFaceRecognitionChannels, resumeFaceRecognitionChannels } = useWs();
|
|
|
const { proxy } = getCurrentInstance() as any;
|
|
|
const router = useRouter();
|
|
@@ -151,8 +150,9 @@ const data = reactive<any>({
|
|
|
readyState: true,//倒计时按钮状态
|
|
|
exit: 0,//退出响应次数
|
|
|
sid: null,//WS的id
|
|
|
+ device_info: {},//设备信息
|
|
|
});
|
|
|
-const { timerManager, parameter, time, userInfo, examState, resultId, faceCheckStu, currentResultObj, unit, backReason, backReasonStr, needStart, showTestAgain, readyState, exit, sid } = toRefs(data);
|
|
|
+const { timerManager, parameter, time, userInfo, examState, resultId, faceCheckStu, currentResultObj, unit, backReason, backReasonStr, needStart, showTestAgain, readyState, exit, sid, device_info } = toRefs(data);
|
|
|
|
|
|
/**
|
|
|
* 接收消息
|
|
@@ -695,14 +695,50 @@ const getReady = () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * 获取设备项目
|
|
|
+*/
|
|
|
+const getDevice = async () => {
|
|
|
+ let deviceid = localStorage.getItem("deviceid") || '';
|
|
|
+ if (deviceid) {
|
|
|
+ startDevice({ deviceid: deviceid })
|
|
|
+ } else {
|
|
|
+ proxy?.$modal.msgError(`缺少设备信息请重新登录!`);
|
|
|
+ await proxy?.$http.common.logout({}).then((res: any) => {
|
|
|
+ });
|
|
|
+ proxy?.$modal?.closeLoading()
|
|
|
+ //清空缓存
|
|
|
+ localStorage.clear();
|
|
|
+ //跳转
|
|
|
+ router.push({ path: '/login/qrcode' });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 加载手势WS
|
|
|
*/
|
|
|
const initHand = () => {
|
|
|
handWs((e: any) => {
|
|
|
- if (router.currentRoute.value.path != '/train/test'){
|
|
|
+ if (router.currentRoute.value.path != '/train/test') {
|
|
|
return false;
|
|
|
}
|
|
|
+ console.log("eeeee", e)
|
|
|
+ if (e?.wksid) {
|
|
|
+ //获取设备项目
|
|
|
+ getDevice()
|
|
|
+ }
|
|
|
+ //接收设备信息
|
|
|
+ if (e?.device_info) {
|
|
|
+ device_info.value = e.device_info;
|
|
|
+ let handcontroller_id = device_info.value.handcontroller_id;
|
|
|
+ stateHand(handcontroller_id);
|
|
|
+ }
|
|
|
+ //获取手势状态
|
|
|
+ if (e?.cmd == 'get_handcontroller_state' && e?.state == 0) {
|
|
|
+ let handcontroller_id = device_info.value.handcontroller_id;
|
|
|
+ startHand(handcontroller_id);
|
|
|
+ }
|
|
|
//左滑动
|
|
|
if (e?.data?.result == "next_item") {
|
|
|
}
|
|
@@ -711,6 +747,7 @@ const initHand = () => {
|
|
|
//开始识别
|
|
|
if (needStart.value && examState.value < 41) {
|
|
|
getOpenOneTestAndStartFace();
|
|
|
+ return false;
|
|
|
}
|
|
|
//停止人脸识别
|
|
|
// if (needStart.value && examState.value == 41) {
|
|
@@ -723,6 +760,7 @@ const initHand = () => {
|
|
|
} else {
|
|
|
getStartOneTest();
|
|
|
}
|
|
|
+ return false;
|
|
|
}
|
|
|
if (exit.value) {
|
|
|
exit.value = 0;
|