feat: 文件名规范化

This commit is contained in:
wangzhongjie 2024-02-21 14:51:32 +08:00
parent fa28b48533
commit 7e10635a22
4 changed files with 285 additions and 228 deletions

View File

@ -5,9 +5,9 @@
"name": "default", "name": "default",
"material": { "material": {
"certpath": "/Users/wangzhongjie/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.cer", "certpath": "/Users/wangzhongjie/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.cer",
"storePassword": "0000001A3E7D97C4BC5819BCBC0470AB1397AAD09AC6E70069CFC6FD7D21A58A50AA6EE3FEBCDA027D71", "storePassword": "0000001AAD87A2F96608A7CC63E6F839F8911407DD89270AAF9DE1E71573F9635276984E1FAF888B3B65",
"keyAlias": "debugKey", "keyAlias": "debugKey",
"keyPassword": "0000001A764ACBDC861BE169BE8B85E333F52659116CD5B8F12254C0F8F893E26884787B99199D49B10C", "keyPassword": "0000001A4B890623B78CD2603888F1077C048A19AD5577A34A4A2C54492F54091134D30F5FC8DB4D2E1F",
"profile": "/Users/wangzhongjie/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.p7b", "profile": "/Users/wangzhongjie/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.p7b",
"signAlg": "SHA256withECDSA", "signAlg": "SHA256withECDSA",
"storeFile": "/Users/wangzhongjie/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.p12" "storeFile": "/Users/wangzhongjie/.ohos/config/openharmony/auto_ohos_default_subject-two_com.oh.dts.p12"

View File

@ -18,6 +18,7 @@ import testNapi from "@ohos.idcard";
import common from '@ohos.app.ability.common'; import common from '@ohos.app.ability.common';
import { VideoConfig } from './interfaces' import { VideoConfig } from './interfaces'
import WebRTCVoice from './webRTC/' import WebRTCVoice from './webRTC/'
@Entry @Entry
@Component @Component
struct Index { struct Index {
@ -82,9 +83,7 @@ struct Index {
} }
private AccountTable = new AccountTable(() => { private AccountTable = new AccountTable(() => {
}, USER); }, USER);
private context = getContext(this) as common.UIAbilityContext; private context = getContext(this) as common.UIAbilityContext;
@State name: string = 'initName'; @State name: string = 'initName';
@State sex: string = ''; @State sex: string = '';
@State callBackFlag: boolean = false; @State callBackFlag: boolean = false;
@ -105,6 +104,7 @@ struct Index {
@State isCanClick: boolean = true; @State isCanClick: boolean = true;
subscriber; subscriber;
@State faceCatchImg: string = '' @State faceCatchImg: string = ''
// private fileUtil: FileUtil // private fileUtil: FileUtil
// that.sfzmhm = 'surenjun'; // that.sfzmhm = 'surenjun';
@ -144,7 +144,6 @@ struct Index {
this.numCount = 0 this.numCount = 0
globalThis.udpClient2 && globalThis.udpClient2.onMessage((val) => { globalThis.udpClient2 && globalThis.udpClient2.onMessage((val) => {
console.log('valvaltotol2', val.id, val.body, val.length) console.log('valvaltotol2', val.id, val.body, val.length)
@ -422,16 +421,24 @@ struct Index {
this.initSysset() this.initSysset()
initJudgeUdp() initJudgeUdp()
} }
changeQkfn() { changeQkfn() {
this.qkFn() this.qkFn()
} }
getqkFn() { getqkFn() {
let tmpList = []; let tmpList = [];
tmpList.push(this.string2Bytes(globalThis.signNum, 1 * 8)[0]) tmpList.push(this.string2Bytes(globalThis.signNum, 1 * 8)[0])
const param= {id: 41,list:tmpList,carNo: globalThis.carInfo.carNo,placeId: globalThis.carInfo.examinationRoomId} const param = {
id: 41,
list: tmpList,
carNo: globalThis.carInfo.carNo,
placeId: globalThis.carInfo.examinationRoomId
}
globalThis.udpClient2.sendMsg(param, this.context) globalThis.udpClient2.sendMsg(param, this.context)
} }
async heartMsg(context) { async heartMsg(context) {
let tmpList = [] let tmpList = []
const str = globalThis.lsh const str = globalThis.lsh
@ -439,14 +446,25 @@ struct Index {
tmpList.push(this.string2Bytes(str.charCodeAt(i), 1 * 8)[0]) tmpList.push(this.string2Bytes(str.charCodeAt(i), 1 * 8)[0])
} }
const param = { id: 46, list: tmpList, carNo: globalThis.carInfo.carNo, placeId: globalThis.carInfo.examinationRoomId,callback:()=>{ const param = {
id: 46,
list: tmpList,
carNo: globalThis.carInfo.carNo,
placeId: globalThis.carInfo.examinationRoomId,
callback: () => {
console.log('46send') console.log('46send')
this.callBackFlag = true this.callBackFlag = true
}} }
}
this.interval = setInterval(() => { this.interval = setInterval(() => {
if (this.callBackFlag) { if (this.callBackFlag) {
console.log('validqqq333') console.log('validqqq333')
const param2 = { id: 47, list: tmpList, carNo: globalThis.carInfo.carNo, placeId: globalThis.carInfo.examinationRoomId } const param2 = {
id: 47,
list: tmpList,
carNo: globalThis.carInfo.carNo,
placeId: globalThis.carInfo.examinationRoomId
}
globalThis.udpClient2 && globalThis.udpClient2.sendMsg(param2, this.context) globalThis.udpClient2 && globalThis.udpClient2.sendMsg(param2, this.context)
} }
}, 1000) }, 1000)
@ -456,12 +474,14 @@ struct Index {
// return {id: 31,list:tmpList,carNo:489,placeId:62} // return {id: 31,list:tmpList,carNo:489,placeId:62}
} }
aboutToDisappear() { aboutToDisappear() {
clearInterval(this.interval) clearInterval(this.interval)
clearInterval(this.interval2) clearInterval(this.interval2)
testNapi.StopReadCard(); testNapi.StopReadCard();
// console.log("zzctest Close Device ret = " + testNapi.CloseDevice()); // console.log("zzctest Close Device ret = " + testNapi.CloseDevice());
} }
changeStudentStatue(val) { changeStudentStatue(val) {
const arr = [globalThis.signNum || 0, val] const arr = [globalThis.signNum || 0, val]
let tmpList = []; let tmpList = [];
@ -478,15 +498,22 @@ struct Index {
// const param = { id: 46, list: tmpList, carNo: globalThis.carInfo.carNo, placeId: globalThis.carInfo.examinationRoomId,callback:()=>{ // const param = { id: 46, list: tmpList, carNo: globalThis.carInfo.carNo, placeId: globalThis.carInfo.examinationRoomId,callback:()=>{
// const param = { id: 46, list: tmpList, carNo: 489, placeId: 62 } // const param = { id: 46, list: tmpList, carNo: 489, placeId: 62 }
const param= {id: 31,list:tmpList,carNo:globalThis.carInfo.carNo,placeId:globalThis.carInfo.examinationRoomId} const param = {
id: 31,
list: tmpList,
carNo: globalThis.carInfo.carNo,
placeId: globalThis.carInfo.examinationRoomId
}
globalThis.udpClient2 && globalThis.udpClient2.sendMsg(param, this.context) globalThis.udpClient2 && globalThis.udpClient2.sendMsg(param, this.context)
} }
facePass() { facePass() {
if (!this.stepFlag) { if (!this.stepFlag) {
this.sfbdinterfaceFn() this.sfbdinterfaceFn()
} }
} }
onReadCard(ret) { onReadCard(ret) {
console.info(`zzctest xx Read Card ret =${ret.status}`) console.info(`zzctest xx Read Card ret =${ret.status}`)
let thisVar = globalThis.indexComponent; let thisVar = globalThis.indexComponent;
@ -539,9 +566,11 @@ struct Index {
console.info(`zzctest Read Card end`); console.info(`zzctest Read Card end`);
return true; return true;
} }
async initSysset() { async initSysset() {
const that = this; const that = this;
const db = new AccountTable(()=>{},MA_SYSSET); const db = new AccountTable(() => {
}, MA_SYSSET);
db.getRdbStore(() => { db.getRdbStore(() => {
db.query('0', (syssetParams) => { db.query('0', (syssetParams) => {
const serialNumberArr = syssetParams.filter(sys => sys.v_no === '901') const serialNumberArr = syssetParams.filter(sys => sys.v_no === '901')
@ -571,6 +600,7 @@ struct Index {
}) })
}) })
} }
// async getVideoConfig(){ // async getVideoConfig(){
// const data = await this.fileUtil.readFile('/mnt/hmdfs/100/account/device_view/localfiles/files/logs/config/config3.txt'); // const data = await this.fileUtil.readFile('/mnt/hmdfs/100/account/device_view/localfiles/files/logs/config/config3.txt');
// this.param=JSON.parse(data) // this.param=JSON.parse(data)
@ -606,6 +636,7 @@ struct Index {
this.pageIndex--; this.pageIndex--;
this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4)
} }
getCurrentStudent(id) { getCurrentStudent(id) {
let flag = false let flag = false
this.pageIndex this.pageIndex
@ -640,6 +671,7 @@ struct Index {
}); });
} }
} }
getExaminationStudentInfoFn() { getExaminationStudentInfoFn() {
if (globalThis.singlePlay) { if (globalThis.singlePlay) {
return return
@ -751,6 +783,7 @@ struct Index {
console.log('error12error' + error) console.log('error12error' + error)
}) })
} }
fillZero(str, len) { fillZero(str, len) {
str = str + ''; str = str + '';
if (str.length > len || !len) { if (str.length > len || !len) {
@ -765,6 +798,7 @@ struct Index {
return zeroStr + str; return zeroStr + str;
} }
string2Bytes(number, len) { string2Bytes(number, len) {
// console.log('string2Bytes == ', number) // console.log('string2Bytes == ', number)
let str = (+number).toString(2); let str = (+number).toString(2);
@ -788,6 +822,7 @@ struct Index {
} }
return arrBytes; return arrBytes;
} }
getPhotosForOtherFn(data, type) { getPhotosForOtherFn(data, type) {
const date = new Date() const date = new Date()
const param = { const param = {
@ -804,6 +839,7 @@ struct Index {
} }
}) })
} }
qkFn() { qkFn() {
this.faceCompareSucess = 0 this.faceCompareSucess = 0
@ -828,7 +864,12 @@ struct Index {
// } // }
// const param = { id: 46, list: tmpList, carNo: 489, placeId: 62 } // const param = { id: 46, list: tmpList, carNo: 489, placeId: 62 }
console.log('globalThis.signNum', globalThis.signNum) console.log('globalThis.signNum', globalThis.signNum)
const param= {id: 43,list:tmpList,carNo: globalThis.carInfo.carNo,placeId: globalThis.carInfo.examinationRoomId} const param = {
id: 43,
list: tmpList,
carNo: globalThis.carInfo.carNo,
placeId: globalThis.carInfo.examinationRoomId
}
globalThis.udpClient2.sendMsg(param, this.context) globalThis.udpClient2.sendMsg(param, this.context)
if (res.examinationStuAbsentRsp.head.resultCode == '0') { if (res.examinationStuAbsentRsp.head.resultCode == '0') {
@ -867,12 +908,12 @@ struct Index {
}) })
} }
outClick() { outClick() {
testNapi.StopReadCard(); testNapi.StopReadCard();
// console.log("zzctest Close Device ret = " + testNapi.CloseDevice()); // console.log("zzctest Close Device ret = " + testNapi.CloseDevice());
} }
async sfbdinterfaceFn() { async sfbdinterfaceFn() {
this.stepFlag = true this.stepFlag = true
console.info('surenjun', this.currentUser.lsh) console.info('surenjun', this.currentUser.lsh)
@ -1097,6 +1138,7 @@ struct Index {
.margin({ left: 8 * this.ratio }) .margin({ left: 8 * this.ratio })
.align(Alignment.Center) .align(Alignment.Center)
}.margin({ bottom: 10 * this.ratio }) }.margin({ bottom: 10 * this.ratio })
Row() { Row() {
Text('待考次数').fontSize(16 * this.ratio).fontColor('#99948A') Text('待考次数').fontSize(16 * this.ratio).fontColor('#99948A')
Row() { Row() {
@ -1141,7 +1183,8 @@ struct Index {
.height(69 * this.ratio) .height(69 * this.ratio)
.backgroundImage($r('app.media.button_nor')) .backgroundImage($r('app.media.button_nor'))
.backgroundImageSize({ width: '100%', height: '100%' }) .backgroundImageSize({ width: '100%', height: '100%' })
.margin({ bottom: 12 * this.ratio }).onClick(()=>{ .margin({ bottom: 12 * this.ratio })
.onClick(() => {
// this.getCurrentStudent('3423231995014700007') // this.getCurrentStudent('3423231995014700007')
// this.vocObj.playAudio({ // this.vocObj.playAudio({
// type: 1, // type: 1,
@ -1158,7 +1201,8 @@ struct Index {
.height(69 * this.ratio) .height(69 * this.ratio)
.backgroundImage($r('app.media.button_nor')) .backgroundImage($r('app.media.button_nor'))
.backgroundImageSize({ width: '100%', height: '100%' }) .backgroundImageSize({ width: '100%', height: '100%' })
.margin({ bottom: 12 * this.ratio }).onClick(()=>{ .margin({ bottom: 12 * this.ratio })
.onClick(() => {
this.faceCompareSucess = 0 this.faceCompareSucess = 0
this.numCount = 0 this.numCount = 0
this.getExaminationStudentInfoFn() this.getExaminationStudentInfoFn()
@ -1234,12 +1278,23 @@ struct Index {
}) })
} }
} }
if (this.showFaceCompare) { if (this.showFaceCompare) {
FaceCompare({ showFaceCompare: $showFaceCompare, sfzh: this.currentUser.sfzmhm, firstImage:this.currentUser.kszp,faceCompareSucess: $faceCompareSucess,getqkFlag:$getqkFlag,faceCatchImg:$faceCatchImg,lsh:globalThis.lsh }) FaceCompare({
showFaceCompare: $showFaceCompare,
sfzh: this.currentUser.sfzmhm,
firstImage: this.currentUser.kszp,
faceCompareSucess: $faceCompareSucess,
getqkFlag: $getqkFlag,
faceCatchImg: $faceCatchImg,
lsh: globalThis.lsh
})
} }
if (this.qkFlag) { if (this.qkFlag) {
Column() { Column() {
Text('确认考生:'+this.currentUser.xm+'是否缺考').fontSize(28*this.ratio).position({x:160*this.ratio,y:122*this.ratio}) Text('确认考生:' + this.currentUser.xm + '是否缺考')
.fontSize(28 * this.ratio)
.position({ x: 160 * this.ratio, y: 122 * this.ratio })
Row() { Row() {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Text(' 取 消 ').fontSize(24 * this.ratio).fontColor('#fff').width(100 * this.ratio) Text(' 取 消 ').fontSize(24 * this.ratio).fontColor('#fff').width(100 * this.ratio)
@ -1248,9 +1303,11 @@ struct Index {
.height(69 * this.ratio) .height(69 * this.ratio)
.backgroundImage($r('app.media.button_nor')) .backgroundImage($r('app.media.button_nor'))
.backgroundImageSize({ width: '100%', height: '100%' }) .backgroundImageSize({ width: '100%', height: '100%' })
.margin({ bottom: 12 * this.ratio }).onClick(()=>{ .margin({ bottom: 12 * this.ratio })
.onClick(() => {
this.qkFlag = false this.qkFlag = false
}) })
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Text(' 确 定 ').fontSize(24 * this.ratio).fontColor('#fff').width(100 * this.ratio) Text(' 确 定 ').fontSize(24 * this.ratio).fontColor('#fff').width(100 * this.ratio)
} }
@ -1258,19 +1315,19 @@ struct Index {
.height(69 * this.ratio) .height(69 * this.ratio)
.backgroundImage($r('app.media.button_nor')) .backgroundImage($r('app.media.button_nor'))
.backgroundImageSize({ width: '100%', height: '100%' }) .backgroundImageSize({ width: '100%', height: '100%' })
.margin({ bottom: 12 * this.ratio }).onClick(()=>{ .margin({ bottom: 12 * this.ratio })
.onClick(() => {
this.qkFn() this.qkFn()
}) })
}.position({ y: 265 * this.ratio, x: 115 * this.ratio }) }.position({ y: 265 * this.ratio, x: 115 * this.ratio })
}.width(660 * this.ratio) }
.width(660 * this.ratio)
.height(360 * this.ratio) .height(360 * this.ratio)
.position({ x: 150 * this.ratio, y: 98 * this.ratio }) .position({ x: 150 * this.ratio, y: 98 * this.ratio })
.backgroundColor('#E6E3DF') .backgroundColor('#E6E3DF')
.borderRadius(19 * this.ratio) .borderRadius(19 * this.ratio)
} }
} }
.height('100%') .height('100%')
.width('100%') .width('100%')

View File

@ -6,7 +6,7 @@
"pages/UserInfo", "pages/UserInfo",
"pages/register", "pages/register",
"pages/Settings", "pages/Settings",
"pages/TeminalInfos", "pages/TerminalInfo",
"pages/VideoConfig", "pages/VideoConfig",
"pages/Hello", "pages/Hello",
"pages/Judge", "pages/Judge",