|
@@ -1,17 +1,27 @@
|
|
<template>
|
|
<template>
|
|
- <div>成绩:{{ currentResultObj.count }} {{ unit }}</div>
|
|
|
|
- <div>得分:{{ currentResultObj.score }}</div>
|
|
|
|
- <div @click="getProcess">走一套流程({{ examState == 3 ? "创建测试" : examState == 40 ? "开始人脸识别" : examState == 41 ? "停止人脸识别" :
|
|
|
|
- examState ==
|
|
|
|
- 43 ? "开始测试" : examState == 42 ? "正在测试" : "请初始化" }})</div>
|
|
|
|
- <div @click="getOpenOneTestAndStartFace" v-if="examState == 3 || examState == 40">开始人脸识别</div>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <div><el-avatar :src="faceCheckStu.logo_url || faceCheckStu.face_pic" @click="getChooseStudent" /></div>
|
|
|
|
+ <div>{{ faceCheckStu.name }}</div>
|
|
|
|
+ <div>成绩:{{ currentResultObj.count }} {{ unit }}</div>
|
|
|
|
+ <div>得分:{{ currentResultObj.score }}</div>
|
|
|
|
+ <div @click="getProcess">走一套流程({{ examState == 3 ? "创建测试" : examState == 40 ? "开始人脸识别" : examState == 41 ? "停止人脸识别"
|
|
|
|
+ :
|
|
|
|
+ examState ==
|
|
|
|
+ 43 ? "开始测试" : examState == 42 ? "正在测试" : "请初始化" }})</div>
|
|
|
|
+ <div @click="getOpenOneTestAndStartFace" v-if="examState == 3 || examState == 40">1、开始人脸识别</div>
|
|
|
|
|
|
- <div @click="getStopFace" v-if="examState == 41">停止人脸识别</div>
|
|
|
|
|
|
+ <div @click="getChooseStudent">2、选择学生</div>
|
|
|
|
+ <div @click="getStopFace" v-if="examState == 41">3、停止人脸识别</div>
|
|
|
|
|
|
- <div @click="getStartOneTest" v-if="examState == 43">开始测试</div>
|
|
|
|
|
|
+ <div @click="getStartOneTest" v-if="examState == 43">4、开始测试</div>
|
|
|
|
|
|
- <div @click="getRetest" v-if="examState == 3 || examState == 42">再测一次</div>
|
|
|
|
- <div @click="confirmExit">退出</div>
|
|
|
|
|
|
+ <div @click="getRetest" v-if="examState == 3 || examState == 42">再测一次</div>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <div @click="confirmExit">退出</div>
|
|
|
|
+
|
|
|
|
+ <ChooseStudent ref="chooseStudentRef" @back="backStudent" />
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup name="TrainTest" lang="ts">
|
|
<script setup name="TrainTest" lang="ts">
|
|
@@ -20,6 +30,7 @@ import dataDictionary from "@/utils/dataDictionary"
|
|
const { proxy } = getCurrentInstance() as any;
|
|
const { proxy } = getCurrentInstance() as any;
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
|
+const chooseStudentRef = ref();
|
|
const data = reactive<any>({
|
|
const data = reactive<any>({
|
|
timerManager: {},//计时器管理
|
|
timerManager: {},//计时器管理
|
|
parameter: {},//参数
|
|
parameter: {},//参数
|
|
@@ -29,8 +40,9 @@ const data = reactive<any>({
|
|
result_id: null,//测试ID
|
|
result_id: null,//测试ID
|
|
currentResultObj: {},//成绩
|
|
currentResultObj: {},//成绩
|
|
unit: "",//单位
|
|
unit: "",//单位
|
|
|
|
+ faceCheckStu: {},//人脸信息
|
|
});
|
|
});
|
|
-const { timerManager, parameter, testTime, userInfo, examState, result_id, currentResultObj, unit } = toRefs(data);
|
|
|
|
|
|
+const { timerManager, parameter, testTime, userInfo, examState, result_id, currentResultObj, unit, faceCheckStu } = toRefs(data);
|
|
|
|
|
|
//接收消息
|
|
//接收消息
|
|
const getMessage = (e: any) => {
|
|
const getMessage = (e: any) => {
|
|
@@ -77,6 +89,7 @@ const getMessage = (e: any) => {
|
|
}
|
|
}
|
|
//人脸识别状态
|
|
//人脸识别状态
|
|
if (e.cmd === 'face_check_result') {
|
|
if (e.cmd === 'face_check_result') {
|
|
|
|
+ faceCheckStu.value = e.data[0] || e.data;
|
|
}
|
|
}
|
|
//测试结束结果
|
|
//测试结束结果
|
|
if (e.cmd === 'oneresult') {
|
|
if (e.cmd === 'oneresult') {
|
|
@@ -94,7 +107,6 @@ const getMessage = (e: any) => {
|
|
}
|
|
}
|
|
data.count = count || "0";
|
|
data.count = count || "0";
|
|
data.score = data.score || "0";
|
|
data.score = data.score || "0";
|
|
-
|
|
|
|
currentResultObj.value = data;
|
|
currentResultObj.value = data;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -148,8 +160,8 @@ const getStopFace = () => {
|
|
stopFace();
|
|
stopFace();
|
|
faceConfirmOnly({
|
|
faceConfirmOnly({
|
|
result_id: result_id.value,
|
|
result_id: result_id.value,
|
|
- student_id: 1,
|
|
|
|
- gender: 1
|
|
|
|
|
|
+ student_id: faceCheckStu.value.student_id,
|
|
|
|
+ gender: faceCheckStu.value.gender
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
|
|
@@ -191,7 +203,7 @@ const getRetest = () => {
|
|
};
|
|
};
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 退出
|
|
|
|
|
|
+ * 确认退出
|
|
*/
|
|
*/
|
|
const confirmExit = () => {
|
|
const confirmExit = () => {
|
|
proxy?.$modal.confirm("确定退出吗?").then(() => {
|
|
proxy?.$modal.confirm("确定退出吗?").then(() => {
|
|
@@ -222,6 +234,23 @@ const getClearTimer = () => {
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * 选择学生
|
|
|
|
+*/
|
|
|
|
+const getChooseStudent = () => {
|
|
|
|
+ if (examState.value != 41) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ chooseStudentRef.value.open();
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 被选学生
|
|
|
|
+*/
|
|
|
|
+const backStudent = (data: any) => {
|
|
|
|
+ faceCheckStu.value = data;
|
|
|
|
+};
|
|
|
|
+
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
parameter.value = route.query;
|
|
parameter.value = route.query;
|
|
parameter.value.examId = `${parameter.value.project}_${parameter.value.area}`; //项目+区
|
|
parameter.value.examId = `${parameter.value.project}_${parameter.value.area}`; //项目+区
|