|
@@ -41,7 +41,11 @@ const emit = defineEmits(['returnData', 'getChooseStudent']);
|
|
|
|
|
|
//父值
|
|
|
const props = defineProps({
|
|
|
- parentMethod: {
|
|
|
+ parentTrainWsMethod: {
|
|
|
+ type: Object,
|
|
|
+ default: {}
|
|
|
+ },
|
|
|
+ parentSpeechMethod: {
|
|
|
type: Object,
|
|
|
default: {}
|
|
|
},
|
|
@@ -94,11 +98,18 @@ const getMessage = (e: any) => {
|
|
|
}
|
|
|
//测试违规
|
|
|
if (e.cmd === 'warning_result') {
|
|
|
-
|
|
|
+ console.log("eeeeeeeeeee", e)
|
|
|
+ if ((e.status + "")[0] === "2") {
|
|
|
+ proxy?.$modal.msgError(`【${area}】${e.data.message}`);
|
|
|
+ props.parentSpeechMethod.speckText(`${area}区,${e.data.message}`);
|
|
|
+ }
|
|
|
}
|
|
|
//后端播报语音
|
|
|
if (e.cmd === 'return_audio_msg') {
|
|
|
-
|
|
|
+ if (e.data.message) {
|
|
|
+ proxy?.$modal.msgError(`【${area}】${e.data.message}`);
|
|
|
+ props.parentSpeechMethod.speckText(`${area}区,${e.data.message}`);
|
|
|
+ }
|
|
|
}
|
|
|
//错误提示
|
|
|
if (e.cmd === 'info_result') {
|
|
@@ -119,7 +130,7 @@ const getMessage = (e: any) => {
|
|
|
let message = e.data.message;
|
|
|
if (message) {
|
|
|
proxy?.$modal.msgError(`【${area}】${message}`);
|
|
|
- //speckText(e.data.message);
|
|
|
+ //props.parentSpeechMethod.speckText(e.data.message);
|
|
|
}
|
|
|
}
|
|
|
//状态变更
|
|
@@ -174,10 +185,10 @@ const getOpenOneTestAndStartFace = async () => {
|
|
|
}
|
|
|
console.log("examId", examId)
|
|
|
if (examState.value > 3) {
|
|
|
- await props.parentMethod.closeOneTest(examId);
|
|
|
+ await props.parentTrainWsMethod.closeOneTest(examId);
|
|
|
}
|
|
|
- await props.parentMethod.openOneTest(examId);
|
|
|
- await props.parentMethod.startFace(examId);
|
|
|
+ await props.parentTrainWsMethod.openOneTest(examId);
|
|
|
+ await props.parentTrainWsMethod.startFace(examId);
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -192,7 +203,7 @@ const getStopFace = async () => {
|
|
|
// return false;
|
|
|
// }
|
|
|
if (examState.value == 41) {
|
|
|
- await props.parentMethod.stopFace(examId);
|
|
|
+ await props.parentTrainWsMethod.stopFace(examId);
|
|
|
}
|
|
|
if (faceCheckStu.value.student_id) {
|
|
|
getFaceConfirmOnly();
|
|
@@ -206,7 +217,7 @@ const getFaceConfirmOnly = (data?: any) => {
|
|
|
if (data) {
|
|
|
faceCheckStu.value = data;
|
|
|
}
|
|
|
- props.parentMethod.faceConfirmOnly({
|
|
|
+ props.parentTrainWsMethod.faceConfirmOnly({
|
|
|
exam_id: examId,
|
|
|
result_id: resultId.value,
|
|
|
student_id: faceCheckStu.value.student_id,
|
|
@@ -225,14 +236,14 @@ const getRetestFace = () => {
|
|
|
proxy?.$modal.confirm("确定重新识别吗?").then(() => {
|
|
|
if (props.needStart == false) {
|
|
|
//自动流程项目重新识别直接返回3
|
|
|
- props.parentMethod.closeOneTest(examId);
|
|
|
+ props.parentTrainWsMethod.closeOneTest(examId);
|
|
|
} else {
|
|
|
//手动流程项目重新识别43返回41,42返回3
|
|
|
if (examState.value == 43) {
|
|
|
cleanData();
|
|
|
- props.parentMethod.startFace(examId);
|
|
|
+ props.parentTrainWsMethod.startFace(examId);
|
|
|
} else {
|
|
|
- props.parentMethod.closeOneTest(examId);
|
|
|
+ props.parentTrainWsMethod.closeOneTest(examId);
|
|
|
}
|
|
|
}
|
|
|
}).finally(() => {
|
|
@@ -249,7 +260,7 @@ const getStartOneTest = () => {
|
|
|
if (examState.value != 43 || !faceCheckStu.value.student_id) {
|
|
|
return false;
|
|
|
}
|
|
|
- props.parentMethod.startOneTest(examId, () => { })
|
|
|
+ props.parentTrainWsMethod.startOneTest(examId, () => { })
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -263,16 +274,16 @@ const getAgain = async () => {
|
|
|
let student = JSON.parse(JSON.stringify(faceCheckStu.value));
|
|
|
//测试中
|
|
|
if (examState.value == 42) {
|
|
|
- await props.parentMethod.finishOneTest(examId);
|
|
|
+ await props.parentTrainWsMethod.finishOneTest(examId);
|
|
|
}
|
|
|
//其他状态
|
|
|
if (examState.value > 3) {
|
|
|
- await props.parentMethod.closeOneTest(examId);
|
|
|
+ await props.parentTrainWsMethod.closeOneTest(examId);
|
|
|
}
|
|
|
//重新走一次流程
|
|
|
- await props.parentMethod.openOneTest(examId);
|
|
|
- await props.parentMethod.startFace(examId);
|
|
|
- await props.parentMethod.stopFace(examId);
|
|
|
+ await props.parentTrainWsMethod.openOneTest(examId);
|
|
|
+ await props.parentTrainWsMethod.startFace(examId);
|
|
|
+ await props.parentTrainWsMethod.stopFace(examId);
|
|
|
if (student.student_id) {
|
|
|
getFaceConfirmOnly(student);
|
|
|
}
|
|
@@ -287,11 +298,11 @@ const getAllRetestFace = async () => {
|
|
|
}
|
|
|
//测试中
|
|
|
if (examState.value == 42) {
|
|
|
- await props.parentMethod.finishOneTest(examId);
|
|
|
+ await props.parentTrainWsMethod.finishOneTest(examId);
|
|
|
}
|
|
|
//其他状态
|
|
|
if (examState.value > 3) {
|
|
|
- await props.parentMethod.closeOneTest(examId);
|
|
|
+ await props.parentTrainWsMethod.closeOneTest(examId);
|
|
|
}
|
|
|
//重新走一次流程
|
|
|
await getOpenOneTestAndStartFace();
|
|
@@ -476,10 +487,10 @@ const getAchievement = (data: any) => {
|
|
|
backReason.value = arr;
|
|
|
if (data.isfinish) {
|
|
|
// if (['jump'].includes(type) && backReason.value.length) {
|
|
|
- // speckText("请重新测试");
|
|
|
+ // props.parentSpeechMethod.speckText("请重新测试");
|
|
|
// return false;
|
|
|
// }
|
|
|
- // speckText(faceCheckStu?.value.name + "成绩为" + (chineseNumber(count) || 0) + unit.value + ",请下一位准备!" || "");
|
|
|
+ // props.parentSpeechMethod.speckText(faceCheckStu?.value.name + "成绩为" + (chineseNumber(count) || 0) + unit.value + ",请下一位准备!" || "");
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -519,7 +530,7 @@ watch(() => props.examState, (newVal, oldVal) => {
|
|
|
}, { deep: true });
|
|
|
|
|
|
onMounted(() => {
|
|
|
- console.log("props.parentMethod",props.parentMethod)
|
|
|
+ console.log("props.parentTrainWsMethod",props.parentTrainWsMethod)
|
|
|
let dic: any = dataDictionary;
|
|
|
unit.value = dic.unit[project];
|
|
|
ctrl.value = route.query.ctrl;
|