考试结束优化

This commit is contained in:
lixiao 2025-07-24 17:31:54 +08:00
parent d1835688b6
commit 9a529fe649
2 changed files with 98 additions and 93 deletions

View File

@ -555,12 +555,40 @@ struct Index {
const {lsh,startExamTime:kskssj,jl:kslc} = this const {lsh,startExamTime:kskssj,jl:kslc} = this
const { carId ,examinationRoomId} = globalThis.carInfo; const { carId ,examinationRoomId} = globalThis.carInfo;
await uploadExamMileage({ await uploadExamMileage({
carId,examinationRoomId, carId,
lsh,kskssj,kslc examinationRoomId,
lsh,
kskssj,
kslc
}) })
} }
} }
async endExam() {
if (this.isErrorMsgEnd) {
this.judge.closeAllFiles()
router.back()
return
}
if (this.judgeConfigObj['344'] == 1) {
Prompt.showToast({
message: '考试未结束,不允许手动退出!',
duration: 4000
});
return
}
this.endPopupVisible = false;
this.loadingPopupVisible = true
clearInterval(this.timer);
clearInterval(globalThis.judgeTimer)
try {
this.judge.checkExamIsEnd(true);
} catch (e) {
this.judge.closeAllFiles()
router.back()
}
}
build() { build() {
Column() { Column() {
Row() { Row() {
@ -890,7 +918,11 @@ struct Index {
// name: 'button_media.wav' // name: 'button_media.wav'
// }) // })
if (this.judgeConfigObj['353'] == '0') { if (this.judgeConfigObj['353'] == '0') {
if (this.getNotEndProjects().length > 0) {
this.endPopupVisible = true this.endPopupVisible = true
return
}
this.endExam()
} else { } else {
Prompt.showToast({ Prompt.showToast({
message: '车上不允许手动结束考试!', message: '车上不允许手动结束考试!',
@ -985,34 +1017,12 @@ struct Index {
//结束考试弹窗 //结束考试弹窗
if (this.endPopupVisible) { if (this.endPopupVisible) {
EndPoPup({ EndPoPup({
title: this.getNotEndProjects().length ? `当前考试存在未完成的项目:${this.getNotEndProjects().join('、')},确定结束考试吗?` :'确定结束考试吗?', title: `当前考试存在未完成的项目:${this.getNotEndProjects().join('、')},确定结束考试吗?`,
cancelFn: () => { cancelFn: () => {
this.endPopupVisible = false; this.endPopupVisible = false;
}, },
confirmFn: async () => { confirmFn: async () => {
if(this.isErrorMsgEnd){ this.endExam()
this.judge.closeAllFiles()
router.back()
return
}
if (this.judgeConfigObj['344'] == 1) {
Prompt.showToast({
message: '考试未结束,不允许手动退出!',
duration: 4000
});
return
}
this.endPopupVisible = false;
this.loadingPopupVisible = true
clearInterval(this.timer);
clearInterval(globalThis.judgeTimer)
try {
this.judge.checkExamIsEnd(true);
} catch (e) {
this.judge.closeAllFiles()
router.back()
}
} }
}) })
} }
@ -1216,7 +1226,6 @@ struct Index {
} }
return true return true
} }
// 判断项目是否在当前路段号 // 判断项目是否在当前路段号
getProjectIsInRoad = (projectCode: string,) => { getProjectIsInRoad = (projectCode: string,) => {
const { const {
@ -1276,7 +1285,6 @@ struct Index {
return true return true
} }
// 获取人工项目是否已做 // 获取人工项目是否已做
getIsEndManualProject = (index: number) => { getIsEndManualProject = (index: number) => {
const projectName = this.artSubject3Projects[index]; const projectName = this.artSubject3Projects[index];
@ -1287,7 +1295,6 @@ struct Index {
} }
return (type == '3' || type == '4') ? `${projectName}_red` : `${projectName}_green`; return (type == '3' || type == '4') ? `${projectName}_red` : `${projectName}_green`;
} }
// 获取是否能进行人工评判 // 获取是否能进行人工评判
getIsManualKf = () => { getIsManualKf = () => {
const {examSubject} = this; const {examSubject} = this;
@ -1317,8 +1324,6 @@ struct Index {
}) })
return notEndProjectsNames; return notEndProjectsNames;
} }
scroller: Scroller = new Scroller() scroller: Scroller = new Scroller()
//页面通用字体大小 //页面通用字体大小
@State wayno: number = 0 @State wayno: number = 0

View File

@ -1,7 +1,7 @@
//考试回放开关 //考试回放开关
export const judgeConfig = { export const judgeConfig = {
// 外壳版本号 // 外壳版本号
version: "2025.05.26.01", version: "2025.07.24.01",
//本地目录开关 //本地目录开关
isTrajectoryOpen: false, isTrajectoryOpen: false,
//是否开启拍照 //是否开启拍照