From 508c3f39542442205fb5e92164e3fbae7cf0731e Mon Sep 17 00:00:00 2001 From: surenjun Date: Wed, 18 Jun 2025 14:21:05 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix=EF=BC=9A=E6=A1=A3=E4=BD=8D=E4=B8=B2?= =?UTF-8?q?=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/ets/common/service/indexService.ts | 18 ++++++++++-------- entry/src/main/ets/pages/Index.ets | 5 +++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/entry/src/main/ets/common/service/indexService.ts b/entry/src/main/ets/common/service/indexService.ts index 5934d8d1..0aa2410d 100644 --- a/entry/src/main/ets/common/service/indexService.ts +++ b/entry/src/main/ets/common/service/indexService.ts @@ -435,15 +435,17 @@ const devPath = "/dev/ttyS3" function openChuankouFn(callback) { console.log('SerialOpen in indexservice, path=' + devPath) - //TODO 自动挡车不读取串口 - testNapi.SerialOpenAsync(devPath, (fd) => { - globalThis.fd = fd; - globalThis.num = 0 - let parity = 0x4e; // 'N' - let ret = testNapi.SerialSetAsync(globalThis.fd, 115200, 0, 8, 1, parity, (ret) => { - callback() + //自动挡车不读取串口 + if(globalThis.carInfo && globalThis.carInfo.kscx == 'C1'){ + testNapi.SerialOpenAsync(devPath, (fd) => { + globalThis.fd = fd; + globalThis.num = 0 + let parity = 0x4e; // 'N' + let ret = testNapi.SerialSetAsync(globalThis.fd, 115200, 0, 8, 1, parity, (ret) => { + callback() + }); }); - }); + } } function getChuankouFnMsg() { diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index a2e0505e..9a81e43b 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -677,6 +677,11 @@ struct Index { }, 1000) this.createAlbum() + getSyncData('ES_CARINFO').then(result => { + const carInfo = result[0] || {}; + globalThis.carInfo.kscx = carInfo.kscx + }) + // clearInterval(globalThis.demo) // globalThis.demo= setInterval(()=>{ // const str= {"carId":"1062","examinationRoomId":"2","videoVersion":"1.0","judgeVersion":"2023.09.30.1","shellVersion":"2023.12.13.01","host":"http://172.37.55.191:8082"} From 8251bed720b1c9d5095f0f16e67542c695ac5efb Mon Sep 17 00:00:00 2001 From: surenjun Date: Wed, 18 Jun 2025 15:01:19 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix=EF=BC=9A=E4=BC=98=E5=8C=96=E4=BA=BA?= =?UTF-8?q?=E5=B7=A5=E8=BF=9B=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/Judge.ets | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/entry/src/main/ets/pages/Judge.ets b/entry/src/main/ets/pages/Judge.ets index 19cb4f76..a75cd40f 100644 --- a/entry/src/main/ets/pages/Judge.ets +++ b/entry/src/main/ets/pages/Judge.ets @@ -996,14 +996,21 @@ struct Index { AmplifyPopup({ amplifyImgIndex: this.amplifiedImgIndex, confirmAmplify: async (amplify) => { - clearTimeout(this.popTimer) - this.popTimer = null - this.popTimer = setTimeout(async () => { - const judge = this.judge - await judge.setJudgeItem(amplify.projectCode, 1); - this.isAmplifyPopShow = false - this.popTimer = null; - }, 500) + if(this.setManualProjectFn(this.amplifiedImgIndex)){ + clearTimeout(this.popTimer) + this.popTimer = null + this.popTimer = setTimeout(async () => { + const judge = this.judge + await judge.setJudgeItem(amplify.projectCode, 1); + this.isAmplifyPopShow = false + this.popTimer = null; + }, 500) + }else{ + Prompt.showToast({ + message: `有项目未结束,不允许人操作!`, + duration: 8000 + }); + } }, closeAmplifyPop: () => { this.isAmplifyPopShow = false From 6f3bdbf17623684f6fbfd85cb1983183d88e5dd1 Mon Sep 17 00:00:00 2001 From: surenjun Date: Wed, 18 Jun 2025 15:10:43 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix=EF=BC=9A=E9=80=80=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/Judge.ets | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/entry/src/main/ets/pages/Judge.ets b/entry/src/main/ets/pages/Judge.ets index a75cd40f..19cb4f76 100644 --- a/entry/src/main/ets/pages/Judge.ets +++ b/entry/src/main/ets/pages/Judge.ets @@ -996,21 +996,14 @@ struct Index { AmplifyPopup({ amplifyImgIndex: this.amplifiedImgIndex, confirmAmplify: async (amplify) => { - if(this.setManualProjectFn(this.amplifiedImgIndex)){ - clearTimeout(this.popTimer) - this.popTimer = null - this.popTimer = setTimeout(async () => { - const judge = this.judge - await judge.setJudgeItem(amplify.projectCode, 1); - this.isAmplifyPopShow = false - this.popTimer = null; - }, 500) - }else{ - Prompt.showToast({ - message: `有项目未结束,不允许人操作!`, - duration: 8000 - }); - } + clearTimeout(this.popTimer) + this.popTimer = null + this.popTimer = setTimeout(async () => { + const judge = this.judge + await judge.setJudgeItem(amplify.projectCode, 1); + this.isAmplifyPopShow = false + this.popTimer = null; + }, 500) }, closeAmplifyPop: () => { this.isAmplifyPopShow = false From 920323bc786256be065a832ad9c0f42232897bbb Mon Sep 17 00:00:00 2001 From: lixiao <932184220@qq.com> Date: Wed, 18 Jun 2025 15:24:19 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/entryability/EntryAbility.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/entry/src/main/ets/entryability/EntryAbility.ts b/entry/src/main/ets/entryability/EntryAbility.ts index 9e7393e9..67817d79 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ts +++ b/entry/src/main/ets/entryability/EntryAbility.ts @@ -37,8 +37,6 @@ export default class EntryAbility extends UIAbility { // this.context // Main window is created, set main page for this ability hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - await tcpUtil.init() - globalThis.carInfo = {} globalThis.examinerInfo = {} @@ -66,15 +64,11 @@ export default class EntryAbility extends UIAbility { globalThis.pathDir = this.context.filesDir; globalThis.context = this.context; globalThis.isJudgeInitBool = false - console.info('jiangsong globalThis.pathDir = ' + globalThis.pathDir); - // this.requestPermission(this.context) - // this.featureAbilityAuth() const windowClass = await windowStage.getMainWindow(); globalThis.windowClass = windowClass - // await windowClass.setWindowLayoutFullScreen(true) - // await windowClass.setWindowSystemBarEnable([]) //全屏 - await windowClass.setWindowSystemBarEnable(['navigation']) + await windowClass.setWindowLayoutFullScreen(true) + await windowClass.setWindowSystemBarEnable([]) windowStage.loadContent('pages/Index', (err, data) => { if (err.code) {