Compare commits
No commits in common. "9445377a5d9a1c9d4b97e5db34e404016dd3b4b4" and "6097346330b7754698bed4c51e8524a45f2ae192" have entirely different histories.
9445377a5d
...
6097346330
@ -183,11 +183,9 @@ export async function getUDP2(context,errorFlag?) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if(val.body[0] == 11){
|
if(val.body[0] == 11){
|
||||||
console.info('surenjun','GlobalUdp收到beginExam事件')
|
|
||||||
globalThis.udpEvent.sendBeginExam()
|
globalThis.udpEvent.sendBeginExam()
|
||||||
}
|
}
|
||||||
if(val.body[0] == 12){
|
if(val.body[0] == 12){
|
||||||
console.info('surenjun','GlobalUdp收到endExam事件')
|
|
||||||
globalThis.udpEvent.sendEndExam()
|
globalThis.udpEvent.sendEndExam()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,6 @@ export default class JudgeEmitter{
|
|||||||
}
|
}
|
||||||
|
|
||||||
init = async ()=>{
|
init = async ()=>{
|
||||||
console.info('surenjun','开始注册udp事件')
|
|
||||||
emitter.on({eventId:EVENTID.beginExamEventId}, () => {
|
emitter.on({eventId:EVENTID.beginExamEventId}, () => {
|
||||||
this?.beginExamCallBack()
|
this?.beginExamCallBack()
|
||||||
});
|
});
|
||||||
@ -37,7 +36,6 @@ export default class JudgeEmitter{
|
|||||||
|
|
||||||
//监听开始考试
|
//监听开始考试
|
||||||
public onBeginExam = async (callBack?:Function)=>{
|
public onBeginExam = async (callBack?:Function)=>{
|
||||||
console.info('surenjun','userInfo注册onBeginExam事件')
|
|
||||||
this.beginExamCallBack = callBack
|
this.beginExamCallBack = callBack
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,14 +50,14 @@ export default class JudgeEmitter{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//开始考试
|
//开始考试
|
||||||
public sendBeginExam = async(content:string)=>{
|
public sendBeginExam = async(content)=>{
|
||||||
emitter.emit({eventId:EVENTID.beginExamEventId}, {
|
emitter.emit({eventId:EVENTID.beginExamEventId}, {
|
||||||
data:{ content }
|
data:{ content }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//结束考试
|
//结束考试
|
||||||
public sendEndExam = async(content:string)=>{
|
public sendEndExam = async(content)=>{
|
||||||
emitter.emit({eventId:EVENTID.endExamEventId}, {
|
emitter.emit({eventId:EVENTID.endExamEventId}, {
|
||||||
data:{content}
|
data:{content}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -184,7 +184,7 @@ struct Index {
|
|||||||
Column() {
|
Column() {
|
||||||
Row() {
|
Row() {
|
||||||
Column() {
|
Column() {
|
||||||
Text('V ' + globalThis.version)
|
Text('V 1.0')
|
||||||
.fontColor('#CCAE7A')
|
.fontColor('#CCAE7A')
|
||||||
.fontSize(22 * globalThis.ratio)
|
.fontSize(22 * globalThis.ratio)
|
||||||
.width('30%')
|
.width('30%')
|
||||||
|
|||||||
@ -82,7 +82,6 @@ struct Index {
|
|||||||
this.singlePlay = globalThis.singlePlay
|
this.singlePlay = globalThis.singlePlay
|
||||||
}
|
}
|
||||||
await this.initCDSBInfo()
|
await this.initCDSBInfo()
|
||||||
await this.initItemInfo()
|
|
||||||
|
|
||||||
// 科目三新增读取表数据
|
// 科目三新增读取表数据
|
||||||
if (examSubject == 3) {
|
if (examSubject == 3) {
|
||||||
@ -258,7 +257,6 @@ struct Index {
|
|||||||
if (no1 == 3 && no3 == 1) {
|
if (no1 == 3 && no3 == 1) {
|
||||||
if (txt1 === carName) {
|
if (txt1 === carName) {
|
||||||
carNo = no2
|
carNo = no2
|
||||||
this.carlist = carNo
|
|
||||||
console.info('surenjun carNo => ',carNo)
|
console.info('surenjun carNo => ',carNo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -357,28 +355,7 @@ struct Index {
|
|||||||
xmxh: key.split('~')[1],
|
xmxh: key.split('~')[1],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取itemInfo表信息
|
|
||||||
async initItemInfo(){
|
|
||||||
const infoParams = await getSyncData('MA_ITEMINFO');
|
|
||||||
const carlist = this.carlist;
|
|
||||||
const projectsObj = this.projectsObj
|
|
||||||
//@ts-ignore
|
|
||||||
infoParams.forEach((info)=>{
|
|
||||||
const key = decodeURI(info.itemsno);
|
|
||||||
const carlistArr = decodeURI(info.carlist).split(',') || []
|
|
||||||
const newKey = key.split('~').join('_')
|
|
||||||
//@ts-ignore
|
|
||||||
const xmdm = key.split('~')[0] * 1
|
|
||||||
if(projectsObj[xmdm] && (carlistArr.length == 0 || carlistArr.includes(carlist))){
|
|
||||||
this.itemInfoObj[newKey] = {
|
|
||||||
modelKey: newKey,
|
|
||||||
xmdm,
|
|
||||||
xmxh: key.split('~')[1],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1136,6 +1113,7 @@ struct Index {
|
|||||||
//里程是否达标 && 必考项目是否全完成
|
//里程是否达标 && 必考项目是否全完成
|
||||||
return jl >= Number(examMileage) && isRequiredProjectsEnd
|
return jl >= Number(examMileage) && isRequiredProjectsEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1182,7 +1160,7 @@ struct Index {
|
|||||||
|
|
||||||
//405参数为2是,如果在最左侧车道,超车项目不能触发;
|
//405参数为2是,如果在最左侧车道,超车项目不能触发;
|
||||||
if (projectCode == '10' &&
|
if (projectCode == '10' &&
|
||||||
judgeConfigObj['405'] == '2' &&
|
judgeConfigObj['402'] == '2' &&
|
||||||
(num === count) &&
|
(num === count) &&
|
||||||
num > 0
|
num > 0
|
||||||
) {
|
) {
|
||||||
@ -1253,7 +1231,6 @@ struct Index {
|
|||||||
@State projectsCenterObj: ProjectObj = {}
|
@State projectsCenterObj: ProjectObj = {}
|
||||||
@State markRuleListObj: MarkRule = {}
|
@State markRuleListObj: MarkRule = {}
|
||||||
@State cdsbInfoObj: CDSBInfo = {}
|
@State cdsbInfoObj: CDSBInfo = {}
|
||||||
@State itemInfoObj: CDSBInfo = {}
|
|
||||||
@State timer: number = 0
|
@State timer: number = 0
|
||||||
@State judgeConfig: { [k: string]: string }[] = []
|
@State judgeConfig: { [k: string]: string }[] = []
|
||||||
@State judgeConfigObj: { [k: string]: any } = defaultJudgeConfigObj
|
@State judgeConfigObj: { [k: string]: any } = defaultJudgeConfigObj
|
||||||
@ -1311,5 +1288,4 @@ struct Index {
|
|||||||
@State passingScore: number = 80
|
@State passingScore: number = 80
|
||||||
@State dwztErrorVisible: boolean = false;
|
@State dwztErrorVisible: boolean = false;
|
||||||
@State popTimer:number =0;
|
@State popTimer:number =0;
|
||||||
@State carlist:string= ''
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -817,77 +817,8 @@ struct UserInfo {
|
|||||||
return temp
|
return temp
|
||||||
}
|
}
|
||||||
|
|
||||||
//开始上车准备
|
|
||||||
prePareSCZB = async () => {
|
|
||||||
try {
|
|
||||||
await this.checkSignal()
|
|
||||||
this.isExamStart = true
|
|
||||||
this.currentUser.id = '0'
|
|
||||||
await upDateTableByArray('USER', [this.currentUser])
|
|
||||||
globalThis.statue = 4
|
|
||||||
this.isBoardPrePareSetPopupShow = true;
|
|
||||||
this.isFirstBoardPrePareSetPopupBtnShow = true;
|
|
||||||
this.stepFlag = false
|
|
||||||
this.stopDeviceById()
|
|
||||||
} catch (e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//开始考试准备
|
|
||||||
prePareExam = async() => {
|
|
||||||
if (this.ksksLimit) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
console.log('routerParamrouterParam')
|
|
||||||
try {
|
|
||||||
await this.checkSignal()
|
|
||||||
this.faceCompareSucess = 0
|
|
||||||
globalThis.statue = 2
|
|
||||||
if (!this.currentUser.xm) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.ksksLimit = true
|
|
||||||
|
|
||||||
if (globalThis.singlePlay) {
|
|
||||||
const {examSubject} = globalThis.carInfo;
|
|
||||||
this.currentUser.id = '0'
|
|
||||||
await upDateTableByArray('USER', [this.currentUser])
|
|
||||||
router.pushUrl({
|
|
||||||
url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
|
|
||||||
params: {
|
|
||||||
sczb: Number(this.isBoardPrePareSetPopupOpen),
|
|
||||||
kfdm: this.sczbkf,
|
|
||||||
}
|
|
||||||
}, router.RouterMode.Single);
|
|
||||||
this.ksksLimit = false
|
|
||||||
|
|
||||||
this.stopDeviceById()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
console.log('this.FaceOpenStatuethis.FaceOpenStatue',this.FaceOpenStatue)
|
|
||||||
if (this.FaceOpenStatue != '0') {
|
|
||||||
this.showFaceCompare = true
|
|
||||||
} else {
|
|
||||||
this.sfbdinterfaceFn()
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.info('Throw Error', JSON.stringify(e))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
aboutToDisappear() {
|
aboutToDisappear() {
|
||||||
this.outClick()
|
this.outClick()
|
||||||
//监听远程开始考试
|
|
||||||
globalThis.udpEvent.onBeginExam(async ()=>{
|
|
||||||
console.info('surenjun','userInfo收到UdpEvent事件')
|
|
||||||
if (this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow) {
|
|
||||||
await this.prePareSCZB()
|
|
||||||
}else{
|
|
||||||
await this.prePareExam()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
outClick() {
|
outClick() {
|
||||||
@ -1022,13 +953,63 @@ struct UserInfo {
|
|||||||
if (this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow) {
|
if (this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow) {
|
||||||
//上车准备
|
//上车准备
|
||||||
Image($r('app.media.sczb_btn')).commStyle().onClick(async () => {
|
Image($r('app.media.sczb_btn')).commStyle().onClick(async () => {
|
||||||
await this.prePareSCZB()
|
try {
|
||||||
|
await this.checkSignal()
|
||||||
|
this.isExamStart = true
|
||||||
|
this.currentUser.id = '0'
|
||||||
|
await upDateTableByArray('USER', [this.currentUser])
|
||||||
|
globalThis.statue = 4
|
||||||
|
this.isBoardPrePareSetPopupShow = true;
|
||||||
|
this.isFirstBoardPrePareSetPopupBtnShow = true;
|
||||||
|
this.stepFlag = false
|
||||||
|
this.stopDeviceById()
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Image($r('app.media.ksks_btn'))
|
Image($r('app.media.ksks_btn'))
|
||||||
.commStyle()
|
.commStyle()
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
await this.prePareExam()
|
if (this.ksksLimit) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log('routerParamrouterParam')
|
||||||
|
try {
|
||||||
|
await this.checkSignal()
|
||||||
|
this.faceCompareSucess = 0
|
||||||
|
globalThis.statue = 2
|
||||||
|
if (!this.currentUser.xm) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.ksksLimit = true
|
||||||
|
|
||||||
|
if (globalThis.singlePlay) {
|
||||||
|
const {examSubject} = globalThis.carInfo;
|
||||||
|
this.currentUser.id = '0'
|
||||||
|
await upDateTableByArray('USER', [this.currentUser])
|
||||||
|
router.pushUrl({
|
||||||
|
url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
|
||||||
|
params: {
|
||||||
|
sczb: Number(this.isBoardPrePareSetPopupOpen),
|
||||||
|
kfdm: this.sczbkf,
|
||||||
|
}
|
||||||
|
}, router.RouterMode.Single);
|
||||||
|
this.ksksLimit = false
|
||||||
|
|
||||||
|
this.stopDeviceById()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log('this.FaceOpenStatuethis.FaceOpenStatue',this.FaceOpenStatue)
|
||||||
|
if (this.FaceOpenStatue != '0') {
|
||||||
|
this.showFaceCompare = true
|
||||||
|
} else {
|
||||||
|
this.sfbdinterfaceFn()
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.info('Throw Error', JSON.stringify(e))
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -198,9 +198,6 @@ export default class Judge {
|
|||||||
handDistance();
|
handDistance();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
globalThis.udpEvent.onBeginExam(async ()=>{
|
|
||||||
this.checkExamIsEnd(true);
|
|
||||||
})
|
|
||||||
//TODO 监听远程扣分
|
//TODO 监听远程扣分
|
||||||
}
|
}
|
||||||
//实时计算gps经纬度距离
|
//实时计算gps经纬度距离
|
||||||
@ -230,13 +227,13 @@ export default class Judge {
|
|||||||
const carInfo = globalThis.carInfo;
|
const carInfo = globalThis.carInfo;
|
||||||
const { examSubject,plateNo,carId } = carInfo;
|
const { examSubject,plateNo,carId } = carInfo;
|
||||||
const judgeUI = this.judgeUI
|
const judgeUI = this.judgeUI
|
||||||
const {projectsObj,itemInfoObj,markRuleListObj,carType,carName,systemparmArr} = judgeUI
|
const {projectsObj,cdsbInfoObj,markRuleListObj,carType,carName,systemparmArr} = judgeUI
|
||||||
const examType = examSubject == 2 ? 'km2' : 'km3'
|
const examType = examSubject == 2 ? 'km2' : 'km3'
|
||||||
|
|
||||||
let allitems = [];
|
let allitems = [];
|
||||||
if (examSubject == 2) {
|
if (examSubject == 2) {
|
||||||
allitems = Reflect.ownKeys(itemInfoObj).map(cdsbKey => {
|
allitems = Reflect.ownKeys(cdsbInfoObj).map(cdsbKey => {
|
||||||
const cdsb = itemInfoObj[cdsbKey];
|
const cdsb = cdsbInfoObj[cdsbKey];
|
||||||
const {xmdm,xmxh,modelKey} = cdsb
|
const {xmdm,xmxh,modelKey} = cdsb
|
||||||
return {
|
return {
|
||||||
xmdm, xmxh, model: getModelData(`${examType}/${modelKey}.txt`)
|
xmdm, xmxh, model: getModelData(`${examType}/${modelKey}.txt`)
|
||||||
@ -257,8 +254,6 @@ export default class Judge {
|
|||||||
systemparm: systemparmArr,
|
systemparm: systemparmArr,
|
||||||
mark: Reflect.ownKeys(markRuleListObj).map(ruleKey => (markRuleListObj[ruleKey])) || testMarkRules,
|
mark: Reflect.ownKeys(markRuleListObj).map(ruleKey => (markRuleListObj[ruleKey])) || testMarkRules,
|
||||||
sysset: judgeUI.judgeConfig,
|
sysset: judgeUI.judgeConfig,
|
||||||
itemInfoObj,
|
|
||||||
carlist:judgeUI.carlist
|
|
||||||
};
|
};
|
||||||
let km3Config = {}
|
let km3Config = {}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user