错误修改

This commit is contained in:
lixiao 2025-04-11 10:25:51 +08:00
parent 365199bf28
commit c693ccd5f8
7 changed files with 25 additions and 35 deletions

View File

@ -10,7 +10,6 @@
"packages": { "packages": {
"libjudgesdk.so@src/cpp/libJudgeSdk": { "libjudgesdk.so@src/cpp/libJudgeSdk": {
"name": "libjudgesdk.so", "name": "libjudgesdk.so",
"version": "1.0.0",
"resolved": "src/cpp/libJudgeSdk", "resolved": "src/cpp/libJudgeSdk",
"registryType": "local" "registryType": "local"
} }

View File

@ -112,7 +112,7 @@ export interface CarInfoType {
examinationRoomId?: string; examinationRoomId?: string;
plateNo?: string; plateNo?: string;
carNo?: string; carNo?: string;
examSubject: string; examSubject?: string;
isNeedCheck?: string; isNeedCheck?: string;
udpAddress?: string udpAddress?: string
messagePort?: string messagePort?: string

View File

@ -120,7 +120,6 @@ struct Index {
@State isDeductedPopShow: boolean = false @State isDeductedPopShow: boolean = false
@State isAmplifyPopShow: boolean = false @State isAmplifyPopShow: boolean = false
@State amplifiedImgIndex: number = 0 @State amplifiedImgIndex: number = 0
judge: Judge
//行驶距离 //行驶距离
@State jl: number = 0 @State jl: number = 0
//应考里程 //应考里程
@ -162,6 +161,7 @@ struct Index {
@State isErrorMsgEnd: boolean = false @State isErrorMsgEnd: boolean = false
@State disConnectErrorOpen: boolean = false @State disConnectErrorOpen: boolean = false
public context = getContext(this) as common.UIAbilityContext; public context = getContext(this) as common.UIAbilityContext;
private judge: Judge = new Judge(this)
async aboutToDisappear() { async aboutToDisappear() {
clearInterval(this.mileageTimer) clearInterval(this.mileageTimer)
@ -185,8 +185,7 @@ struct Index {
//断点续考 //断点续考
await this.goDdxkItems() await this.goDdxkItems()
//初始化评判 //初始化评判
const judge = await this.initJudge(); await this.initJudge();
this.judge = judge
} }
//初始化相关数据库表 //初始化相关数据库表
@ -522,16 +521,12 @@ struct Index {
// 评判相关初始化 // 评判相关初始化
async initJudge() { async initJudge() {
const JUDGEUI: JudgeUI = this; ;
const judge = new Judge(JUDGEUI); await this.judge.onJudgeFn(async (judgeData: JudgeCallBacData) => {
// await judge.init<typeof Index>()
await judge.onJudgeFn(async (judgeData: JudgeCallBacData) => {
// const { xmmcStr, carztStr, kfArr } = judgeData;
this.xmmcStr = judgeData.xmmcStr || ""; this.xmmcStr = judgeData.xmmcStr || "";
this.carztStr = judgeData.carztStr || ""; this.carztStr = judgeData.carztStr || "";
this.kfArr = judgeData.kfArr || []; this.kfArr = judgeData.kfArr || [];
}); });
return judge
} }
// 断点续考判断 // 断点续考判断

View File

@ -339,7 +339,7 @@ export default struct DeductedPopup {
} }
if (mark.itemno == 1 && Number(mark.markserial) > 100 && Number(mark.markserial) < 200) { if (mark.itemno == 1 && Number(mark.markserial) > 100 && Number(mark.markserial) < 200) {
this.markRuleListObj[`${mark.itemno}_${mark.markserial}`] = { Reflect.set(this.markRuleListObj, `${mark.itemno}_${mark.markserial}`, {
itemno: tempObj.itemno, itemno: tempObj.itemno,
markcatalog: tempObj.markcatalog, markcatalog: tempObj.markcatalog,
markshow: tempObj.markshow, markshow: tempObj.markshow,
@ -350,11 +350,9 @@ export default struct DeductedPopup {
OnlyOneKind: tempObj.OnlyOneKind, OnlyOneKind: tempObj.OnlyOneKind,
NoCancelId: tempObj.NoCancelId, NoCancelId: tempObj.NoCancelId,
GPS_SID: tempObj.GPS_SID, GPS_SID: tempObj.GPS_SID,
}; })
this.universalMarkRules.push(tempObj) this.universalMarkRules.push(tempObj)
} }
}) })
} }

View File

@ -83,7 +83,7 @@ type GetDqxmStr = (xmdm: number) => string
type TJudgeBeginObj = JudgeBeginObj type TJudgeBeginObj = JudgeBeginObj
export default class Judge { export default class Judge {
public plcStr!: string public plcStr: string = ""
public judgeUI: JudgeUI public judgeUI: JudgeUI
//获取科目三的评判初始化配置 //获取科目三的评判初始化配置
getKm3JudgeInitConfig: GetKm3JudgeInitConfig = async () => { getKm3JudgeInitConfig: GetKm3JudgeInitConfig = async () => {
@ -721,9 +721,9 @@ export default class Judge {
const cdsb: CDSBInfo = Reflect.get(itemInfoObj, cdsbKey); const cdsb: CDSBInfo = Reflect.get(itemInfoObj, cdsbKey);
const model = this.getModelData(`${examType}/${cdsb.modelKey}.txt`) const model = this.getModelData(`${examType}/${cdsb.modelKey}.txt`)
const temp: ItemInfo = { const temp: ItemInfo = {
xmdm: cdsb?.xmdm||0, xmdm: cdsb?.xmdm || 0,
xmxh: cdsb?.xmxh||"", xmxh: cdsb?.xmxh || "",
model:model||"" model: model || ""
} }
return temp return temp
}) })
@ -736,14 +736,14 @@ export default class Judge {
}) })
const initInfo: JudgeInitObj = { const initInfo: JudgeInitObj = {
sdkver: await examJudgeVersion(), sdkver: await examJudgeVersion(),
appver: AppStorage.get<BaseInfoType>('baseInfo')?.version||"", appver: AppStorage.get<BaseInfoType>('baseInfo')?.version || "",
kskm: Number(carInfo?.examSubject||"2"), kskm: Number(carInfo?.examSubject || "2"),
kchp: carInfo?.plateNo||"", kchp: carInfo?.plateNo || "",
kchm: Number(carInfo?.carId||""), kchm: Number(carInfo?.carId || ""),
kscx: carType, kscx: carType,
cxcode: '1', cxcode: '1',
name: carName, name: carName,
carmodel: this.getModelData(`${examType}/${carType}.txt`)||"", carmodel: this.getModelData(`${examType}/${carType}.txt`) || "",
allitems, allitems,
iteminfo: [], iteminfo: [],
systemparm: systemparmArr, systemparm: systemparmArr,
@ -772,7 +772,7 @@ export default class Judge {
getJudgeBeginData = async () => { getJudgeBeginData = async () => {
const examinerInfo = AppStorage.get<ExaminerInfoType>('examinerInfo') const examinerInfo = AppStorage.get<ExaminerInfoType>('examinerInfo')
// const code = examinerInfo.code // const code = examinerInfo.code
const examinerName = examinerInfo?.name||"" const examinerName = examinerInfo?.name || ""
let currentParams: RouteParamsType = router.getParams() as RouteParamsType; let currentParams: RouteParamsType = router.getParams() as RouteParamsType;
const sczb = currentParams.sczb; const sczb = currentParams.sczb;
@ -893,9 +893,9 @@ export default class Judge {
this.rmndg = 1 this.rmndg = 1
} }
this.judgeUI.currentXmdm = xmdm; this.judgeUI.currentXmdm = xmdm;
const xmmcStr = project.name||""; const xmmcStr = project.name || "";
const xmmcCode = project.projectCodeCenter||""; const xmmcCode = project.projectCodeCenter || "";
const xmmcSingleCode = project.projectCode||""; const xmmcSingleCode = project.projectCode || "";
const kmItem: KmItem = Reflect.get(this.kmItems, xmmcCode) const kmItem: KmItem = Reflect.get(this.kmItems, xmmcCode)
kmItem.status = 2; kmItem.status = 2;
this.xmmcStr = xmmcStr; this.xmmcStr = xmmcStr;
@ -906,13 +906,13 @@ export default class Judge {
this.xmxh = xmxh; this.xmxh = xmxh;
this.judgeUI.isProjectIn = true this.judgeUI.isProjectIn = true
Reflect.set(this.judgeUI.projectsObj, xmdm, project) Reflect.set(this.judgeUI.projectsObj, xmdm, project)
Reflect.set(this.kmItems, xmmcCode||0, kmItem) Reflect.set(this.kmItems, xmmcCode || 0, kmItem)
break; break;
//项目结束 //项目结束
case 2: { case 2: {
const project: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm) const project: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm)
const xmmcCode = project.projectCodeCenter||""; const xmmcCode = project.projectCodeCenter || "";
project.type = (xmjs.xmhg === 0 ? '4' : '3') project.type = (xmjs.xmhg === 0 ? '4' : '3')
//计算项目是否全部结束 //计算项目是否全部结束
@ -984,7 +984,7 @@ export default class Judge {
const xmdm = xmqx.xmdm; const xmdm = xmqx.xmdm;
const project: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm) const project: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm)
// const examSubject = this.judgeUI.examSubject // const examSubject = this.judgeUI.examSubject
const xmmcCode = project.projectCodeCenter||""; const xmmcCode = project.projectCodeCenter || "";
// const voiceCode = getKmProjectCancelVoice(examSubject, xmmcCode); // const voiceCode = getKmProjectCancelVoice(examSubject, xmmcCode);
// avPlayer.playAudio([`voice/${voiceCode}.mp3`],true) // avPlayer.playAudio([`voice/${voiceCode}.mp3`],true)
project.type = '1' project.type = '1'
@ -1017,7 +1017,7 @@ export default class Judge {
const xmdm = precast.xmdm const xmdm = precast.xmdm
const xmxh = precast.xmxh const xmxh = precast.xmxh
const project: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm) const project: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm)
const xmmcCode = project.projectCodeCenter||"" const xmmcCode = project.projectCodeCenter || ""
const projectCode = project.projectCode const projectCode = project.projectCode
// const xmmcCode = judgeUI.projectsObj[xmdm].projectCodeCenter; // const xmmcCode = judgeUI.projectsObj[xmdm].projectCodeCenter;
// const xmmcSingleCode = judgeUI.projectsObj[xmdm].projectCode; // const xmmcSingleCode = judgeUI.projectsObj[xmdm].projectCode;

View File

@ -16,7 +16,7 @@ export function chunkArr<T>(arr: T[], size: number): T[][] {
} }
//对象深拷贝 //对象深拷贝
export function deepClone<T>(target: T): T { export function deepClone<T extends Object>(target: T): T {
// 如果是对象且不是原始值null // 如果是对象且不是原始值null
if (typeof target === 'object' && target !== null) { if (typeof target === 'object' && target !== null) {
// 创建容器 // 创建容器

View File

@ -11,14 +11,12 @@
"packages": { "packages": {
"@ohos/crypto-js@2.0.3": { "@ohos/crypto-js@2.0.3": {
"name": "@ohos/crypto-js", "name": "@ohos/crypto-js",
"version": "2.0.3",
"integrity": "sha512-LuHaR1kD5PxnOXnuR1fWvPwGtbed9Q/QGzk6JOh8y5Wdzvi8brPesODZiaWf9scOVRHsbTPOtZw91vWB35p1vQ==", "integrity": "sha512-LuHaR1kD5PxnOXnuR1fWvPwGtbed9Q/QGzk6JOh8y5Wdzvi8brPesODZiaWf9scOVRHsbTPOtZw91vWB35p1vQ==",
"resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/crypto-js/-/crypto-js-2.0.3.har", "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/crypto-js/-/crypto-js-2.0.3.har",
"registryType": "ohpm" "registryType": "ohpm"
}, },
"@ohos/hypium@1.0.19": { "@ohos/hypium@1.0.19": {
"name": "@ohos/hypium", "name": "@ohos/hypium",
"version": "1.0.19",
"integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==", "integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==",
"resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.19.har", "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.19.har",
"registryType": "ohpm" "registryType": "ohpm"