diff --git a/entry/oh-package-lock.json5 b/entry/oh-package-lock.json5 index 82ec2e0..757a97e 100644 --- a/entry/oh-package-lock.json5 +++ b/entry/oh-package-lock.json5 @@ -10,7 +10,6 @@ "packages": { "libjudgesdk.so@src/cpp/libJudgeSdk": { "name": "libjudgesdk.so", - "version": "1.0.0", "resolved": "src/cpp/libJudgeSdk", "registryType": "local" } diff --git a/entry/src/main/ets/model/Common.ets b/entry/src/main/ets/model/Common.ets index af73217..15363de 100644 --- a/entry/src/main/ets/model/Common.ets +++ b/entry/src/main/ets/model/Common.ets @@ -112,7 +112,7 @@ export interface CarInfoType { examinationRoomId?: string; plateNo?: string; carNo?: string; - examSubject: string; + examSubject?: string; isNeedCheck?: string; udpAddress?: string messagePort?: string diff --git a/entry/src/main/ets/pages/Judge.ets b/entry/src/main/ets/pages/Judge.ets index ebcb32d..e659158 100644 --- a/entry/src/main/ets/pages/Judge.ets +++ b/entry/src/main/ets/pages/Judge.ets @@ -120,7 +120,6 @@ struct Index { @State isDeductedPopShow: boolean = false @State isAmplifyPopShow: boolean = false @State amplifiedImgIndex: number = 0 - judge: Judge //行驶距离 @State jl: number = 0 //应考里程 @@ -162,6 +161,7 @@ struct Index { @State isErrorMsgEnd: boolean = false @State disConnectErrorOpen: boolean = false public context = getContext(this) as common.UIAbilityContext; + private judge: Judge = new Judge(this) async aboutToDisappear() { clearInterval(this.mileageTimer) @@ -185,8 +185,7 @@ struct Index { //断点续考 await this.goDdxkItems() //初始化评判 - const judge = await this.initJudge(); - this.judge = judge + await this.initJudge(); } //初始化相关数据库表 @@ -522,16 +521,12 @@ struct Index { // 评判相关初始化 async initJudge() { - const JUDGEUI: JudgeUI = this; - const judge = new Judge(JUDGEUI); - // await judge.init() - await judge.onJudgeFn(async (judgeData: JudgeCallBacData) => { - // const { xmmcStr, carztStr, kfArr } = judgeData; + ; + await this.judge.onJudgeFn(async (judgeData: JudgeCallBacData) => { this.xmmcStr = judgeData.xmmcStr || ""; this.carztStr = judgeData.carztStr || ""; this.kfArr = judgeData.kfArr || []; }); - return judge } // 断点续考判断 diff --git a/entry/src/main/ets/pages/compontents/judge/BoardPrePareSetPopup.ets b/entry/src/main/ets/pages/compontents/judge/BoardPrePareSetPopup.ets index 21e11a1..711a284 100644 --- a/entry/src/main/ets/pages/compontents/judge/BoardPrePareSetPopup.ets +++ b/entry/src/main/ets/pages/compontents/judge/BoardPrePareSetPopup.ets @@ -339,7 +339,7 @@ export default struct DeductedPopup { } 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, markcatalog: tempObj.markcatalog, markshow: tempObj.markshow, @@ -350,11 +350,9 @@ export default struct DeductedPopup { OnlyOneKind: tempObj.OnlyOneKind, NoCancelId: tempObj.NoCancelId, GPS_SID: tempObj.GPS_SID, - }; - + }) this.universalMarkRules.push(tempObj) } - }) } diff --git a/entry/src/main/ets/pages/judgeSDK/judge.ets b/entry/src/main/ets/pages/judgeSDK/judge.ets index fc49f53..e111dea 100644 --- a/entry/src/main/ets/pages/judgeSDK/judge.ets +++ b/entry/src/main/ets/pages/judgeSDK/judge.ets @@ -83,7 +83,7 @@ type GetDqxmStr = (xmdm: number) => string type TJudgeBeginObj = JudgeBeginObj export default class Judge { - public plcStr!: string + public plcStr: string = "" public judgeUI: JudgeUI //获取科目三的评判初始化配置 getKm3JudgeInitConfig: GetKm3JudgeInitConfig = async () => { @@ -721,9 +721,9 @@ export default class Judge { const cdsb: CDSBInfo = Reflect.get(itemInfoObj, cdsbKey); const model = this.getModelData(`${examType}/${cdsb.modelKey}.txt`) const temp: ItemInfo = { - xmdm: cdsb?.xmdm||0, - xmxh: cdsb?.xmxh||"", - model:model||"" + xmdm: cdsb?.xmdm || 0, + xmxh: cdsb?.xmxh || "", + model: model || "" } return temp }) @@ -736,14 +736,14 @@ export default class Judge { }) const initInfo: JudgeInitObj = { sdkver: await examJudgeVersion(), - appver: AppStorage.get('baseInfo')?.version||"", - kskm: Number(carInfo?.examSubject||"2"), - kchp: carInfo?.plateNo||"", - kchm: Number(carInfo?.carId||""), + appver: AppStorage.get('baseInfo')?.version || "", + kskm: Number(carInfo?.examSubject || "2"), + kchp: carInfo?.plateNo || "", + kchm: Number(carInfo?.carId || ""), kscx: carType, cxcode: '1', name: carName, - carmodel: this.getModelData(`${examType}/${carType}.txt`)||"", + carmodel: this.getModelData(`${examType}/${carType}.txt`) || "", allitems, iteminfo: [], systemparm: systemparmArr, @@ -772,7 +772,7 @@ export default class Judge { getJudgeBeginData = async () => { const examinerInfo = AppStorage.get('examinerInfo') // const code = examinerInfo.code - const examinerName = examinerInfo?.name||"" + const examinerName = examinerInfo?.name || "" let currentParams: RouteParamsType = router.getParams() as RouteParamsType; const sczb = currentParams.sczb; @@ -893,9 +893,9 @@ export default class Judge { this.rmndg = 1 } this.judgeUI.currentXmdm = xmdm; - const xmmcStr = project.name||""; - const xmmcCode = project.projectCodeCenter||""; - const xmmcSingleCode = project.projectCode||""; + const xmmcStr = project.name || ""; + const xmmcCode = project.projectCodeCenter || ""; + const xmmcSingleCode = project.projectCode || ""; const kmItem: KmItem = Reflect.get(this.kmItems, xmmcCode) kmItem.status = 2; this.xmmcStr = xmmcStr; @@ -906,13 +906,13 @@ export default class Judge { this.xmxh = xmxh; this.judgeUI.isProjectIn = true Reflect.set(this.judgeUI.projectsObj, xmdm, project) - Reflect.set(this.kmItems, xmmcCode||0, kmItem) + Reflect.set(this.kmItems, xmmcCode || 0, kmItem) break; //项目结束 case 2: { const project: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm) - const xmmcCode = project.projectCodeCenter||""; + const xmmcCode = project.projectCodeCenter || ""; project.type = (xmjs.xmhg === 0 ? '4' : '3') //计算项目是否全部结束 @@ -984,7 +984,7 @@ export default class Judge { const xmdm = xmqx.xmdm; const project: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm) // const examSubject = this.judgeUI.examSubject - const xmmcCode = project.projectCodeCenter||""; + const xmmcCode = project.projectCodeCenter || ""; // const voiceCode = getKmProjectCancelVoice(examSubject, xmmcCode); // avPlayer.playAudio([`voice/${voiceCode}.mp3`],true) project.type = '1' @@ -1017,7 +1017,7 @@ export default class Judge { const xmdm = precast.xmdm const xmxh = precast.xmxh const project: ProjectInfo = Reflect.get(judgeUI.projectsObj, xmdm) - const xmmcCode = project.projectCodeCenter||"" + const xmmcCode = project.projectCodeCenter || "" const projectCode = project.projectCode // const xmmcCode = judgeUI.projectsObj[xmdm].projectCodeCenter; // const xmmcSingleCode = judgeUI.projectsObj[xmdm].projectCode; diff --git a/entry/src/main/ets/pages/judgeSDK/utils/Common.ets b/entry/src/main/ets/pages/judgeSDK/utils/Common.ets index 2bdab66..6661bfe 100644 --- a/entry/src/main/ets/pages/judgeSDK/utils/Common.ets +++ b/entry/src/main/ets/pages/judgeSDK/utils/Common.ets @@ -16,7 +16,7 @@ export function chunkArr(arr: T[], size: number): T[][] { } //对象深拷贝 -export function deepClone(target: T): T { +export function deepClone(target: T): T { // 如果是对象,且不是原始值null if (typeof target === 'object' && target !== null) { // 创建容器 diff --git a/oh-package-lock.json5 b/oh-package-lock.json5 index c1bf6e0..b5e0f30 100644 --- a/oh-package-lock.json5 +++ b/oh-package-lock.json5 @@ -11,14 +11,12 @@ "packages": { "@ohos/crypto-js@2.0.3": { "name": "@ohos/crypto-js", - "version": "2.0.3", "integrity": "sha512-LuHaR1kD5PxnOXnuR1fWvPwGtbed9Q/QGzk6JOh8y5Wdzvi8brPesODZiaWf9scOVRHsbTPOtZw91vWB35p1vQ==", "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/crypto-js/-/crypto-js-2.0.3.har", "registryType": "ohpm" }, "@ohos/hypium@1.0.19": { "name": "@ohos/hypium", - "version": "1.0.19", "integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==", "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.19.har", "registryType": "ohpm"