|
@@ -14,8 +14,8 @@
|
|
|
:class="{ 'overlap': (examState == 43 && time.ready) || [42].includes(examState) || (showTestAgain && ![41].includes(examState)), 'ready': [41].includes(examState), 'hands': parameter.gesture }"
|
|
|
v-for="(items, indexs) in testListArr " :key="indexs">
|
|
|
<MultipleItem :ref="(el: any) => { multipleItemRef(el, item.itemNumber, item.area) }"
|
|
|
- v-for="(item, index) in items" :query="parameter" :area="item.area" :key="index" @returnData="returnData" @getChooseStudent="getChooseStudent"
|
|
|
- :examState="examState" :needStart="needStart" :styleType="styleType" />
|
|
|
+ v-for="(item, index) in items" :query="parameter" :area="item.area" :key="index" @returnData="returnData"
|
|
|
+ @getChooseStudent="getChooseStudent" :examState="examState" :needStart="needStart" :styleType="styleType" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -70,8 +70,8 @@
|
|
|
// 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';
|
|
|
-const { handWs,startDevice, startHand, stateHand } = useWebSocket();
|
|
|
+import { useWebSocket } from '@/utils/handWs';
|
|
|
+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();
|
|
@@ -97,10 +97,10 @@ const data = reactive<any>({
|
|
|
showReportList: false,//显示隐藏测试记录
|
|
|
exit: 0,//退出响应次数
|
|
|
sid: null,//WS的id
|
|
|
- chooseStudentArea:'',//弹出手动选择对应的区号
|
|
|
- device_info:{},//设备信息
|
|
|
+ chooseStudentArea: '',//弹出手动选择对应的区号
|
|
|
+ device_info: {},//设备信息
|
|
|
});
|
|
|
-const { timerManager, parameter, time, userInfo, examState, needStart, showTestAgain, testList, multipleItemRefList, styleType, showReportList, exit, sid, chooseStudentArea,device_info } = toRefs(data);
|
|
|
+const { timerManager, parameter, time, userInfo, examState, needStart, showTestAgain, testList, multipleItemRefList, styleType, showReportList, exit, sid, chooseStudentArea, device_info } = toRefs(data);
|
|
|
|
|
|
/**
|
|
|
* 创建组件实例
|
|
@@ -320,7 +320,7 @@ const getCounting = (type: string) => {
|
|
|
* 子组件选择学生
|
|
|
*/
|
|
|
const getChooseStudent = (data: any) => {
|
|
|
- console.log("data",data)
|
|
|
+ console.log("data", data)
|
|
|
chooseStudentArea.value = data;
|
|
|
chooseStudentRef.value.open();
|
|
|
}
|
|
@@ -329,12 +329,12 @@ const getChooseStudent = (data: any) => {
|
|
|
* 返回被选学生
|
|
|
*/
|
|
|
const returnStudent = (data: any) => {
|
|
|
- console.log("data",data)
|
|
|
+ console.log("data", data)
|
|
|
let area = chooseStudentArea.value.area;
|
|
|
let index = testList.value.findIndex((item: any) => {
|
|
|
- return area == item.area;
|
|
|
- })
|
|
|
- console.log("index",index)
|
|
|
+ return area == item.area;
|
|
|
+ })
|
|
|
+ console.log("index", index)
|
|
|
multipleItemRefList.value[index]?.returnStudent(data);
|
|
|
};
|
|
|
|
|
@@ -607,7 +607,7 @@ const getDevice = async () => {
|
|
|
*/
|
|
|
const initHand = () => {
|
|
|
handWs((e: any) => {
|
|
|
- if (router.currentRoute.value.path != '/train/multiple' || parameter.value.handcontroller == undefined){
|
|
|
+ if (router.currentRoute.value.path != '/train/multiple' || parameter.value.handcontroller == undefined) {
|
|
|
return false;
|
|
|
}
|
|
|
console.log("eeeee", e)
|
|
@@ -633,7 +633,7 @@ const initHand = () => {
|
|
|
window.location.reload()
|
|
|
}
|
|
|
//没初始化完成不监听手势动作
|
|
|
- if(examState.value == 0){
|
|
|
+ if (examState.value == 0) {
|
|
|
return false;
|
|
|
}
|
|
|
//左滑动
|
|
@@ -641,25 +641,25 @@ const initHand = () => {
|
|
|
}
|
|
|
//举左手
|
|
|
if (e?.data?.result == "left_hand") {
|
|
|
- //确认退出
|
|
|
- if (exit.value) {
|
|
|
- exit.value = 0;
|
|
|
- //确认退出
|
|
|
- let keyEvent: any = null;
|
|
|
- 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);
|
|
|
- return false;
|
|
|
- }
|
|
|
+//举左手确认退出
|
|
|
+// if (exit.value) {
|
|
|
+// exit.value = 0;
|
|
|
+// //确认退出
|
|
|
+// let keyEvent: any = null;
|
|
|
+// 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);
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
//开始识别
|
|
|
if (needStart.value && examState.value < 41) {
|
|
|
getOpenOneTestAndStartFace();
|
|
@@ -678,21 +678,22 @@ const initHand = () => {
|
|
|
}
|
|
|
//退出
|
|
|
if (e?.data?.result == "exit") {
|
|
|
- console.log("exit.value", exit.value)
|
|
|
+ // console.log("exit.value", exit.value)
|
|
|
if (exit.value == 0) {
|
|
|
- exit.value = 1
|
|
|
- speckText("请5秒内举左手确认退出");
|
|
|
+ speckText("请保持两秒确认退出");
|
|
|
//第一次才弹出
|
|
|
confirmExit();
|
|
|
- time.value.exit = 6;
|
|
|
- timerManager.value.exitTimer = setInterval(() => {
|
|
|
- time.value.exit--;
|
|
|
- console.log("取消倒计时", time.value.exit)
|
|
|
- proxy?.$modal.msgWarning(`取消倒计时:${time.value.exit}`)
|
|
|
- if (time.value.exit == 0) {
|
|
|
+ setTimeout(() => {
|
|
|
+ let keyEvent: any = null;
|
|
|
+ let myKey = null;
|
|
|
+ //如果交叉手两秒后返回超过4次就确认退出
|
|
|
+ if (exit.value >= 4) {
|
|
|
+ myKey = 'Enter';
|
|
|
+ } else {
|
|
|
+ myKey = 'Esc';
|
|
|
exit.value = 0;
|
|
|
- getClearTimer("exitTimer");
|
|
|
- let keyEvent: any = null;
|
|
|
+ }
|
|
|
+ if (myKey == 'Esc') {
|
|
|
keyEvent = new KeyboardEvent('keydown', {
|
|
|
key: 'Escape', // 键值
|
|
|
code: 'Escape', // 键盘代码
|
|
@@ -704,11 +705,57 @@ const initHand = () => {
|
|
|
bubbles: true, // 事件是否冒泡
|
|
|
cancelable: true // 是否可以取消事件的默认行为
|
|
|
});
|
|
|
- document.activeElement?.dispatchEvent(keyEvent);
|
|
|
}
|
|
|
- }, 1000);
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ // if (e?.data?.result == "exit") {
|
|
|
+ // console.log("exit.value", exit.value)
|
|
|
+ // if (exit.value == 0) {
|
|
|
+ // exit.value = 1
|
|
|
+ // speckText("请5秒内举左手确认退出");
|
|
|
+ // //第一次才弹出
|
|
|
+ // confirmExit();
|
|
|
+ // time.value.exit = 6;
|
|
|
+ // timerManager.value.exitTimer = setInterval(() => {
|
|
|
+ // time.value.exit--;
|
|
|
+ // console.log("取消倒计时", time.value.exit)
|
|
|
+ // proxy?.$modal.msgWarning(`取消倒计时:${time.value.exit}`)
|
|
|
+ // if (time.value.exit == 0) {
|
|
|
+ // exit.value = 0;
|
|
|
+ // getClearTimer("exitTimer");
|
|
|
+ // let keyEvent: any = null;
|
|
|
+ // 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 // 是否可以取消事件的默认行为
|
|
|
+ // });
|
|
|
+ // document.activeElement?.dispatchEvent(keyEvent);
|
|
|
+ // }
|
|
|
+ // }, 1000);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -1160,6 +1207,7 @@ $waiPadding: 6.51rem;
|
|
|
}
|
|
|
|
|
|
.disable {
|
|
|
+
|
|
|
.userInfo,
|
|
|
.score {
|
|
|
opacity: 0.5;
|
|
@@ -1167,6 +1215,7 @@ $waiPadding: 6.51rem;
|
|
|
}
|
|
|
|
|
|
.wait {
|
|
|
+
|
|
|
.userInfo,
|
|
|
.score {
|
|
|
opacity: 0.5;
|
|
@@ -1590,8 +1639,7 @@ $waiPadding: 6.51rem;
|
|
|
|
|
|
img {
|
|
|
max-width: 100%;
|
|
|
- max-height: 60%;
|
|
|
- margin: 5% 0 5% 0;
|
|
|
+ max-height: 60%; margin: 5% 0 5% 0;
|
|
|
}
|
|
|
|
|
|
.lable {
|