This commit is contained in:
lixiao 2025-03-18 17:17:55 +08:00
parent 2b470f0c3c
commit d35a770c5a
4 changed files with 71 additions and 81 deletions

View File

@ -251,6 +251,7 @@ struct Index {
let currentParams: any = router.getParams();
const {carName,carType,examSubject} = this;
this.mode = Number(currentParams.mode)
this.totalScore = Number(currentParams.score) || this.totalScore
//小车车型列表
if (globalThis.singlePlay) {
this.wayno = currentParams.wayno || 1;
@ -280,16 +281,15 @@ struct Index {
this.carlist = carNo
}
//获取及格分数线
console.log("lixiao passingScore", carNo, carName, txt1, this.passingScore)
if (no1 == 3 && no3 == 3 && Number(carNo) == no2) {
this.passingScore = Number(txt1) || 0;
}
//根据车型获取应行驶里程数
if (no1 == 3 && no3 == 15 && Number(carNo) == no2) {
let mileage = (decodeURI(systemParm.txt1) || '').split('^')
if(this.mode === 1) {
if (this.mode === 1) {
this.examMileage = mileage[1]
} else if(this.mode === 2) {
} else if (this.mode === 2) {
this.examMileage = mileage[2]
} else {
this.examMileage = mileage[0]
@ -310,10 +310,15 @@ struct Index {
allItems = decodeURIComponent(systemParm.txt1).split(',').filter(txt => txt !== '')
}
}
console.info('lixiao', JSON.stringify(allItems))
if (no1 == 6) {
const name = decodeURI(systemParm.txt1)
if (this.mode !== 2 && name === '夜间行驶') {
return
}
if (this.mode !== 3 && name === '模拟夜间驾驶') {
return
}
let isRequired = allItems.includes(no2 + '')
if (no2 == 14) {
isRequired = false
@ -321,7 +326,6 @@ struct Index {
if (no2 == 13 && this.mode === 1) {
isRequired = false
}
console.log("lixiao must", name, isRequired)
const currentProject: Project = {
name,
abbreviation: decodeURI(systemParm.txt3),
@ -338,7 +342,6 @@ struct Index {
this.projectsObj[no2*1] = currentProject
if (this.mode === 2) {
let type: '2' | '3' = (no2 == 13 && this.kssycs != '1') ? '2' : '3'
console.log('lixiao no2 type', no2, type)
this.projectsObj[no2*1].type = type
}
this.projectsCenterObj[txt2] = currentProject
@ -439,65 +442,46 @@ struct Index {
return judge
}
// 断点续考判断
// 夜考扣分
async goDdxkItems() {
const judgeConfigObj = this.judgeConfigObj
const examSubject = this.examSubject
//科目二强制开始断点续考
if (judgeConfigObj['432'] != 0 || examSubject == 2) {
//断点续考判断
let currentParams: any = router.getParams();
const examItems: string = currentParams?.examItems;
// 2024-01-03 16:29:26;0;20300,;2,4^2,4;null;
if (examItems !== '' && examItems !== undefined) {
console.info('surenjun examItems=>', JSON.stringify(examItems))
const examItemsArrs = examItems.split(';');
const startTime = examItemsArrs[0]
const ddxkKsxmArr = examItemsArrs[2]?.split(',').filter(item => item) || []
const ddxkKfArr = examItemsArrs[3]?.split('^').filter(item => item) || []
if (judgeConfigObj['432'] == 2 || examSubject == 2) {
//TODO 带项目带里程
if (ddxkKsxmArr?.length) {
//断点续考
ddxkKsxmArr.forEach(xmdm => {
const projectCode = this.projectsCenterObj[xmdm].projectCode
if (this.projectsObj[projectCode]) {
this.projectsObj[projectCode].type = '3'
this.projectsObj[projectCode].isUpload = true
this.projectsObj[projectCode].isEnd = true
}
})
this.ddxkKsxmArr = ddxkKsxmArr
}
}
//扣分续考
ddxkKfArr.forEach((kf) => {
const [xmdm, kfdm] = kf.split(',')
const currentKf = this.markRuleListObj[`${xmdm}_${kfdm}`]
const currentProject = this.projectsObj[xmdm] || { name: '通用评判' }
if (this.projectsObj[xmdm]) {
this.projectsObj[xmdm].type = '4'
}
this.kfArr.push({
//扣分项目名称
xmmcStr: currentProject.name,
//@ts-ignore
xmdm,
desc: currentKf.markshow,
score: currentKf.markreal,
markcatalog: currentKf.markcatalog,
markserial: currentKf.markserial,
kfxh: currentKf.kfxh
})
this.totalScore += currentKf.markreal * 1;
})
this.ddxkKfArr = ddxkKfArr
this.ddxkTime = Date.parse(startTime);
this.isDdxk = true
}
let currentParams: any = router.getParams();
const examItems: string = currentParams?.examItems + "";
console.log("lixiao ddxkKfArr", JSON.stringify(examItems))
const ddxkKfArr = examItems?.split(",").filter(item => item)
if(ddxkKfArr.length === 0) {
return
}
console.log("lixiao ddxkKfArr", JSON.stringify(ddxkKfArr))
console.log("lixiao ddxkKfArr", JSON.stringify(this.manualMarkRules))
console.log("lixiao ddxkKfArr", JSON.stringify(this.markRuleListObj))
ddxkKfArr.forEach((kf) => {
let xmdm = '';
let kfdm = ''
let currentKf
Object.entries(this.markRuleListObj).forEach(([key, value]) => {
if (value.markcatalog == kf) {
[xmdm, kfdm] = key.split('_')
currentKf = value
}
})
const currentProject = this.projectsObj[xmdm] || { name: '通用评判' }
if (this.projectsObj[xmdm]) {
this.projectsObj[xmdm].type = '4'
}
this.kfArr.push({
//扣分项目名称
xmmcStr: currentProject.name,
//@ts-ignore
xmdm,
desc: currentKf.markshow,
score: currentKf.markreal,
markcatalog: currentKf.markcatalog,
markserial: currentKf.markserial,
kfxh: currentKf.kfxh
})
})
this.ddxkKfArr = ddxkKfArr
}
// 初始化mapPoint表

View File

@ -200,7 +200,6 @@ struct UserInfo {
//身份证读卡器初始化
// this.openDeviceByIDCard()
const routerParam = router.getParams() || { type: 0 };
console.log('routerParam', JSON.stringify(routerParam))
if (!globalThis.singlePlay) {
// @ts-ignore
@ -456,10 +455,12 @@ struct UserInfo {
})
let now = new Date(await systemDateTime.getCurrentTime())
let hour = now.getHours()
let minute = now.getMinutes()
let t_hour = Number(nightTime.split(":")[0])
let t_minute = Number(nightTime.split(":")[1])
console.log("lixiao nightTime", nightTime)
if (kStringArr.length === 0) {
if (hour < 5 || hour >= Number(nightTime.split(":")[0] || 24)) {
// 夜考
if (hour > t_hour || (hour === t_hour && minute >= t_minute)) {
this.mode = 2
} else {
// 白考
@ -473,8 +474,7 @@ struct UserInfo {
// 增驾(模拟灯光已考)
this.mode = 4
} else if (kStringArr.includes("41600")) {
if (hour < 5 || hour >= Number(nightTime.split(":")[0]) || 24) {
// 夜考
if (hour > t_hour || (hour === t_hour && minute >= t_minute)) {
this.mode = 2
} else {
// 白考
@ -687,8 +687,6 @@ struct UserInfo {
this.isFirstBoardPrePareSetPopupBtnShow = false
console.log('isFirstBoardPrePareSetPopupBtnShow', this.isFirstBoardPrePareSetPopupBtnShow, this.isBoardPrePareSetPopupOpen)
this.startExam = false
// await upDateTableByArray('USER', [])
// await upDateTableByArray('USERLIST', [])
await DB.clearTable('USER')
await DB.clearTable('USERLIST')
this.type = '2'
@ -918,25 +916,31 @@ struct UserInfo {
let kStringArr = decodeURIComponent(keystr || '').split(",").filter(item => item)
console.log("lixiao kStringArr", JSON.stringify(kStringArr))
await this.getExamMode(kStringArr)
console.log("lixiao model", this.mode)
// if (this.mode === 2 && !examItems?.getExaminationItemRsp?.body?.jdxx) {
// promptAction.showToast({
// message: "当前尚未进行白考,无法开始夜考!"
// })
// this.updateTimeLimit = false
// this.stopDeviceById()
// this.stepFlag = false
// return
// }
console.log("lixiao model", this.mode,JSON.stringify(examItems))
let score = Number(this.currentUser.jdxx?.split("^")[0])
let kfxm = this.currentUser.jdxx?.split("^")[1]
let length = Number(this.currentUser.jdxx?.split("^")[2])
if (this.mode === 2 && !this.currentUser.jdxx) {
promptAction.showToast({
message: "当前尚未进行白考,无法开始夜考!"
})
this.updateTimeLimit = false
this.stopDeviceById()
this.stepFlag = false
this.ksksLimit = false
return
}
router.pushUrl({
url: 'pages/Judge',
params: {
examItems: examItems?.getExaminationItemRsp?.body?.ykxx,
examItems: kfxm,
sczb: Number(this.isBoardPrePareSetPopupOpen),
kfdm: this.sczbkf,
mode: this.mode,
//真实监管项目
kString: decodeURIComponent(keystr || '')
kString: decodeURIComponent(keystr || ''),
// 白考分数
score
}
}, router.RouterMode.Single);
this.updateTimeLimit = false

View File

@ -22,6 +22,7 @@ export interface User {
yycs: string
ksy2sfzmhm: string
kslx?: string
jdxx?: string
}
export interface VideoConfig {

View File

@ -761,6 +761,7 @@ export default class Judge {
const {isExam} = this;
const judgeUI = this.judgeUI
const {projects,carType,kssycs,isDdxk,ddxkTime,projectsCenterObj,ddxkKsxmArr,ddxkKfArr,passingScore} = judgeUI;
console.log("lixiao projects", JSON.stringify(projects.map(item => item.name)))
const beginInfo = {
kgid: '012',
kgxm: decodeURI(examinerName || ''),