feat:济南问题修改
This commit is contained in:
parent
83f6633957
commit
4a72761601
@ -28,7 +28,7 @@ import DeviceInfoTable from '../constants/DeviceInfoTable'
|
|||||||
import USER from '../constants/USER'
|
import USER from '../constants/USER'
|
||||||
import util from '@ohos.util';
|
import util from '@ohos.util';
|
||||||
import zlib from '@ohos.zlib';
|
import zlib from '@ohos.zlib';
|
||||||
import FileModel from '../../pages/judgeSDK/utils/file-model';
|
import FileModel from '../../pages/judgeSDK/utils/fileModel';
|
||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
//读表
|
//读表
|
||||||
//参数平台
|
//参数平台
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import http from '@ohos.net.http';
|
import http from '@ohos.net.http';
|
||||||
import convertxml from '@ohos.convertxml';
|
import convertxml from '@ohos.convertxml';
|
||||||
import prompt from '@ohos.prompt'
|
import prompt from '@ohos.prompt'
|
||||||
import { sendGreen } from '../../pages/judgeSDK/utils/judge-common';
|
import { sendGreen } from '../../pages/judgeSDK/utils/judgeCommon';
|
||||||
import {GlobalConfig} from '../../config/index'
|
import {GlobalConfig} from '../../config/index'
|
||||||
const config = {
|
const config = {
|
||||||
host:GlobalConfig.host,
|
host:GlobalConfig.host,
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import LoadingPopup from './compontents/judge/LoadingPopup';
|
|||||||
import DeductedPopup from './compontents/judge/DeductionPopup';
|
import DeductedPopup from './compontents/judge/DeductionPopup';
|
||||||
import AmplifyPopup from './compontents/judge/AmplifyPopup';
|
import AmplifyPopup from './compontents/judge/AmplifyPopup';
|
||||||
import Judge from './judgeSDK/judge';
|
import Judge from './judgeSDK/judge';
|
||||||
import { defaultJudgeConfigObj } from './judgeSDK/utils//judge-common';
|
import { defaultJudgeConfigObj } from './judgeSDK/utils//judgeCommon';
|
||||||
import {
|
import {
|
||||||
CARINFO,
|
CARINFO,
|
||||||
CDSBInfo,
|
CDSBInfo,
|
||||||
@ -21,7 +21,7 @@ import {
|
|||||||
import { chunkArr, formatTime, getCurrentHourTime, getCurrentTime } from '../common/utils/tools';
|
import { chunkArr, formatTime, getCurrentHourTime, getCurrentTime } from '../common/utils/tools';
|
||||||
import { examJudgeEndExam } from './judgeSDK/api/index';
|
import { examJudgeEndExam } from './judgeSDK/api/index';
|
||||||
import { getSyncData } from '../common/service/initable';
|
import { getSyncData } from '../common/service/initable';
|
||||||
import { judgeConfig } from './judgeSDK/utils/judge-config';
|
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
|
||||||
import FileUtil from '../common/utils/File';
|
import FileUtil from '../common/utils/File';
|
||||||
import SignDisplayCom from './compontents/signDisplayCom';
|
import SignDisplayCom from './compontents/signDisplayCom';
|
||||||
|
|
||||||
@ -29,78 +29,6 @@ import SignDisplayCom from './compontents/signDisplayCom';
|
|||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
struct Index {
|
struct Index {
|
||||||
scroller: Scroller = new Scroller()
|
|
||||||
//页面通用字体大小
|
|
||||||
@State FONTSIZE: number = 28
|
|
||||||
@State BIGFONTSIZE: number = 28
|
|
||||||
//结束考试弹窗
|
|
||||||
@State endPopupVisible: boolean = false
|
|
||||||
//等待弹窗(考试及格,考试不及格使用)
|
|
||||||
@State loadingPopupVisible: boolean = false
|
|
||||||
//实时轨迹弹窗
|
|
||||||
@State signDisplayComVisible: boolean = false
|
|
||||||
@State isDdxk: boolean = false;
|
|
||||||
@State time: string = ''
|
|
||||||
//考试用时
|
|
||||||
@State examTime: number = 0
|
|
||||||
//开始时间
|
|
||||||
@State startTime: string = '00:00:00'
|
|
||||||
@State startFullTime: string = ''
|
|
||||||
@State startHourTime: string = ''
|
|
||||||
//科目类型
|
|
||||||
@State examSubject: 2 | 3 = 3;
|
|
||||||
@State ddxkTime: number = 0;
|
|
||||||
@State ddxkKsxmArr: string[] = ['']
|
|
||||||
@State ddxkKfArr: string[] = ['']
|
|
||||||
@State xmmcStr: string = ''
|
|
||||||
@State carztStr: string = ''
|
|
||||||
@State kfArr: {
|
|
||||||
xmmcStr?: string,
|
|
||||||
score: string,
|
|
||||||
desc: string
|
|
||||||
}[] = []
|
|
||||||
@State name: string = ''
|
|
||||||
@State idCard: string = ''
|
|
||||||
@State totalScore: number = 100
|
|
||||||
//模拟考试项目
|
|
||||||
@State projects: Project[] = []
|
|
||||||
@State projectsObj: ProjectObj = {}
|
|
||||||
@State projectsCenterObj: ProjectObj = {}
|
|
||||||
@State markRuleListObj: MarkRule = {}
|
|
||||||
@State cdsbInfoObj: CDSBInfo = {}
|
|
||||||
@State timer: number = 0
|
|
||||||
@State judgeConfig: { [k: string]: string }[] = []
|
|
||||||
@State judgeConfigObj: { [k: string]: any } = defaultJudgeConfigObj
|
|
||||||
//流水号
|
|
||||||
@State lsh: string = ''
|
|
||||||
@State kszp: string = ''
|
|
||||||
@State ksdd: string = ''
|
|
||||||
@State kssycs: string = ''
|
|
||||||
@State kslx: string = ''
|
|
||||||
//监管接口序列号
|
|
||||||
@State serialNumber: number = 0
|
|
||||||
@State carType: string = ''
|
|
||||||
@State carName: string = ''
|
|
||||||
@State isDeductedPopShow: boolean = false
|
|
||||||
@State isAmplifyPopShow: boolean = false
|
|
||||||
@State amplifiedImgIndex: number = 0
|
|
||||||
@State judge: any = {}
|
|
||||||
//行驶距离
|
|
||||||
@State jl: number = 0
|
|
||||||
//应考里程
|
|
||||||
@State examMileage: string = '0'
|
|
||||||
@State artSubject3Projects: string[] = ['直线', '会车', '变道', '超车', '掉头', '停车']
|
|
||||||
@State artSubject3ProjectsCodesArr: string[] = ['3', '9', '4', '10', '12', '11']
|
|
||||||
@State manualMarkRules: MarkRule[] = []
|
|
||||||
//科目三评判初始化数据
|
|
||||||
@State systemparmArr: SYSTEMPARMARR[] = []
|
|
||||||
@State mapPointItemArr: MAPITEMPOINTITEM[] = []
|
|
||||||
@State carinfoArrr: CARINFO[] = []
|
|
||||||
@State mapPointArr: MAPPOINT[] = []
|
|
||||||
private context = getContext(this) as common.UIAbilityContext;
|
|
||||||
private img: ImageBitmap = new ImageBitmap("/resources/base/media/1.png")
|
|
||||||
//已考的考试项目
|
|
||||||
private wantInfos = []
|
|
||||||
|
|
||||||
async aboutToAppear() {
|
async aboutToAppear() {
|
||||||
globalThis.windowClass.setWindowSystemBarEnable([''])
|
globalThis.windowClass.setWindowSystemBarEnable([''])
|
||||||
@ -121,6 +49,8 @@ struct Index {
|
|||||||
//断点续考
|
//断点续考
|
||||||
await this.goDdxkItems()
|
await this.goDdxkItems()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//初始化评判
|
//初始化评判
|
||||||
const judge = await this.initJudge();
|
const judge = await this.initJudge();
|
||||||
this.judge = judge
|
this.judge = judge
|
||||||
@ -200,10 +130,9 @@ struct Index {
|
|||||||
NoCancelId: mark.nocancelid * 1,
|
NoCancelId: mark.nocancelid * 1,
|
||||||
GPS_SID: mark.gps_sid == 0 ? false : true
|
GPS_SID: mark.gps_sid == 0 ? false : true
|
||||||
}
|
}
|
||||||
const markserial = mark.markserial * 1;
|
|
||||||
|
|
||||||
//筛选出人工评判的扣分
|
//筛选出人工评判的扣分
|
||||||
if (markserial > 100 && markserial < 200) {
|
if (Number(tempObj.markserial) > 100 && Number(tempObj.markserial) < 200) {
|
||||||
this.manualMarkRules.push(tempObj)
|
this.manualMarkRules.push(tempObj)
|
||||||
}
|
}
|
||||||
this.markRuleListObj[`${mark.itemno}_${mark.markserial}`] = {
|
this.markRuleListObj[`${mark.itemno}_${mark.markserial}`] = {
|
||||||
@ -244,6 +173,33 @@ struct Index {
|
|||||||
this.examMileage = sys.v_value + '';
|
this.examMileage = sys.v_value + '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//364 绕车一周评判时机(1-开始考试后判 2-开始考试前判)
|
||||||
|
if(sys.v_no == '364' && sys.v_value == 2 ){
|
||||||
|
let currentParams: any = router.getParams();
|
||||||
|
const {sczb,kfdm} = currentParams;
|
||||||
|
kfdm.forEach(kf => {
|
||||||
|
const {xmdm, kfdm} = kf
|
||||||
|
const currentKf = this.markRuleListObj[`${xmdm}_${kfdm}`];
|
||||||
|
const currentProject = this.projectsObj[xmdm]
|
||||||
|
this.kfArr.push({
|
||||||
|
//扣分项目名称
|
||||||
|
xmmcStr: currentProject.name,
|
||||||
|
//@ts-ignore
|
||||||
|
xmdm,
|
||||||
|
desc: currentKf.markshow,
|
||||||
|
score: currentKf.markreal,
|
||||||
|
markcatalog: currentKf.markcatalog,
|
||||||
|
markserial: currentKf.markserial,
|
||||||
|
kfxh: currentKf.kfxh
|
||||||
|
})
|
||||||
|
this.totalScore += currentKf.markreal * 1;
|
||||||
|
})
|
||||||
|
this.projectsObj['1'].type = kfdm.length ? '4':'3';
|
||||||
|
this.projectsObj = {
|
||||||
|
...this.projectsObj
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.judgeConfigObj[sys.v_no] = value
|
this.judgeConfigObj[sys.v_no] = value
|
||||||
});
|
});
|
||||||
this.judgeConfig = syssetJudgeConfigArr;
|
this.judgeConfig = syssetJudgeConfigArr;
|
||||||
@ -300,7 +256,8 @@ struct Index {
|
|||||||
//初始化systemParam表
|
//初始化systemParam表
|
||||||
async initSystemKm3Param(sysParam?: SYSTEMPARMARR[]) {
|
async initSystemKm3Param(sysParam?: SYSTEMPARMARR[]) {
|
||||||
const systemParms: any = sysParam || await getSyncData('MA_SYSTEMPARM')
|
const systemParms: any = sysParam || await getSyncData('MA_SYSTEMPARM')
|
||||||
|
let currentParams: any = router.getParams();
|
||||||
|
this.wayno = currentParams.wayno
|
||||||
const {isTrajectoryOpen} = judgeConfig
|
const {isTrajectoryOpen} = judgeConfig
|
||||||
|
|
||||||
systemParms.forEach((systemParm) => {
|
systemParms.forEach((systemParm) => {
|
||||||
@ -538,7 +495,7 @@ struct Index {
|
|||||||
if (this.examSubject == 3) {
|
if (this.examSubject == 3) {
|
||||||
Row() {
|
Row() {
|
||||||
Text('考试路线:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
|
Text('考试路线:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
|
||||||
Text(`线路${globalThis.carInfo.wayno}`).fontColor('#FFAD33').fontSize(this.FONTSIZE)
|
Text(`线路${this.wayno}`).fontColor('#FFAD33').fontSize(this.FONTSIZE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -905,6 +862,7 @@ struct Index {
|
|||||||
if (this.isDeductedPopShow) {
|
if (this.isDeductedPopShow) {
|
||||||
DeductedPopup({
|
DeductedPopup({
|
||||||
currentItems: Reflect.ownKeys(this.projectsObj).map(projectKey => {
|
currentItems: Reflect.ownKeys(this.projectsObj).map(projectKey => {
|
||||||
|
//@ts-ignore
|
||||||
const project = this.projectsObj[projectKey]
|
const project = this.projectsObj[projectKey]
|
||||||
return project.type == '2' ? project.projectCode : ''
|
return project.type == '2' ? project.projectCode : ''
|
||||||
}).filter(project => project !== ''),
|
}).filter(project => project !== ''),
|
||||||
@ -974,6 +932,7 @@ struct Index {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//@ts-ignore
|
||||||
if (param348 == '0' && projectsObj['9']?.type == 2) {
|
if (param348 == '0' && projectsObj['9']?.type == 2) {
|
||||||
return index === 0 ? true : false
|
return index === 0 ? true : false
|
||||||
}
|
}
|
||||||
@ -985,4 +944,78 @@ struct Index {
|
|||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scroller: Scroller = new Scroller()
|
||||||
|
//页面通用字体大小
|
||||||
|
@State wayno:number = 0
|
||||||
|
@State FONTSIZE: number = 28
|
||||||
|
@State BIGFONTSIZE: number = 28
|
||||||
|
//结束考试弹窗
|
||||||
|
@State endPopupVisible: boolean = false
|
||||||
|
//等待弹窗(考试及格,考试不及格使用)
|
||||||
|
@State loadingPopupVisible: boolean = false
|
||||||
|
//实时轨迹弹窗
|
||||||
|
@State signDisplayComVisible: boolean = false
|
||||||
|
@State isDdxk: boolean = false;
|
||||||
|
@State time: string = ''
|
||||||
|
//考试用时
|
||||||
|
@State examTime: number = 0
|
||||||
|
//开始时间
|
||||||
|
@State startTime: string = '00:00:00'
|
||||||
|
@State startFullTime: string = ''
|
||||||
|
@State startHourTime: string = ''
|
||||||
|
//科目类型
|
||||||
|
@State examSubject: 2 | 3 = 3;
|
||||||
|
@State ddxkTime: number = 0;
|
||||||
|
@State ddxkKsxmArr: string[] = ['']
|
||||||
|
@State ddxkKfArr: string[] = ['']
|
||||||
|
@State xmmcStr: string = ''
|
||||||
|
@State carztStr: string = ''
|
||||||
|
@State kfArr: {
|
||||||
|
xmmcStr?: string,
|
||||||
|
score: string,
|
||||||
|
desc: string
|
||||||
|
}[] = []
|
||||||
|
@State name: string = ''
|
||||||
|
@State idCard: string = ''
|
||||||
|
@State totalScore: number = 100
|
||||||
|
//模拟考试项目
|
||||||
|
@State projects: Project[] = []
|
||||||
|
@State projectsObj: ProjectObj = {}
|
||||||
|
@State projectsCenterObj: ProjectObj = {}
|
||||||
|
@State markRuleListObj: MarkRule = {}
|
||||||
|
@State cdsbInfoObj: CDSBInfo = {}
|
||||||
|
@State timer: number = 0
|
||||||
|
@State judgeConfig: { [k: string]: string }[] = []
|
||||||
|
@State judgeConfigObj: { [k: string]: any } = defaultJudgeConfigObj
|
||||||
|
//流水号
|
||||||
|
@State lsh: string = ''
|
||||||
|
@State kszp: string = ''
|
||||||
|
@State ksdd: string = ''
|
||||||
|
@State kssycs: string = ''
|
||||||
|
@State kslx: string = ''
|
||||||
|
//监管接口序列号
|
||||||
|
@State serialNumber: number = 0
|
||||||
|
@State carType: string = ''
|
||||||
|
@State carName: string = ''
|
||||||
|
@State isDeductedPopShow: boolean = false
|
||||||
|
@State isAmplifyPopShow: boolean = false
|
||||||
|
@State amplifiedImgIndex: number = 0
|
||||||
|
@State judge: any = {}
|
||||||
|
//行驶距离
|
||||||
|
@State jl: number = 0
|
||||||
|
//应考里程
|
||||||
|
@State examMileage: string = '0'
|
||||||
|
@State artSubject3Projects: string[] = ['直线', '会车', '变道', '超车', '掉头', '停车']
|
||||||
|
@State artSubject3ProjectsCodesArr: string[] = ['3', '9', '4', '10', '12', '11']
|
||||||
|
@State manualMarkRules: MarkRule[] = []
|
||||||
|
//科目三评判初始化数据
|
||||||
|
@State systemparmArr: SYSTEMPARMARR[] = []
|
||||||
|
@State mapPointItemArr: MAPITEMPOINTITEM[] = []
|
||||||
|
@State carinfoArrr: CARINFO[] = []
|
||||||
|
@State mapPointArr: MAPPOINT[] = []
|
||||||
|
private context = getContext(this) as common.UIAbilityContext;
|
||||||
|
private img: ImageBitmap = new ImageBitmap("/resources/base/media/1.png")
|
||||||
|
//已考的考试项目
|
||||||
|
private wantInfos = []
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,6 @@ export default struct Index {
|
|||||||
const {no1,no2,no3,txt1,txt2} = systemParm;
|
const {no1,no2,no3,txt1,txt2} = systemParm;
|
||||||
if (no1 == 4) {
|
if (no1 == 4) {
|
||||||
const temp = { no2, no3, txt1: decodeURI(txt1), txt2 }
|
const temp = { no2, no3, txt1: decodeURI(txt1), txt2 }
|
||||||
console.info('surenjun', JSON.stringify(temp))
|
|
||||||
this.roadObj[no2] = no2
|
this.roadObj[no2] = no2
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -57,10 +56,8 @@ export default struct Index {
|
|||||||
const roadArr = Reflect.ownKeys(this.roadObj).map((roadKey) => {
|
const roadArr = Reflect.ownKeys(this.roadObj).map((roadKey) => {
|
||||||
return this.roadObj[roadKey]
|
return this.roadObj[roadKey]
|
||||||
});
|
});
|
||||||
globalThis.carInfo.wayno = roadArr[Math.floor(Math.random()*roadArr.length)];
|
const wayno = roadArr[Math.floor(Math.random()*roadArr.length)];
|
||||||
router.pushUrl({
|
this.goJudge(wayno)
|
||||||
url: 'pages/Judge',
|
|
||||||
}, router.RouterMode.Single);
|
|
||||||
})
|
})
|
||||||
ForEach(Reflect.ownKeys(this.roadObj), (roadIndex) => {
|
ForEach(Reflect.ownKeys(this.roadObj), (roadIndex) => {
|
||||||
ListItem() {
|
ListItem() {
|
||||||
@ -81,10 +78,7 @@ export default struct Index {
|
|||||||
.height(220)
|
.height(220)
|
||||||
.margin({ left: 5, bottom: 10 })
|
.margin({ left: 5, bottom: 10 })
|
||||||
.onClick(async () => {
|
.onClick(async () => {
|
||||||
globalThis.carInfo.wayno = this.roadObj[roadIndex];
|
this.goJudge(this.roadObj[roadIndex])
|
||||||
router.pushUrl({
|
|
||||||
url: 'pages/Judge',
|
|
||||||
}, router.RouterMode.Single);
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}.lanes(8).margin({ top: 50, left: 15 })
|
}.lanes(8).margin({ top: 50, left: 15 })
|
||||||
@ -95,6 +89,18 @@ export default struct Index {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
outClick() {
|
goJudge(wayno) {
|
||||||
|
let currentParams: any = router.getParams() || {};
|
||||||
|
const {sczb,kfdm} = currentParams;
|
||||||
|
router.replaceUrl({
|
||||||
|
url: 'pages/Judge',
|
||||||
|
params:{
|
||||||
|
sczb,
|
||||||
|
kfdm,
|
||||||
|
wayno
|
||||||
}
|
}
|
||||||
|
}, router.RouterMode.Single);
|
||||||
|
|
||||||
|
}
|
||||||
|
outClick(){}
|
||||||
}
|
}
|
||||||
@ -14,8 +14,9 @@ import common from '@ohos.app.ability.common';
|
|||||||
import { User } from './interfaces';
|
import { User } from './interfaces';
|
||||||
import WebRTCVoice from './webRTC/';
|
import WebRTCVoice from './webRTC/';
|
||||||
import promptAction from '@ohos.promptAction';
|
import promptAction from '@ohos.promptAction';
|
||||||
|
import { getSyncData } from '../common/service/initable';
|
||||||
import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData';
|
import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData';
|
||||||
|
import BoardPrePareSetPopup from './compontents/judge/BoardPrePareSetPopup'
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
struct UserInfo {
|
struct UserInfo {
|
||||||
@ -34,6 +35,10 @@ struct UserInfo {
|
|||||||
@State url: string = ''
|
@State url: string = ''
|
||||||
@State lsh: string = ''
|
@State lsh: string = ''
|
||||||
@State qkFlag: boolean = false
|
@State qkFlag: boolean = false
|
||||||
|
@State isBoardPrePareSetPopupOpen: boolean = false
|
||||||
|
@State isFirstBoardPrePareSetPopupBtnShow: boolean = false
|
||||||
|
@State isBoardPrePareSetPopupShow: boolean = false
|
||||||
|
@State sczbkf:{xmdm:number,kfdm:string}[] = []
|
||||||
@State currentUser: User = EmptyCandidateObject
|
@State currentUser: User = EmptyCandidateObject
|
||||||
@State dataList: Array<User> = []
|
@State dataList: Array<User> = []
|
||||||
@State list: Array<User> = []
|
@State list: Array<User> = []
|
||||||
@ -194,7 +199,9 @@ struct UserInfo {
|
|||||||
this.qkFn()
|
this.qkFn()
|
||||||
}
|
}
|
||||||
|
|
||||||
initData() {
|
async initData() {
|
||||||
|
this.sczbkf = []
|
||||||
|
this.isFirstBoardPrePareSetPopupBtnShow = false;
|
||||||
this.stepFlag = false
|
this.stepFlag = false
|
||||||
this.faceCompareSucess = 0
|
this.faceCompareSucess = 0
|
||||||
this.showFaceCompare = false
|
this.showFaceCompare = false
|
||||||
@ -216,6 +223,15 @@ struct UserInfo {
|
|||||||
} else {
|
} else {
|
||||||
// this.getExaminationStudentInfoFn()
|
// this.getExaminationStudentInfoFn()
|
||||||
}
|
}
|
||||||
|
const syssetParams = await getSyncData('MA_SYSSET');
|
||||||
|
//@ts-ignore
|
||||||
|
syssetParams.forEach(sys => {
|
||||||
|
//364 绕车一周评判时机(1-开始考试后判 2-开始考试前判)
|
||||||
|
if(sys.v_no === '364'){
|
||||||
|
this.isBoardPrePareSetPopupOpen = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async heartMsg() {
|
async heartMsg() {
|
||||||
@ -531,6 +547,7 @@ struct UserInfo {
|
|||||||
|
|
||||||
build() {
|
build() {
|
||||||
Column() {
|
Column() {
|
||||||
|
|
||||||
TopLogo({ outFlag: $outFlag }).margin({ bottom: 10 })
|
TopLogo({ outFlag: $outFlag }).margin({ bottom: 10 })
|
||||||
Row() {
|
Row() {
|
||||||
Row() {
|
Row() {
|
||||||
@ -627,6 +644,14 @@ struct UserInfo {
|
|||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
this.qkFlag = true
|
this.qkFlag = true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if( this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow){
|
||||||
|
//上车准备
|
||||||
|
Image($r('app.media.sczb_btn')).commStyle().onClick(()=>{
|
||||||
|
this.isBoardPrePareSetPopupShow = true;
|
||||||
|
this.isFirstBoardPrePareSetPopupBtnShow = true;
|
||||||
|
})
|
||||||
|
}else{
|
||||||
Image($r('app.media.ksks_btn'))
|
Image($r('app.media.ksks_btn'))
|
||||||
.commStyle()
|
.commStyle()
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
@ -652,6 +677,10 @@ struct UserInfo {
|
|||||||
this.AccountTable.query('0', (result) => {
|
this.AccountTable.query('0', (result) => {
|
||||||
router.pushUrl({
|
router.pushUrl({
|
||||||
url: examSubject == 3 ? 'pages/Roads':'pages/Judge',
|
url: examSubject == 3 ? 'pages/Roads':'pages/Judge',
|
||||||
|
params:{
|
||||||
|
sczb:Number(this.isBoardPrePareSetPopupOpen),
|
||||||
|
kfdm:this.sczbkf
|
||||||
|
}
|
||||||
}, router.RouterMode.Single);
|
}, router.RouterMode.Single);
|
||||||
this.stopDeviceById()
|
this.stopDeviceById()
|
||||||
})
|
})
|
||||||
@ -661,6 +690,10 @@ struct UserInfo {
|
|||||||
this.AccountTable.query('0', (result) => {
|
this.AccountTable.query('0', (result) => {
|
||||||
router.pushUrl({
|
router.pushUrl({
|
||||||
url: examSubject == 3?'pages/Roads':'pages/Judge',
|
url: examSubject == 3?'pages/Roads':'pages/Judge',
|
||||||
|
params:{
|
||||||
|
sczb:Number(this.isBoardPrePareSetPopupOpen),
|
||||||
|
kfdm:this.sczbkf
|
||||||
|
}
|
||||||
}, router.RouterMode.Single);
|
}, router.RouterMode.Single);
|
||||||
this.stopDeviceById()
|
this.stopDeviceById()
|
||||||
})
|
})
|
||||||
@ -676,6 +709,8 @@ struct UserInfo {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.showFaceCompare) {
|
if (this.showFaceCompare) {
|
||||||
@ -719,6 +754,19 @@ struct UserInfo {
|
|||||||
.backgroundColor('#E6E3DF')
|
.backgroundColor('#E6E3DF')
|
||||||
.borderRadius(19 * this.ratio)
|
.borderRadius(19 * this.ratio)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 上车准备
|
||||||
|
if(this.isBoardPrePareSetPopupShow){
|
||||||
|
BoardPrePareSetPopup({
|
||||||
|
closePopup:()=>{
|
||||||
|
this.isBoardPrePareSetPopupShow = false
|
||||||
|
},
|
||||||
|
confirmMark:(kfdm)=>{
|
||||||
|
this.sczbkf= kfdm
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.height('100%')
|
.height('100%')
|
||||||
.width('100%')
|
.width('100%')
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import router from '@ohos.router';
|
import router from '@ohos.router';
|
||||||
import UdpClient from '../../common/utils/UdpClient';
|
import UdpClient from '../../common/utils/UdpClient';
|
||||||
import FileLog from '../judgeSDK/utils/file-log';
|
import FileLog from '../judgeSDK/utils/fileLog';
|
||||||
import RealTime from '../compontents/judge/RealTime';
|
import RealTime from '../compontents/judge/RealTime';
|
||||||
import { GPSData, SignalData } from '../../mock';
|
import { GPSData, SignalData } from '../../mock';
|
||||||
import { SignalDataType } from '../../model';
|
import { SignalDataType } from '../../model';
|
||||||
|
|||||||
@ -0,0 +1,349 @@
|
|||||||
|
import { getSyncData } from '../../../common/service/initable';
|
||||||
|
import { judgeConfig } from '../../judgeSDK/utils/judgeConfig';
|
||||||
|
import FileUtil from '../../../common/utils/File';
|
||||||
|
import common from '@ohos.app.ability.common';
|
||||||
|
import VoiceAnnounce from '../../judgeSDK/utils/voiceAnnouncements';
|
||||||
|
|
||||||
|
import {
|
||||||
|
MarkRule,
|
||||||
|
SYSSET,
|
||||||
|
} from '../../judgeSDK/api/judgeSDK.d';
|
||||||
|
|
||||||
|
interface SEL {
|
||||||
|
fontColor: string
|
||||||
|
bgColor: string
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
export default struct DeductedPopup {
|
||||||
|
private context = getContext(this) as common.UIAbilityContext;
|
||||||
|
private avPlayer
|
||||||
|
@State name: string = ''
|
||||||
|
@State idCard: string = ''
|
||||||
|
@State lsh: string = ''
|
||||||
|
@State kszp: string = ''
|
||||||
|
@State ksdd: string = ''
|
||||||
|
@State kssycs: string = ''
|
||||||
|
@State kslx: string = ''
|
||||||
|
@State kfdmArr: {
|
||||||
|
xmdm: number,
|
||||||
|
kfdm: string,
|
||||||
|
markreal: number
|
||||||
|
}[] = []
|
||||||
|
//开始考试前判绕车一周评判是否开启
|
||||||
|
@State isOpen: boolean = false
|
||||||
|
//监管序列号
|
||||||
|
@State serialNumber: number = 0;
|
||||||
|
@State examSubject: number = 2;
|
||||||
|
@State markRuleListObj: MarkRule = {}
|
||||||
|
@State fontSize: number = 25
|
||||||
|
@State unselected: SEL = { fontColor: '#000000', bgColor: '#CCC4B8' }
|
||||||
|
@State selected: SEL = { fontColor: '#FFAD33', bgColor: '#26231E' }
|
||||||
|
@State currentIndex: number = 0
|
||||||
|
@State currentPageIndex: number = 0
|
||||||
|
//通用评判扣分
|
||||||
|
@State currentUniversalPageIndex: number = 0;
|
||||||
|
@State universalMarkRules: MarkRule[] = []
|
||||||
|
@State manualMarkRules: MarkRule[] = []
|
||||||
|
@State lineBg: Array<string> = ['#4D4136', '#26231E']
|
||||||
|
@State selectedLine: number = undefined
|
||||||
|
private closePopup: Function = () => {
|
||||||
|
}
|
||||||
|
private confirmMark: Function = (itemno: number, serial: string) => {
|
||||||
|
}
|
||||||
|
@State selectedLineStyle: SEL = {
|
||||||
|
fontColor: '#FFF',
|
||||||
|
bgColor: '#B36E00'
|
||||||
|
}
|
||||||
|
|
||||||
|
aboutToAppear() {
|
||||||
|
//上车准备
|
||||||
|
// this.universalMarkRules = this.markRules.filter(item => this.currentItems.includes(item.itemno+''))
|
||||||
|
const {isTrajectoryOpen} = judgeConfig;
|
||||||
|
if (isTrajectoryOpen) {
|
||||||
|
this.initDb()
|
||||||
|
} else {
|
||||||
|
this.initSysset()
|
||||||
|
this.initMarkRules()
|
||||||
|
}
|
||||||
|
this.avPlayer = new VoiceAnnounce();
|
||||||
|
}
|
||||||
|
|
||||||
|
//本地数据初始化
|
||||||
|
async initDb() {
|
||||||
|
const {isTrajectoryOpen,trajectoryPath} = judgeConfig
|
||||||
|
const examSubject = globalThis.carInfo.examSubject;
|
||||||
|
//轨迹回放读取 systemparam表、markrule表
|
||||||
|
const fileUtil = new FileUtil(this.context);
|
||||||
|
const folderPath = await fileUtil.initFolder(trajectoryPath);
|
||||||
|
const str = await fileUtil.readFile(folderPath);
|
||||||
|
const strArr = str.split('\n');
|
||||||
|
const [initData, beginData] = [strArr[0], strArr[1]];
|
||||||
|
const initDataObj = JSON.parse(initData);
|
||||||
|
this.examSubject = isTrajectoryOpen ? (initDataObj.kskm * 1) : examSubject;
|
||||||
|
await this.initMarkRules(initDataObj.mark);
|
||||||
|
await this.initSysset(initDataObj.sysset);
|
||||||
|
await this.initStudent()
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取sysset表数据
|
||||||
|
async initSysset(sysset?: SYSSET[]) {
|
||||||
|
const syssetParams = sysset || await getSyncData('MA_SYSSET');
|
||||||
|
//@ts-ignore
|
||||||
|
syssetParams.forEach(sys => {
|
||||||
|
//监管序列号
|
||||||
|
if (sys.v_no === '901') {
|
||||||
|
this.serialNumber = sys.v_value || '123456'
|
||||||
|
}
|
||||||
|
|
||||||
|
//364 绕车一周评判时机(1-开始考试后判 2-开始考试前判)
|
||||||
|
if (sys.v_no === '364') {
|
||||||
|
const isOpen = sys.v_value == 2
|
||||||
|
if (isOpen) {
|
||||||
|
this.avPlayer.playAudio(['voice/上车准备.mp3'])
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取markrule表数据
|
||||||
|
async initMarkRules(markRules ?: MarkRule[]) {
|
||||||
|
const markRuleParams = markRules || (await getSyncData('MA_MARKRULE') as MarkRule[])
|
||||||
|
|
||||||
|
markRuleParams.forEach(mark => {
|
||||||
|
const tempObj = {
|
||||||
|
itemno: mark.itemno * 1,
|
||||||
|
markcatalog: mark.markcatalog,
|
||||||
|
markshow: decodeURI(mark.markshow),
|
||||||
|
markreal: mark.markreal * 1,
|
||||||
|
markstandard: mark.markstandard * 1,
|
||||||
|
markserial: mark.markserial,
|
||||||
|
kfxh: mark.kfxh,
|
||||||
|
OnlyOneKind: mark.onlyoneid * 1,
|
||||||
|
NoCancelId: mark.nocancelid * 1,
|
||||||
|
GPS_SID: mark.gps_sid == 0 ? false : true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mark.itemno == 1) {
|
||||||
|
this.markRuleListObj[`${mark.itemno}_${mark.markserial}`] = {
|
||||||
|
...tempObj,
|
||||||
|
markserial: mark.markserial,
|
||||||
|
};
|
||||||
|
this.universalMarkRules.push(tempObj)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取考生信息
|
||||||
|
async initStudent() {
|
||||||
|
const students = await getSyncData('USER')
|
||||||
|
const stuInfo = students[0] || {};
|
||||||
|
const {xm,sfzmhm,lsh,kszp,ksdd,kssycs,kslx} = stuInfo;
|
||||||
|
this.name = xm || '测试考生';
|
||||||
|
this.idCard = sfzmhm || '01234567891010';
|
||||||
|
this.lsh = lsh;
|
||||||
|
this.kszp = kszp;
|
||||||
|
this.ksdd = ksdd;
|
||||||
|
this.kssycs = kssycs;
|
||||||
|
this.kslx = kslx;
|
||||||
|
}
|
||||||
|
|
||||||
|
//上一页 下一页
|
||||||
|
goPage(typeIndex) {
|
||||||
|
const currentIndex = this.currentIndex
|
||||||
|
if (currentIndex) {
|
||||||
|
//通用评判
|
||||||
|
typeIndex ? (this.currentUniversalPageIndex += 1) : (this.currentUniversalPageIndex -= 1)
|
||||||
|
} else {
|
||||||
|
typeIndex ? (this.currentPageIndex += 1) : (this.currentPageIndex -= 1)
|
||||||
|
}
|
||||||
|
this.selectedLine = -1
|
||||||
|
}
|
||||||
|
|
||||||
|
//选中扣分项
|
||||||
|
getSelectedLine(index) {
|
||||||
|
const {selectedLine,selectedLineStyle,lineBg} = this;
|
||||||
|
if (selectedLine === index) {
|
||||||
|
return selectedLineStyle.bgColor
|
||||||
|
}
|
||||||
|
if (index % 2 === 0) {
|
||||||
|
return lineBg[0]
|
||||||
|
} else {
|
||||||
|
return lineBg[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取当前页的数据
|
||||||
|
getCurrentMarkRuleList() {
|
||||||
|
const {currentIndex,currentUniversalPageIndex,currentPageIndex,universalMarkRules} = this;
|
||||||
|
if (currentIndex) {
|
||||||
|
//通用评判
|
||||||
|
return universalMarkRules.slice(currentUniversalPageIndex * 7, (currentUniversalPageIndex + 1) * 7)
|
||||||
|
} else {
|
||||||
|
return universalMarkRules.slice(currentPageIndex * 7, (currentPageIndex + 1) * 7)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
Column() {
|
||||||
|
Column() {
|
||||||
|
Column() {
|
||||||
|
Row() {
|
||||||
|
Row() {
|
||||||
|
ForEach(['人工评判'], (text, index) => {
|
||||||
|
|
||||||
|
Row() {
|
||||||
|
Text(text)
|
||||||
|
.fontColor(index === this.currentIndex ? this.selected.fontColor : this.unselected.fontColor)
|
||||||
|
.fontSize(this.fontSize)
|
||||||
|
.fontWeight(500)
|
||||||
|
}
|
||||||
|
.width(180)
|
||||||
|
.height(70)
|
||||||
|
.backgroundColor(index === this.currentIndex ? this.selected.bgColor : this.unselected.bgColor)
|
||||||
|
.justifyContent(FlexAlign.Center)
|
||||||
|
.justifyContent(FlexAlign.Center)
|
||||||
|
.borderRadius({ topLeft: 20, topRight: 20 })
|
||||||
|
.margin({ right: 10 })
|
||||||
|
.onClick(() => {
|
||||||
|
this.currentIndex = index;
|
||||||
|
this.selectedLine = -1;
|
||||||
|
// if(index === 1) {
|
||||||
|
// this.universalMarkRules = this.markRules.filter(item => item.itemno == 20 )
|
||||||
|
// }else{
|
||||||
|
// this.universalMarkRules = this.markRules.filter(item => this.currentItems.includes(item.itemno+''))
|
||||||
|
// }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Row() {
|
||||||
|
if (
|
||||||
|
(Math.ceil(this.universalMarkRules.length / 7 - 1)) >= (this.currentIndex ? this.currentUniversalPageIndex : this.currentPageIndex) &&
|
||||||
|
(this.currentIndex ? this.currentUniversalPageIndex : this.currentPageIndex) > 0
|
||||||
|
) {
|
||||||
|
Row() {
|
||||||
|
Row() {
|
||||||
|
}.width(36).height(36).backgroundImage($rawfile(`judge/km3/zuo_nor.png`)).margin({ left: 24, top: 4 })
|
||||||
|
|
||||||
|
Text('上一页') {
|
||||||
|
}.fontColor('#FFF').fontSize(this.fontSize)
|
||||||
|
}
|
||||||
|
.width(160)
|
||||||
|
.height(80)
|
||||||
|
.justifyContent(FlexAlign.Start)
|
||||||
|
.alignItems(VerticalAlign.Center)
|
||||||
|
.backgroundImage($rawfile(`judge/km3/button_nor.png`))
|
||||||
|
.backgroundImageSize({ width: '100%', height: '100%' })
|
||||||
|
.onClick(() => {
|
||||||
|
this.goPage(0)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
(Math.ceil(this.universalMarkRules.length / 7 - 1)) > (this.currentIndex ? this.currentUniversalPageIndex : this.currentPageIndex)
|
||||||
|
) {
|
||||||
|
Row() {
|
||||||
|
Text('下一页') {
|
||||||
|
}.fontColor('#FFF').fontSize(this.fontSize).padding({ left: 30 })
|
||||||
|
|
||||||
|
Row() {
|
||||||
|
}.width(36).height(36).backgroundImage($rawfile(`judge/km3/you_nor.png`)).margin({ left: 4, top: 4 })
|
||||||
|
}
|
||||||
|
.width(160)
|
||||||
|
.height(80)
|
||||||
|
.justifyContent(FlexAlign.Start)
|
||||||
|
.alignItems(VerticalAlign.Center)
|
||||||
|
.backgroundImage($rawfile(`judge/km3/button_nor.png`))
|
||||||
|
.backgroundImageSize({ width: '100%', height: '100%' })
|
||||||
|
.onClick(() => {
|
||||||
|
this.goPage(1)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Row() {
|
||||||
|
Text('扣 分') {
|
||||||
|
}.fontColor('#FFF').fontSize(this.fontSize).padding({ left: 49 })
|
||||||
|
}
|
||||||
|
.width(160)
|
||||||
|
.height(80)
|
||||||
|
.justifyContent(FlexAlign.Start)
|
||||||
|
.alignItems(VerticalAlign.Center)
|
||||||
|
.backgroundImage($rawfile(`judge/km3/button_nor.png`))
|
||||||
|
.backgroundImageSize({ width: '100%', height: '100%' })
|
||||||
|
.onClick(() => {
|
||||||
|
const index = this.currentIndex ? this.currentUniversalPageIndex : this.currentPageIndex;
|
||||||
|
const mark = this.universalMarkRules[index * 7 + this.selectedLine];
|
||||||
|
const {avPlayer,kssycs} = this;
|
||||||
|
this.kfdmArr.push({ xmdm: 1, kfdm: mark.markserial, markreal: mark.markreal })
|
||||||
|
|
||||||
|
//计算总扣分
|
||||||
|
let score = this.kfdmArr.reduce((p, n) => {
|
||||||
|
p += n.markreal
|
||||||
|
return p
|
||||||
|
}, 0);
|
||||||
|
avPlayer.playAudio([`voice/${mark.markcatalog}.mp3`]);
|
||||||
|
console.info('surenjun',score)
|
||||||
|
if(!globalThis.singlePlay){
|
||||||
|
if (score < -90) {
|
||||||
|
avPlayer.playAudio([
|
||||||
|
'voice/exam_waiting.mp3',
|
||||||
|
kssycs == '1' ? 'voice/unqualified_one.wav' : 'voice/unqualified_two.wav'
|
||||||
|
]);
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
this.confirmMark(this.kfdmArr.map((kf) => ({
|
||||||
|
xmdm:kf.xmdm,
|
||||||
|
kfdm:kf.kfdm,
|
||||||
|
})))
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
|
||||||
|
|
||||||
|
Column() {
|
||||||
|
ForEach(this.getCurrentMarkRuleList(), (item, index) => {
|
||||||
|
Row() {
|
||||||
|
Text(`${item.markshow} (${item.markcatalog})`).fontColor('#FFF').fontSize(this.fontSize).fontWeight(500)
|
||||||
|
Row() {
|
||||||
|
Text(item.markreal + '').fontColor('#FFF').fontSize(this.fontSize).fontWeight(500)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.width('100%')
|
||||||
|
.height(75)
|
||||||
|
.justifyContent(FlexAlign.SpaceBetween)
|
||||||
|
.alignItems(VerticalAlign.Center)
|
||||||
|
.padding({ left: 20, right: 20 })
|
||||||
|
.backgroundColor(this.getSelectedLine(index))
|
||||||
|
.onClick(() => {
|
||||||
|
this.selectedLine = index
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.width(1300)
|
||||||
|
.height(710)
|
||||||
|
.position({ x: '15%', y: '10%' })
|
||||||
|
.backgroundColor('#E6E3DF')
|
||||||
|
.padding({ top: 15, bottom: 15, left: 25, right: 25 })
|
||||||
|
.borderRadius(20)
|
||||||
|
|
||||||
|
Row() {
|
||||||
|
}
|
||||||
|
.width(100)
|
||||||
|
.height(100)
|
||||||
|
.position({ y: '85%', x: '50%' })
|
||||||
|
.backgroundImage($rawfile('judge/km3/close_nor.png'))
|
||||||
|
.backgroundImageSize({ width: '100%', height: '100%' })
|
||||||
|
.onClick(() => {
|
||||||
|
this.closePopup()
|
||||||
|
})
|
||||||
|
}.width('100%').height('100%').position({ y: 0 }).backgroundColor('rgba(0,0,0,0.7)')
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import apiJudgeSdk from 'libJudgeSdk.so';
|
import apiJudgeSdk from 'libJudgeSdk.so';
|
||||||
import Judge from '../../judgeSDK/utils/judge-real';
|
import Judge from '../../judgeSDK/utils/judgeReal';
|
||||||
import { MarkRule, Project, ProjectObj } from '../../judgeSDK/api/judgeSDK.d';
|
import { MarkRule, Project, ProjectObj } from '../../judgeSDK/api/judgeSDK.d';
|
||||||
import common from '@ohos.app.ability.common';
|
import common from '@ohos.app.ability.common';
|
||||||
|
|
||||||
|
|||||||
@ -170,6 +170,26 @@ export async function examJudgeSetPerformCallback(fn){
|
|||||||
const temp = libJudgeSdk.examJudgeSetPerformCallback(fn);
|
const temp = libJudgeSdk.examJudgeSetPerformCallback(fn);
|
||||||
return await handle(temp,'examJudgeSetPerformCallback')
|
return await handle(temp,'examJudgeSetPerformCallback')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @desc 语音播报结束
|
||||||
|
* /
|
||||||
|
*/
|
||||||
|
|
||||||
|
export async function examJudgeSoundEnd(param:{
|
||||||
|
//项目代码
|
||||||
|
itemno:number,
|
||||||
|
//语音码
|
||||||
|
code:string,
|
||||||
|
//语音类型
|
||||||
|
type:number,
|
||||||
|
}){
|
||||||
|
const {itemno,code,type} = param;
|
||||||
|
const temp = libJudgeSdk.examJudgeSoundEnd(itemno,code,type);
|
||||||
|
return await handle(temp,'examJudgeSoundEnd')
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @desc通用处理函数
|
* @desc通用处理函数
|
||||||
*
|
*
|
||||||
|
|||||||
@ -16,7 +16,8 @@ export interface MarkRule{
|
|||||||
itemno?:number
|
itemno?:number
|
||||||
markcatalog?:string
|
markcatalog?:string
|
||||||
markshow?:string
|
markshow?:string
|
||||||
markserial?:number
|
markserial?:string
|
||||||
|
markstandard?:number,
|
||||||
markreal?:number
|
markreal?:number
|
||||||
kfxh?:string
|
kfxh?:string
|
||||||
onlyoneid?:number
|
onlyoneid?:number
|
||||||
@ -118,7 +119,8 @@ export interface EXAMDATA{
|
|||||||
sound:{
|
sound:{
|
||||||
xmdm:number,
|
xmdm:number,
|
||||||
//语音播放文件代码
|
//语音播放文件代码
|
||||||
code:string
|
code:string,
|
||||||
|
type:number
|
||||||
},
|
},
|
||||||
//模拟灯光
|
//模拟灯光
|
||||||
mndg:string
|
mndg:string
|
||||||
@ -138,7 +140,9 @@ export interface SOUND {
|
|||||||
//项目代码
|
//项目代码
|
||||||
xmdm:number
|
xmdm:number
|
||||||
//语音播放提示代码
|
//语音播放提示代码
|
||||||
code:string
|
code:string,
|
||||||
|
//0:普通,1:模拟灯光
|
||||||
|
type:number
|
||||||
}
|
}
|
||||||
export interface SYSSET {
|
export interface SYSSET {
|
||||||
v_no:string,
|
v_no:string,
|
||||||
@ -147,7 +151,7 @@ export interface SYSSET {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface ProjectObj {
|
export interface ProjectObj {
|
||||||
[k:any]:Project
|
[k:string]:Project
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,15 +6,14 @@ import buffer from '@ohos.buffer';
|
|||||||
import { testKmItems, testMarkRules } from './dataTest/index';
|
import { testKmItems, testMarkRules } from './dataTest/index';
|
||||||
import { EXAMDATA, SOUND } from './api/judgeSDK';
|
import { EXAMDATA, SOUND } from './api/judgeSDK';
|
||||||
|
|
||||||
import VoiceAnnounce from './utils/voice-announcements';
|
import VoiceAnnounce from './utils/voiceAnnouncements';
|
||||||
import FileModel from './utils/file-model';
|
import FileModel from './utils/fileModel';
|
||||||
import FilePhoto from './utils/file-photo';
|
import FilePhoto from './utils/filePhoto';
|
||||||
import FileUtil from '../../common/utils/File';
|
import FileUtil from '../../common/utils/File';
|
||||||
import FileLog from '../judgeSDK/utils/file-log';
|
import FileLog from './utils/fileLog';
|
||||||
|
|
||||||
import JudgeTask from './utils/judge-task';
|
import JudgeTask from './utils/judgeTask';
|
||||||
import SimulateLights from './utils/simulate-lights';
|
import { judgeConfig } from './utils/judgeConfig';
|
||||||
import { judgeConfig } from './utils/judge-config';
|
|
||||||
|
|
||||||
import { uploadExamProgressData, writeObjectOut } from '../../api/judge';
|
import { uploadExamProgressData, writeObjectOut } from '../../api/judge';
|
||||||
import {
|
import {
|
||||||
@ -36,35 +35,33 @@ import {
|
|||||||
plcStrToWXJson,
|
plcStrToWXJson,
|
||||||
promptWxCode,
|
promptWxCode,
|
||||||
senorToWXDataStr
|
senorToWXDataStr
|
||||||
} from './utils/judge-common';
|
} from './utils/judgeCommon';
|
||||||
import {
|
import {
|
||||||
examJudgeArtificialItem,
|
examJudgeArtificialItem,
|
||||||
examJudgeArtificialMark,
|
examJudgeArtificialMark,
|
||||||
examJudgeBeginExam,
|
examJudgeBeginExam,
|
||||||
examJudgeEndExam,
|
examJudgeEndExam,
|
||||||
examJudgeInit,
|
examJudgeInit,
|
||||||
examJudgeMapSetParam,
|
examJudgeSoundEnd,
|
||||||
examJudgeMapSetScaling,
|
|
||||||
examJudgeRealExam,
|
examJudgeRealExam,
|
||||||
examJudgeSetLogCallback,
|
examJudgeSetLogCallback,
|
||||||
examJudgeSetPerformCallback,
|
examJudgeSetPerformCallback,
|
||||||
examJudgeSetRealExamCallback
|
examJudgeSetRealExamCallback
|
||||||
} from './api/index';
|
} from './api/index';
|
||||||
import UsbService from '../../common/service/usbService';
|
import UsbService from '../../common/service/usbService';
|
||||||
|
|
||||||
import Prompt from '@system.prompt';
|
import Prompt from '@system.prompt';
|
||||||
|
|
||||||
const judgeTag = 'SURENJUN_JUDGE'
|
const judgeTag = 'SURENJUN_JUDGE'
|
||||||
|
|
||||||
export default class Judge {
|
export default class Judge {
|
||||||
|
|
||||||
|
|
||||||
constructor(judgeUI) {
|
constructor(judgeUI) {
|
||||||
this.serialIndex = 1;
|
this.serialIndex = 1;
|
||||||
this.judgeUI = judgeUI
|
this.judgeUI = judgeUI
|
||||||
|
|
||||||
//语音播放工具
|
//语音播放工具
|
||||||
this.avPlayer = new VoiceAnnounce();
|
this.avPlayer = new VoiceAnnounce();
|
||||||
new SimulateLights(this.avPlayer)
|
|
||||||
//模型工具
|
//模型工具
|
||||||
this.fileModel = new FileModel(judgeUI.context);
|
this.fileModel = new FileModel(judgeUI.context);
|
||||||
//文件工具
|
//文件工具
|
||||||
@ -133,7 +130,7 @@ export default class Judge {
|
|||||||
console.info(judgeTag, '2.注册日志回调完成')
|
console.info(judgeTag, '2.注册日志回调完成')
|
||||||
|
|
||||||
let initInfo = isTrajectoryOpen ? JSON.parse(strArr[0]) : await this.getJudgeInitData();
|
let initInfo = isTrajectoryOpen ? JSON.parse(strArr[0]) : await this.getJudgeInitData();
|
||||||
console.log('SURENJUN_JUDGE',isJudgeInitBool,isTrajectoryOpen,JSON.stringify(initInfo))
|
|
||||||
//相关评判初始化只做一次
|
//相关评判初始化只做一次
|
||||||
if (!isJudgeInitBool) {
|
if (!isJudgeInitBool) {
|
||||||
await fileLog.setExamJudgeData(initInfo)
|
await fileLog.setExamJudgeData(initInfo)
|
||||||
@ -141,6 +138,7 @@ export default class Judge {
|
|||||||
globalThis.isJudgeInitBool = true
|
globalThis.isJudgeInitBool = true
|
||||||
console.info(judgeTag, '4.评判初始化完成')
|
console.info(judgeTag, '4.评判初始化完成')
|
||||||
} else {
|
} else {
|
||||||
|
await fileLog.setExamJudgeData(initInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
globalThis.isJudge = true
|
globalThis.isJudge = true
|
||||||
@ -157,35 +155,140 @@ export default class Judge {
|
|||||||
this.performInfo = performInfo
|
this.performInfo = performInfo
|
||||||
this.judgeUI.jl = Math.ceil((performInfo.qjjl + performInfo.dcjl) / 100)
|
this.judgeUI.jl = Math.ceil((performInfo.qjjl + performInfo.dcjl) / 100)
|
||||||
})
|
})
|
||||||
|
|
||||||
// 3.开始考试
|
// 3.开始考试
|
||||||
let beginExamInfo = isTrajectoryOpen ? {
|
let beginExamInfo = isTrajectoryOpen ? {
|
||||||
...JSON.parse(strArr[1]),
|
...JSON.parse(strArr[1]),
|
||||||
replay: 1
|
replay: 1
|
||||||
} : await getJudgeBeginData()
|
} : await getJudgeBeginData()
|
||||||
console.log(judgeTag,'22222',JSON.stringify(beginExamInfo),strArr[1])
|
|
||||||
await fileLog.setExamJudgeData(beginExamInfo)
|
|
||||||
console.log(judgeTag,'333333')
|
|
||||||
await examJudgeBeginExam(beginExamInfo);
|
|
||||||
console.log(judgeTag,'4444444')
|
|
||||||
|
|
||||||
|
await fileLog.setExamJudgeData(beginExamInfo)
|
||||||
|
await examJudgeBeginExam(beginExamInfo);
|
||||||
console.info(judgeTag, '6.开始考试注册完成')
|
console.info(judgeTag, '6.开始考试注册完成')
|
||||||
|
|
||||||
avPlayer.playAudio(['voice/ksks.WAV'])
|
avPlayer.playAudio(['voice/ksks.WAV'])
|
||||||
|
|
||||||
|
this.judgeUI.draw = true
|
||||||
|
|
||||||
// 处理轨迹plc信息
|
// 处理轨迹plc信息
|
||||||
if (isTrajectoryOpen) {
|
if (isTrajectoryOpen) {
|
||||||
handleTrajectoryUdp(strArr);
|
handleTrajectoryUdp(strArr);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 处理实时udp里的plc信号
|
// 处理实时udp里的plc信号
|
||||||
globalThis.udpClient.onMessage(async (msg) => {
|
globalThis.udpClient.onMessage(async (msg) => {
|
||||||
handleUdp(msg)
|
handleUdp(msg)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// 获取评判初始化数据
|
||||||
|
getJudgeInitData = async () => {
|
||||||
|
const {getModelData,getKm3JudgeInitConfig} = this
|
||||||
|
const carInfo = globalThis.carInfo;
|
||||||
|
const { examSubject,plateNo,carId } = carInfo;
|
||||||
|
const {fileLog} = this
|
||||||
|
const judgeUI = this.judgeUI
|
||||||
|
const {projectsObj,cdsbInfoObj,markRuleListObj,carType,carName} = judgeUI
|
||||||
|
|
||||||
|
const examType = examSubject == 2 ? 'km2' : 'km3'
|
||||||
|
|
||||||
|
let allitems = [];
|
||||||
|
|
||||||
|
if (examSubject == 2) {
|
||||||
|
allitems = Reflect.ownKeys(cdsbInfoObj).map(cdsbKey => {
|
||||||
|
const cdsb = cdsbInfoObj[cdsbKey];
|
||||||
|
const {xmdm,xmxh,modelKey} = cdsb
|
||||||
|
return {
|
||||||
|
xmdm, xmxh, model: getModelData(`${examType}/${modelKey}.txt`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const initInfo = {
|
||||||
|
kskm: examSubject * 1,
|
||||||
|
kchp: plateNo,
|
||||||
|
kchm: carId * 1,
|
||||||
|
kscx: carType,
|
||||||
|
cxcode: '1',
|
||||||
|
name: carName,
|
||||||
|
carmodel: getModelData(`${examType}/${carType}.txt`),
|
||||||
|
allitems,
|
||||||
|
mark: Reflect.ownKeys(markRuleListObj).map(ruleKey => (markRuleListObj[ruleKey])) || testMarkRules,
|
||||||
|
sysset: judgeUI.judgeConfig,
|
||||||
|
};
|
||||||
|
|
||||||
|
let km3Config = {}
|
||||||
|
|
||||||
|
if (examSubject) {
|
||||||
|
km3Config = await getKm3JudgeInitConfig();
|
||||||
|
}
|
||||||
|
// 获取科目三的评判配置
|
||||||
|
console.info(judgeTag, '3.获取评判初始化数据完成')
|
||||||
|
return {
|
||||||
|
...initInfo,
|
||||||
|
...km3Config,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获取开始考试数据
|
||||||
|
getJudgeBeginData = async () => {
|
||||||
|
const {code,name:examinerName} = globalThis.examinerInfo;
|
||||||
|
let currentParams: any = router.getParams();
|
||||||
|
const {sczb,kfdm} = currentParams;
|
||||||
|
const {isExam} = this;
|
||||||
|
const judgeUI = this.judgeUI
|
||||||
|
const {projects,carType,isDdxk,ddxkTime,projectsCenterObj,ddxkKsxmArr,ddxkKfArr} = judgeUI;
|
||||||
|
const beginInfo = {
|
||||||
|
kgid: '012',
|
||||||
|
kgxm: decodeURI(examinerName || ''),
|
||||||
|
exam: isExam ? 1 : 0,
|
||||||
|
//是否回放
|
||||||
|
replay: 0,
|
||||||
|
//生成的轨迹文件
|
||||||
|
track: '',
|
||||||
|
xm: judgeUI.name,
|
||||||
|
sex: 0,
|
||||||
|
kslsh: judgeUI.lsh,
|
||||||
|
sfzmhm: judgeUI.idCard,
|
||||||
|
ksyy: '',
|
||||||
|
kscx: carType,
|
||||||
|
kkcs: 1,
|
||||||
|
sfyk: 0,
|
||||||
|
ykkkcs: 1,
|
||||||
|
wayno: judgeUI.wayno * 1,
|
||||||
|
czlx: 0,
|
||||||
|
kskssj: await systemTime.getCurrentTime(),
|
||||||
|
ksxm: projects.map(project => {
|
||||||
|
return {
|
||||||
|
xmdm: project.projectCode * 1,
|
||||||
|
xmxh: '',
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
//断点续考
|
||||||
|
ddxk: isDdxk ? 1 : 0,
|
||||||
|
ddkssj: ddxkTime,
|
||||||
|
ykxm: isDdxk ? (ddxkKsxmArr?.map(projectCenterCode => (projectsCenterObj[projectCenterCode]?.projectCode) * 1)) : [],
|
||||||
|
kfxm: isDdxk ? (ddxkKfArr?.map(kf => {
|
||||||
|
const [xmdm, kfdm] = kf.split(',')
|
||||||
|
return {
|
||||||
|
xmdm: xmdm * 1,
|
||||||
|
kfdm
|
||||||
|
}
|
||||||
|
})) : [],
|
||||||
|
yklc: 0,
|
||||||
|
special: [],
|
||||||
|
//TODO 科目三参数临时写死
|
||||||
|
sczb: (sczb === undefined || sczb == 0)?0:1,
|
||||||
|
sczbkf:kfdm,
|
||||||
|
dmndg: false,
|
||||||
|
nitem1: false,
|
||||||
|
nitem41: false,
|
||||||
|
mfxx: false,
|
||||||
|
mfxxn: false
|
||||||
|
}
|
||||||
|
console.info(judgeTag, '5.获取开始考试数据完成')
|
||||||
|
return beginInfo
|
||||||
|
}
|
||||||
// 项目开始接口同步
|
// 项目开始接口同步
|
||||||
beginProject = async (ksxm) => {
|
beginProject = async (ksxm) => {
|
||||||
const carInfo = globalThis.carInfo;
|
const carInfo = globalThis.carInfo;
|
||||||
@ -326,28 +429,29 @@ export default class Judge {
|
|||||||
fileLog.setExamJudgeWuxiData(data)
|
fileLog.setExamJudgeWuxiData(data)
|
||||||
console.info(judgeTag, '上传照片 end')
|
console.info(judgeTag, '上传照片 end')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 评判语音提示
|
// 评判语音提示
|
||||||
goJudgeVoice = async (sound: SOUND) => {
|
goJudgeVoice = async (sound: SOUND) => {
|
||||||
const {avPlayer} = this;
|
const {avPlayer,fileLog} = this;
|
||||||
const {xmdm,code} = sound;
|
const {xmdm,code,type} = sound;
|
||||||
//判断是不是模拟灯光语音
|
//判断是不是模拟灯光语音
|
||||||
const isLight = code.slice(0, 3) === '417';
|
console.info(judgeTag,JSON.stringify(sound))
|
||||||
if (isLight) {
|
if(type == 1){
|
||||||
console.info(judgeTag, '模拟灯光开始播放:' + code)
|
console.info(judgeTag, '模拟灯光开始播放:' + code)
|
||||||
}
|
}
|
||||||
avPlayer.playAudio([`voice/${code}.mp3`], true, () => {
|
avPlayer.playAudio([`voice/${code}.mp3`], true, () => {
|
||||||
if (isLight) {
|
if (type == 1) {
|
||||||
console.info(judgeTag, '播放结束:' + code)
|
console.info(judgeTag, '播放结束:' + code)
|
||||||
setTimeout(() => {
|
console.info(judgeTag,JSON.stringify({itemno:xmdm,code,type}))
|
||||||
this.wav = 1;
|
examJudgeSoundEnd({itemno:xmdm,code,type})
|
||||||
|
fileLog.setExamJudgeData({
|
||||||
|
method: 'examJudgeArtificialItem',
|
||||||
|
itemno: xmdm,
|
||||||
|
type
|
||||||
})
|
})
|
||||||
|
this.wav = 0;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理考试结束
|
// 处理考试结束
|
||||||
public handEndExam = async (isManual?: Boolean) => {
|
public handEndExam = async (isManual?: Boolean) => {
|
||||||
const {isExam,judgeUI,endExam,handleSEP,avPlayer} = this;
|
const {isExam,judgeUI,endExam,handleSEP,avPlayer} = this;
|
||||||
@ -380,26 +484,6 @@ export default class Judge {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当前项目转换
|
|
||||||
getDqxmStr = (type) => {
|
|
||||||
const projectsObj = this.judgeUI.projectsObj
|
|
||||||
return projectsObj[type]?.abbreviation || '通用评判'
|
|
||||||
}
|
|
||||||
|
|
||||||
// 扣分项目转换
|
|
||||||
getKfStr = (code) => {
|
|
||||||
const markRuleListObj = this.judgeUI.markRuleListObj;
|
|
||||||
const thisMark = markRuleListObj[code]
|
|
||||||
return {
|
|
||||||
desc: thisMark.markshow,
|
|
||||||
score: thisMark.markreal,
|
|
||||||
markcatalog: thisMark.markcatalog,
|
|
||||||
markserial: thisMark.markserial,
|
|
||||||
kfxh: thisMark.kfxh
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 考试结束
|
// 考试结束
|
||||||
public endExam = async (isManual?: Boolean) => {
|
public endExam = async (isManual?: Boolean) => {
|
||||||
const carInfo = globalThis.carInfo;
|
const carInfo = globalThis.carInfo;
|
||||||
@ -449,55 +533,23 @@ export default class Judge {
|
|||||||
}, 3000)
|
}, 3000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// 当前项目转换
|
||||||
// 获取评判初始化数据
|
getDqxmStr = (type) => {
|
||||||
getJudgeInitData = async () => {
|
const projectsObj = this.judgeUI.projectsObj
|
||||||
const {getModelData,getKm3JudgeInitConfig} = this
|
return projectsObj[type]?.abbreviation || '通用评判'
|
||||||
const carInfo = globalThis.carInfo;
|
}
|
||||||
const { examSubject,plateNo,carId } = carInfo;
|
// 扣分项目转换
|
||||||
const {fileLog} = this
|
getKfStr = (code) => {
|
||||||
const judgeUI = this.judgeUI
|
const markRuleListObj = this.judgeUI.markRuleListObj;
|
||||||
const {projectsObj,cdsbInfoObj,markRuleListObj,carType,carName} = judgeUI
|
const thisMark = markRuleListObj[code]
|
||||||
|
|
||||||
const examType = examSubject == 2 ? 'km2' : 'km3'
|
|
||||||
|
|
||||||
let allitems = [];
|
|
||||||
|
|
||||||
if (examSubject == 2) {
|
|
||||||
allitems = Reflect.ownKeys(cdsbInfoObj).map(cdsbKey => {
|
|
||||||
const cdsb = cdsbInfoObj[cdsbKey];
|
|
||||||
const {xmdm,xmxh,modelKey} = cdsb
|
|
||||||
return {
|
return {
|
||||||
xmdm, xmxh, model: getModelData(`${examType}/${modelKey}.txt`)
|
desc: thisMark.markshow,
|
||||||
}
|
score: thisMark.markreal,
|
||||||
})
|
markcatalog: thisMark.markcatalog,
|
||||||
}
|
markserial: thisMark.markserial,
|
||||||
const initInfo = {
|
kfxh: thisMark.kfxh
|
||||||
kskm: examSubject * 1,
|
|
||||||
kchp: plateNo,
|
|
||||||
kchm: carId * 1,
|
|
||||||
kscx: carType,
|
|
||||||
cxcode: '1',
|
|
||||||
name: carName,
|
|
||||||
carmodel: getModelData(`${examType}/${carType}.txt`),
|
|
||||||
allitems,
|
|
||||||
mark: Reflect.ownKeys(markRuleListObj).map(ruleKey => (markRuleListObj[ruleKey])) || testMarkRules,
|
|
||||||
sysset: judgeUI.judgeConfig,
|
|
||||||
};
|
|
||||||
|
|
||||||
let km3Config = {}
|
|
||||||
|
|
||||||
if (examSubject) {
|
|
||||||
km3Config = await getKm3JudgeInitConfig();
|
|
||||||
}
|
|
||||||
// 获取科目三的评判配置
|
|
||||||
console.info(judgeTag, '3.获取评判初始化数据完成')
|
|
||||||
return {
|
|
||||||
...initInfo,
|
|
||||||
...km3Config,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 消息心跳发送
|
// 消息心跳发送
|
||||||
getMessageHeartbeat = async (isEnd?: Boolean) => {
|
getMessageHeartbeat = async (isEnd?: Boolean) => {
|
||||||
const carInfo = globalThis.carInfo;
|
const carInfo = globalThis.carInfo;
|
||||||
@ -597,66 +649,6 @@ export default class Judge {
|
|||||||
this.serialIndex += 1;
|
this.serialIndex += 1;
|
||||||
return Array2Byte(tempArr)
|
return Array2Byte(tempArr)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取开始考试数据
|
|
||||||
getJudgeBeginData = async () => {
|
|
||||||
console.log('globalThis.carInfo.wayno',globalThis.carInfo.wayno)
|
|
||||||
const {code,name:examinerName} = globalThis.examinerInfo;
|
|
||||||
const {isExam,isTrajectoryOpen} = this;
|
|
||||||
const judgeUI = this.judgeUI
|
|
||||||
const {projects,carType,isDdxk,ddxkTime,projectsCenterObj,ddxkKsxmArr,ddxkKfArr} = judgeUI;
|
|
||||||
const beginInfo = {
|
|
||||||
kgid: '012',
|
|
||||||
kgxm: decodeURI(examinerName || ''),
|
|
||||||
exam: isExam ? 1 : 0,
|
|
||||||
//是否回放
|
|
||||||
replay: 0,
|
|
||||||
//生成的轨迹文件
|
|
||||||
track: '',
|
|
||||||
xm: judgeUI.name,
|
|
||||||
sex: 0,
|
|
||||||
kslsh: judgeUI.lsh,
|
|
||||||
sfzmhm: judgeUI.idCard,
|
|
||||||
ksyy: '',
|
|
||||||
kscx: carType,
|
|
||||||
kkcs: 1,
|
|
||||||
sfyk: 0,
|
|
||||||
ykkkcs: 1,
|
|
||||||
wayno: Number(globalThis.carInfo.wayno)|| 0,
|
|
||||||
czlx: 0,
|
|
||||||
kskssj: await systemTime.getCurrentTime(),
|
|
||||||
ksxm: projects.map(project => {
|
|
||||||
return {
|
|
||||||
xmdm: project.projectCode * 1,
|
|
||||||
xmxh: '',
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
//断点续考
|
|
||||||
ddxk: isDdxk ? 1 : 0,
|
|
||||||
ddkssj: ddxkTime,
|
|
||||||
ykxm: isDdxk ? (ddxkKsxmArr?.map(projectCenterCode => (projectsCenterObj[projectCenterCode]?.projectCode) * 1)) : [],
|
|
||||||
kfxm: isDdxk ? (ddxkKfArr?.map(kf => {
|
|
||||||
const [xmdm, kfdm] = kf.split(',')
|
|
||||||
return {
|
|
||||||
xmdm: xmdm * 1,
|
|
||||||
kfdm
|
|
||||||
}
|
|
||||||
})) : [],
|
|
||||||
yklc: 0,
|
|
||||||
special: [],
|
|
||||||
//TODO 科目三参数临时写死
|
|
||||||
sczb: 0,
|
|
||||||
sczbkf: [],
|
|
||||||
dmndg: false,
|
|
||||||
nitem1: false,
|
|
||||||
nitem41: false,
|
|
||||||
mfxx: false,
|
|
||||||
mfxxn: false
|
|
||||||
}
|
|
||||||
console.info(judgeTag, '5.获取开始考试数据完成')
|
|
||||||
return beginInfo
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取场地序号
|
//获取场地序号
|
||||||
getSbxh = (ksxm, xmxh) => {
|
getSbxh = (ksxm, xmxh) => {
|
||||||
const {judgeUI} = this;
|
const {judgeUI} = this;
|
||||||
@ -671,7 +663,6 @@ export default class Judge {
|
|||||||
const sbxh = currentCdsb.sbbh || '00000000'
|
const sbxh = currentCdsb.sbbh || '00000000'
|
||||||
return sbxh
|
return sbxh
|
||||||
}
|
}
|
||||||
|
|
||||||
getSbbm = (ksxm, xmxh) => {
|
getSbbm = (ksxm, xmxh) => {
|
||||||
const {judgeUI} = this;
|
const {judgeUI} = this;
|
||||||
const {cdsbInfoObj,projectsObj} = judgeUI;
|
const {cdsbInfoObj,projectsObj} = judgeUI;
|
||||||
@ -684,7 +675,6 @@ export default class Judge {
|
|||||||
const sbxh = currentCdsb.sbbm || '00000000'
|
const sbxh = currentCdsb.sbbm || '00000000'
|
||||||
return sbxh
|
return sbxh
|
||||||
}
|
}
|
||||||
|
|
||||||
// 中心所有项目转换
|
// 中心所有项目转换
|
||||||
getTranslateProject = () => {
|
getTranslateProject = () => {
|
||||||
// const {testKmItems} = this;
|
// const {testKmItems} = this;
|
||||||
@ -707,13 +697,11 @@ export default class Judge {
|
|||||||
}
|
}
|
||||||
return arr.map(numStr => parseInt(numStr, 2));
|
return arr.map(numStr => parseInt(numStr, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取考试项目详情
|
// 获取考试项目详情
|
||||||
getProjectInfo = (projectCode) => {
|
getProjectInfo = (projectCode) => {
|
||||||
const judgeUI = this.judgeUI;
|
const judgeUI = this.judgeUI;
|
||||||
return judgeUI.projectsObj[projectCode]
|
return judgeUI.projectsObj[projectCode]
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取模型数据
|
// 获取模型数据
|
||||||
getModelData = (modelName) => {
|
getModelData = (modelName) => {
|
||||||
const modelPath = this.modelPath
|
const modelPath = this.modelPath
|
||||||
@ -744,7 +732,6 @@ export default class Judge {
|
|||||||
itemno: itemno * 1,
|
itemno: itemno * 1,
|
||||||
type: 1
|
type: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
console.info(judgeTag, `人工评判进入项目-${itemno}`)
|
console.info(judgeTag, `人工评判进入项目-${itemno}`)
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -864,8 +851,6 @@ export default class Judge {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public plcStr: string
|
|
||||||
private judgeUI
|
|
||||||
// 更改考试状态
|
// 更改考试状态
|
||||||
goVoiceAnnounce = async (event, xmdm, kf, xmjs) => {
|
goVoiceAnnounce = async (event, xmdm, kf, xmjs) => {
|
||||||
const {projectsObj,judgeConfigObj} = this.judgeUI;
|
const {projectsObj,judgeConfigObj} = this.judgeUI;
|
||||||
@ -931,7 +916,6 @@ export default class Judge {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取plc数据
|
// 获取plc数据
|
||||||
getPlcData = async (plc: string) => {
|
getPlcData = async (plc: string) => {
|
||||||
const {fileLog,mndgStr,rmndg,wav} = this;
|
const {fileLog,mndgStr,rmndg,wav} = this;
|
||||||
@ -960,7 +944,6 @@ export default class Judge {
|
|||||||
// 处理轨迹plc信号
|
// 处理轨迹plc信号
|
||||||
handleTrajectoryUdp = async (strArr) => {
|
handleTrajectoryUdp = async (strArr) => {
|
||||||
const {fileLog} = this;
|
const {fileLog} = this;
|
||||||
console.log('kkkkk')
|
|
||||||
let num = 2;
|
let num = 2;
|
||||||
const {usbService} = this;
|
const {usbService} = this;
|
||||||
const judgeTimer = setInterval(async () => {
|
const judgeTimer = setInterval(async () => {
|
||||||
@ -1088,7 +1071,8 @@ export default class Judge {
|
|||||||
judgeUI.projectsObj = deepClone(copyProjectsObj)
|
judgeUI.projectsObj = deepClone(copyProjectsObj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public plcStr: string
|
||||||
|
private judgeUI
|
||||||
private fileLog
|
private fileLog
|
||||||
private totalScore: number
|
private totalScore: number
|
||||||
private folderPath: string
|
private folderPath: string
|
||||||
|
|||||||
@ -9,7 +9,7 @@ export const judgeConfig = {
|
|||||||
// 本地模型地址
|
// 本地模型地址
|
||||||
modelPath: 'models/model_enc',
|
modelPath: 'models/model_enc',
|
||||||
// 轨迹回放地址
|
// 轨迹回放地址
|
||||||
trajectoryPath: 'logs/2024_06_18/0000000000001_342323199501470011_测试学员1_2024_06_26_10_04_23/judge_exam_data.txt'
|
trajectoryPath: 'logs/2024_06_18/0000000000001_342323199501470011_测试学员1_2024_07_03_14_55_22/judge_exam_data.txt'
|
||||||
}
|
}
|
||||||
//0000000000001_342323199501470011_测试学员1_2024_04_28_10_59_44
|
//0000000000001_342323199501470011_测试学员1_2024_04_28_10_59_44
|
||||||
// 模拟灯光轨迹
|
// 模拟灯光轨迹
|
||||||
@ -5,7 +5,7 @@ import {
|
|||||||
import systemTime from '@ohos.systemDateTime';
|
import systemTime from '@ohos.systemDateTime';
|
||||||
|
|
||||||
import FileUtil from '../../../common/utils/File'
|
import FileUtil from '../../../common/utils/File'
|
||||||
import FileModel from './../utils/file-model'
|
import FileModel from './fileModel'
|
||||||
import {testRealExam} from '../dataTest/index'
|
import {testRealExam} from '../dataTest/index'
|
||||||
|
|
||||||
const judgeTag = 'SURENJUN_JUDGE'
|
const judgeTag = 'SURENJUN_JUDGE'
|
||||||
@ -27,11 +27,14 @@ export default class JudgeImg {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async init(){
|
async init(){
|
||||||
|
const isJudgeInitBool = globalThis.isJudgeInitBool;
|
||||||
const {judgeUI} = this;
|
const {judgeUI} = this;
|
||||||
console.info(judgeTag,'1.进入绘制入口')
|
console.info(judgeTag,'1.进入评判入口')
|
||||||
|
|
||||||
await examJudgeMapSetParam(640, 480); //设置参数宽、高
|
await examJudgeMapSetParam(640, 480); //设置参数宽、高
|
||||||
await examJudgeMapSetScaling(120); //设置缩放比例,一般默认填100(就是100%的意思) ,数字越大视野越大,数字越小视野越小,不能为0
|
await examJudgeMapSetScaling(120); //设置缩放比例,一般默认填100(就是100%的意思) ,数字越大视野越大,数字越小视野越小,不能为0
|
||||||
judgeUI.draw = true
|
judgeUI.draw = true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取评判初始化数据
|
//获取评判初始化数据
|
||||||
@ -1,27 +0,0 @@
|
|||||||
import VoiceAnnounce from './voice-announcements'
|
|
||||||
|
|
||||||
// 模拟灯光
|
|
||||||
export default class SimulateLights{
|
|
||||||
|
|
||||||
//模拟灯光播放5个
|
|
||||||
private avPlayer
|
|
||||||
|
|
||||||
//语音文件存放目录
|
|
||||||
private voiceDir:string = 'judge/km3/lights'
|
|
||||||
|
|
||||||
constructor(avPlayer) {
|
|
||||||
this.avPlayer = avPlayer;
|
|
||||||
this.playLight()
|
|
||||||
}
|
|
||||||
|
|
||||||
//播放灯光语音
|
|
||||||
public async playLight(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取随机播放序号
|
|
||||||
private async getRandomIndex(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -16,7 +16,7 @@ export default class VoiceAnnounce{
|
|||||||
this.queue = []
|
this.queue = []
|
||||||
}
|
}
|
||||||
|
|
||||||
async playAudio(urls:string[],shit,callback:Function){
|
async playAudio(urls:string[],shit?:boolean,callback?:Function){
|
||||||
const {isStopped,queue} = this;
|
const {isStopped,queue} = this;
|
||||||
this.callback = callback
|
this.callback = callback
|
||||||
if(shit){
|
if(shit){
|
||||||
BIN
entry/src/main/resources/base/media/sczb_btn.png
Normal file
BIN
entry/src/main/resources/base/media/sczb_btn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
Loading…
x
Reference in New Issue
Block a user