Compare commits

...

4 Commits

Author SHA1 Message Date
52953bda36 打包 2025-08-19 17:11:24 +08:00
Surenjun
a6fbf40140 feat:结束考试修改 2025-07-30 08:52:49 +08:00
eb8329a610 考试结束优化 2025-07-29 10:23:53 +08:00
9a529fe649 考试结束优化 2025-07-24 17:31:54 +08:00
2 changed files with 114 additions and 98 deletions

View File

@ -555,12 +555,51 @@ 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.singlePlay && this.projectsObj['40600']?.type == '2' && this.isRequiredProjectsEnd){
Prompt.showToast({
message: '靠边停车项目进行中,不允许手动退出!',
duration: 4000
});
return
}
//考试未结束且有扣分,不允许退出
if (!this.singlePlay && this.judgeConfigObj['344'] == 1 && this.kfArr.length > 0 && !this.isAllProjectsEnd ) {
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 +929,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 +1028,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 +1237,6 @@ struct Index {
} }
return true return true
} }
// 判断项目是否在当前路段号 // 判断项目是否在当前路段号
getProjectIsInRoad = (projectCode: string,) => { getProjectIsInRoad = (projectCode: string,) => {
const { const {
@ -1276,7 +1296,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 +1306,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;
@ -1303,22 +1321,19 @@ struct Index {
return false return false
} }
} }
// 获取考项目里未完成的 // 获取考项目里未完成的
getNotEndProjects = () => { getNotEndProjects = () => {
const projectsObj = this.projectsObj; const projectsObj = this.projectsObj;
const notEndProjectsNames = []; const notEndProjectsNames = [];
Reflect.ownKeys(projectsObj).forEach((projectKey: string) => { Reflect.ownKeys(projectsObj).forEach((projectKey: string) => {
const { type, isRequired ,name} = projectsObj[projectKey]; const {isEnd ,name} = projectsObj[projectKey];
if (isRequired) { if (!isEnd) {
if (type == undefined || type == '1' || type == '2') {
notEndProjectsNames.push(name) notEndProjectsNames.push(name)
} }
}
}) })
return notEndProjectsNames; return notEndProjectsNames;
} }
scroller: Scroller = new Scroller() scroller: Scroller = new Scroller()
//页面通用字体大小 //页面通用字体大小
@State wayno: number = 0 @State wayno: number = 0
@ -1427,4 +1442,5 @@ struct Index {
@State errorMsg: string = '' @State errorMsg: string = ''
@State isErrorMsgEnd: boolean = false @State isErrorMsgEnd: boolean = false
@State disConnectErrorOpen: boolean = false @State disConnectErrorOpen: boolean = false
@State isAllProjectsEnd:boolean = false;
} }

View File

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