fix: 优化一些错误
This commit is contained in:
parent
d836b58f9a
commit
4319805f45
@ -10,7 +10,6 @@ import { defaultJudgeConfigObj } from './judgeSDK/utils//judgeCommon';
|
||||
import { uploadExamMileage } from '../api/judge';
|
||||
import DwztErrorPopup from './compontents/judge/DwztErrorPopup';
|
||||
import MsgPopup from './compontents/judge/MsgPopup';
|
||||
|
||||
import {
|
||||
CARINFO,
|
||||
CDSBInfo,
|
||||
@ -18,44 +17,32 @@ import {
|
||||
MAPITEMPOINTITEM,
|
||||
MAPPOINT,
|
||||
MarkRule,
|
||||
Project,
|
||||
ProjectObj,
|
||||
SYSTEMPARMARR
|
||||
Project, SYSTEMPARMARR
|
||||
} from './judgeSDK/api/judgeSDK.d';
|
||||
|
||||
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
|
||||
|
||||
import SignDisplayCom from './compontents/signDisplayCom';
|
||||
import {
|
||||
AmplifyItem,
|
||||
CarInfoType,
|
||||
CommonType,
|
||||
CDSBInfos, DefaultJudgeConfigObj,
|
||||
ES_CARINFOType,
|
||||
KfdmType,
|
||||
MA_CDSBINFOType,
|
||||
ItemInfos,
|
||||
JudgeBeginObj,
|
||||
JudgeCallBacData,
|
||||
JudgeInitObj,
|
||||
JudgeUI, MA_CDSBINFOType,
|
||||
MA_ITEMINFOType,
|
||||
MA_MAP_POINT_ITEMType,
|
||||
MA_MAP_POINTType,
|
||||
MA_MARKRULEType,
|
||||
MA_SYSTEMPARMType,
|
||||
MASYSSETTableType,
|
||||
RouteParamsType,
|
||||
User,
|
||||
SYSSET,
|
||||
SyssetConfig,
|
||||
ProjectInfo,
|
||||
ProjectInfos,
|
||||
ProjectCenterInfos,
|
||||
JudgeInitObj,
|
||||
JudgeBeginObj,
|
||||
UploadExamMileage,
|
||||
AmplifyItem,
|
||||
ProjectRoads,
|
||||
JudgeCallBacData,
|
||||
JudgeUI,
|
||||
CDSBInfos,
|
||||
ItemInfos,
|
||||
MA_MAP_POINTType, MA_SYSTEMPARMType,
|
||||
MarkRules,
|
||||
DefaultJudgeConfigObj
|
||||
MASYSSETTableType, ProjectInfo,
|
||||
ProjectInfos,
|
||||
ProjectRoads,
|
||||
RouteParamsType,
|
||||
SYSSET,
|
||||
SyssetConfig, User
|
||||
} from '../model';
|
||||
import { GetSyncData } from '../utils/table/Operation';
|
||||
import dayTs from '../utils/Date';
|
||||
@ -251,7 +238,6 @@ struct Index {
|
||||
async initStudent() {
|
||||
const students = await GetSyncData<User>('USER')
|
||||
const stuInfo = students[0];
|
||||
// const { xm, sfzmhm, lsh, kszp, ksdd, kssycs, kslx, ksxl, xldm } = stuInfo;
|
||||
this.name = stuInfo.xm || '测试考生';
|
||||
this.idCard = stuInfo.sfzmhm || '01234567891010';
|
||||
this.lsh = this.singlePlay ? '0000000000000' : stuInfo.lsh;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import libJudgeSdk from "libjudgesdk.so"
|
||||
import libJudgeSdk from 'libjudgesdk.so';
|
||||
import { JudgeInitObj } from '../../../model';
|
||||
|
||||
// import libJudgeSdk from '@ohos.judgesdk'
|
||||
/**
|
||||
@ -24,7 +25,7 @@ export async function examJudgeVersion(): Promise<string> {
|
||||
* @params callBack 日志操作回调
|
||||
* @desc 设置评判日志级别和日志回调函数
|
||||
*/
|
||||
export async function examJudgeSetLogCallback(level: number, handleLog: Function): Promise<string> {
|
||||
export async function examJudgeSetLogCallback(level: number, handleLog: Function): Promise<number> {
|
||||
const temp: number = libJudgeSdk.examJudgeSetLogCallback(level, handleLog);
|
||||
return await handle(temp, 'examJudgeSetLogCallback')
|
||||
}
|
||||
@ -33,7 +34,7 @@ export async function examJudgeSetLogCallback(level: number, handleLog: Function
|
||||
*
|
||||
* @desc评判初始化
|
||||
*/
|
||||
export async function examJudgeInit(data) {
|
||||
export async function examJudgeInit(data: JudgeInitObj) {
|
||||
const str = JSON.stringify(data);
|
||||
const temp: number = libJudgeSdk.examJudgeInit(str, str.length);
|
||||
return await handle(temp, 'examJudgeInit')
|
||||
@ -180,11 +181,14 @@ export async function examJudgeSetPerformCallback(fn) {
|
||||
interface SoundParam {
|
||||
//项目代码
|
||||
xmdm: number,
|
||||
|
||||
//语音码
|
||||
code: string,
|
||||
|
||||
//语音类型
|
||||
type: 0 | 1,
|
||||
}
|
||||
|
||||
export async function examJudgeSoundEnd(param: SoundParam) {
|
||||
const temp: number = libJudgeSdk.examJudgeSoundEnd(param.xmdm, param.code, param.type);
|
||||
return await handle(temp, 'examJudgeSoundEnd')
|
||||
@ -202,6 +206,7 @@ interface DistanceParam{
|
||||
wd2: number,
|
||||
h: number
|
||||
}
|
||||
|
||||
export async function examCalcGpsDistance(param: DistanceParam): Promise<number> {
|
||||
const temp: number = libJudgeSdk.examCalcGpsDistance(param.jd1, param.wd1, param.jd2, param.wd2, param.h);
|
||||
return temp
|
||||
@ -212,7 +217,7 @@ export async function examCalcGpsDistance(param:DistanceParam):Promise<number> {
|
||||
* @desc通用处理函数
|
||||
*
|
||||
*/
|
||||
async function handle(temp:number, fnName:string): Promise<string> {
|
||||
async function handle(temp: number, fnName: string): Promise<number> {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (temp == 0) {
|
||||
resolve(temp);
|
||||
|
||||
@ -2,29 +2,21 @@ import systemTime from '@ohos.systemDateTime';
|
||||
import router from '@ohos.router';
|
||||
import util from '@ohos.util';
|
||||
import buffer from '@ohos.buffer';
|
||||
import { testKm2Items, testKm3Items, testMarkRules } from './dataTest/index';
|
||||
import { EXAMDATA, KSJS, Project, SOUND } from './api/judgeSDK';
|
||||
import { testKm2Items, testKm3Items } from './dataTest/index';
|
||||
import { KSJS } from './api/judgeSDK';
|
||||
import VoiceAnnounce from './utils/voiceAnnouncements';
|
||||
import FileModel from './utils/fileModel';
|
||||
import FilePhoto from './utils/filePhoto';
|
||||
import FileLog from './utils/fileLog';
|
||||
import JudgeTask from './utils/judgeTask';
|
||||
import { judgeConfig } from './utils/judgeConfig';
|
||||
import { KF, LANE } from '../judgeSDK/api/judgeSDK.d';
|
||||
import { LANE } from '../judgeSDK/api/judgeSDK.d';
|
||||
import { GetSyncData, SqlInsertTable } from '../../utils/table/Operation';
|
||||
|
||||
import {
|
||||
getCarStatus,
|
||||
getCarStatusType,
|
||||
getCenterProjectStatus,
|
||||
getDwStatusType,
|
||||
getKmProjectCancelVoice,
|
||||
getKmProjectVoice,
|
||||
getTranslateSignals,
|
||||
plcStrToJson,
|
||||
getCarStatus, getCenterProjectStatus, plcStrToJson,
|
||||
plcStrToWXJson,
|
||||
promptWxCode,
|
||||
senorToWXDataStr
|
||||
promptWxCode
|
||||
} from './utils/judgeCommon';
|
||||
|
||||
import {
|
||||
@ -42,15 +34,44 @@ import {
|
||||
examJudgeVersion
|
||||
} from './api/index';
|
||||
|
||||
import { writeObjectOut, uploadExamProgressData } from '../../api/judge';
|
||||
import { saveStartRecordVideo,endRecordVideo } from '../../utils/Video';
|
||||
import { uploadExamProgressData, writeObjectOut } from '../../api/judge';
|
||||
import { endRecordVideo, saveStartRecordVideo } from '../../utils/Video';
|
||||
import common from '@ohos.app.ability.common';
|
||||
import { Array2Byte, convertGpsCoord2, deepClone, fillZero, string2Bytes } from './utils/Common';
|
||||
import { GetCurrentTime, StringToASCII } from '../../utils/Common';
|
||||
import { convertGpsCoord2, deepClone } from './utils/Common';
|
||||
import { GetCurrentTime } from '../../utils/Common';
|
||||
import UsbService from '../../utils/USB';
|
||||
import FileUtils from '../../utils/FileUtils';
|
||||
import { BaseInfoType, CarInfoType, JudgeUI, Km3JudgeInitConfig ,ProjectInfo,Plc,DistanceClass,Ksjs,MarkRule,RegulatoryInterfaceParams,DrvexamType,RecordHandleType,WR,CDSBInfo,ItemInfo,JudgeInitObj,RouteParamsType,ExaminerInfoType,JudgeBeginObj,JudgeKsxm,JudgeKfxm,JudgeSound,JudgeSoundB,JudgeEventKf,JudgeKsjs,JudgeXmjs,JudgeCallBackData,KmItems,KmItem,
|
||||
JudgeConfigObj,User,TKmItem,JudgePerformInfo,JudgeUdpKf} from '../../model';
|
||||
import {
|
||||
BaseInfoType,
|
||||
CarInfoType,
|
||||
CDSBInfo,
|
||||
DistanceClass,
|
||||
DrvexamType,
|
||||
ExaminerInfoType,
|
||||
ItemInfo,
|
||||
JudgeBeginObj,
|
||||
JudgeCallBackData,
|
||||
JudgeConfigObj,
|
||||
JudgeEventKf,
|
||||
JudgeInitObj,
|
||||
JudgeKfxm,
|
||||
JudgeKsjs,
|
||||
JudgeKsxm,
|
||||
JudgePerformInfo,
|
||||
JudgeSound, JudgeUI,
|
||||
JudgeXmjs,
|
||||
Km3JudgeInitConfig,
|
||||
KmItem,
|
||||
KmItems, MarkRule,
|
||||
Plc,
|
||||
ProjectInfo,
|
||||
RecordHandleType,
|
||||
RegulatoryInterfaceParams,
|
||||
RouteParamsType,
|
||||
TKmItem,
|
||||
User,
|
||||
WR
|
||||
} from '../../model';
|
||||
|
||||
const judgeTag = 'SURENJUN_JUDGE'
|
||||
|
||||
@ -62,19 +83,109 @@ type GetKfStr = (code:string) => MarkRule
|
||||
type GetDqxmStr = (xmdm: number) => string
|
||||
|
||||
type TJudgeBeginObj = JudgeBeginObj
|
||||
|
||||
export default class Judge {
|
||||
// 断网数据补传
|
||||
uploadDisConnectData = async () => {
|
||||
if (!this.isJudgeDisConnect) {
|
||||
return
|
||||
}
|
||||
const folderPath = this.fileLog.folderPath
|
||||
const examDataStr = await this.fileUtil.readFile(`${folderPath}/wuxi_dis_progress_data.txt`);
|
||||
const examDataArr = examDataStr.split('\n');
|
||||
for (let examDataStr of examDataArr) {
|
||||
const code = await writeObjectOut(JSON.parse(examDataStr));
|
||||
public plcStr: string
|
||||
public judgeUI: JudgeUI
|
||||
//获取科目三的评判初始化配置
|
||||
getKm3JudgeInitConfig: GetKm3JudgeInitConfig = async () => {
|
||||
return {
|
||||
map_point: this.judgeUI.mapPointArr,
|
||||
map_point_item: this.judgeUI.mapPointItemArr,
|
||||
//科目三暂时为空
|
||||
iteminfo: [],
|
||||
roads: this.getModelData('km3/Roads.txt'),
|
||||
sharps: this.getModelData('km3/Sharps.txt')
|
||||
}
|
||||
}
|
||||
private context: common.UIAbilityContext
|
||||
private fileLog: FileLog
|
||||
//人工扣分
|
||||
public setJudgeMark = async (itemno: string, serial: string, type = 1) => {
|
||||
await examJudgeArtificialMark(Number(itemno), serial, type);
|
||||
console.info(judgeTag, `进入人工扣分-${itemno}-${serial}`)
|
||||
const str = JSON.stringify({
|
||||
method: 'examJudgeArtificialMark',
|
||||
itemno: Number(itemno),
|
||||
serial,
|
||||
type
|
||||
})
|
||||
await this.fileLog.setExamJudgeData(str)
|
||||
console.info(judgeTag, `人工扣分-${itemno}-${serial}`)
|
||||
}
|
||||
//人工操作项目
|
||||
public setJudgeItem = async (itemno: string, type: 1 | 2) => {
|
||||
// const { fileLog } = this;
|
||||
await examJudgeArtificialItem(Number(itemno), type);
|
||||
const str = JSON.stringify({
|
||||
method: 'examJudgeArtificialItem',
|
||||
itemno: Number(itemno),
|
||||
type
|
||||
})
|
||||
await this.fileLog.setExamJudgeData(str)
|
||||
console.info(judgeTag, `人工评判${type == 1 ? '进入' : '取消'}项目-${itemno}`)
|
||||
}
|
||||
private filePath: string
|
||||
private totalScore: number
|
||||
private prevJd: number = 0
|
||||
private prevWd: number = 0
|
||||
private dwztNum: number = 0
|
||||
private folderPath: string
|
||||
private modelPath: string
|
||||
private avPlayer: VoiceAnnounce
|
||||
// 处理特殊参数配置
|
||||
handleSEP = async (code: number) => {
|
||||
const judgeConfigObj = this.judgeUI.judgeConfigObj
|
||||
const avPlayer = this.avPlayer
|
||||
switch (code) {
|
||||
//结束考试方式
|
||||
case 306:
|
||||
if (judgeConfigObj[code] == 5) {
|
||||
//靠边停车
|
||||
avPlayer.playAudio(['voice/406001.mp3'])
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
private carztStr: string
|
||||
private rmndg: 0 | 1
|
||||
private mndgStr: string | undefined
|
||||
// 模拟灯光
|
||||
setMndg = async (mndgStr: string) => {
|
||||
this.mndgStr = mndgStr
|
||||
}
|
||||
private xmmcStr: string
|
||||
private xmmcCode: string
|
||||
private xmmcSingleCode: string
|
||||
private xmmcEndCode?: string
|
||||
private xmdm: string | number
|
||||
private xmxh: string
|
||||
private fileModel: FileModel
|
||||
private filePhoto: FilePhoto
|
||||
// 过程照片拍照
|
||||
getPhoto = async (empty?: boolean) => {
|
||||
const singlePlay: boolean = AppStorage.get<boolean>('singlePlay')
|
||||
//单机模式返回空照片
|
||||
if (singlePlay) {
|
||||
return ''
|
||||
} else {
|
||||
const photoBase64 = await this.filePhoto.getPhoto();
|
||||
console.info(judgeTag, '拍照完成')
|
||||
return photoBase64
|
||||
}
|
||||
}
|
||||
private usbService: UsbService
|
||||
//是否是考试模式
|
||||
private isExam: boolean
|
||||
//考试是否结束了
|
||||
private isExamEnd: boolean
|
||||
// 是否发送udp
|
||||
private isUdpEnd: boolean = false
|
||||
//是否手动结束考试
|
||||
private isManual: boolean
|
||||
//UDP服务序列号
|
||||
private serialIndex: number
|
||||
private fileUtil: FileUtils
|
||||
//上传无锡所过程数据
|
||||
uploadProgressData = async () => {
|
||||
const carInfo = AppStorage.get<CarInfoType>('carInfo')
|
||||
@ -116,34 +227,7 @@ export default class Judge {
|
||||
}
|
||||
console.info(judgeTag, '过程数据文件上传 end')
|
||||
}
|
||||
//获取科目三的评判初始化配置
|
||||
getKm3JudgeInitConfig:GetKm3JudgeInitConfig = async () => {
|
||||
return {
|
||||
map_point: this.judgeUI.mapPointArr,
|
||||
map_point_item: this.judgeUI.mapPointItemArr,
|
||||
//科目三暂时为空
|
||||
iteminfo: [],
|
||||
roads: this.getModelData('km3/Roads.txt'),
|
||||
sharps: this.getModelData('km3/Sharps.txt')
|
||||
}
|
||||
}
|
||||
// 处理特殊参数配置
|
||||
handleSEP = async (code: number) => {
|
||||
const judgeConfigObj = this.judgeUI.judgeConfigObj
|
||||
const avPlayer = this.avPlayer
|
||||
switch (code) {
|
||||
//结束考试方式
|
||||
case 306:
|
||||
if (judgeConfigObj[code] == 5) {
|
||||
//靠边停车
|
||||
avPlayer.playAudio(['voice/406001.mp3'])
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
public plcStr: string
|
||||
private context: common.UIAbilityContext
|
||||
public judgeUI: JudgeUI
|
||||
private judgeTask: JudgeTask
|
||||
// 检测扣分、结束项目时该项目是否开始
|
||||
checkProjectIsStart = async (xmdm: number, currentType: 1 | 2, kf?: JudgeEventKf) => {
|
||||
if (xmdm == 20) {
|
||||
@ -198,82 +282,6 @@ export default class Judge {
|
||||
return true
|
||||
}
|
||||
}
|
||||
private fileLog: FileLog
|
||||
|
||||
//人工扣分
|
||||
public setJudgeMark = async (itemno:string, serial:string, type = 1) => {
|
||||
await examJudgeArtificialMark(Number(itemno), serial, type);
|
||||
console.info(judgeTag, `进入人工扣分-${itemno}-${serial}`)
|
||||
const str = JSON.stringify({
|
||||
method: 'examJudgeArtificialMark',
|
||||
itemno: Number(itemno),
|
||||
serial,
|
||||
type
|
||||
})
|
||||
await this.fileLog.setExamJudgeData(str)
|
||||
console.info(judgeTag, `人工扣分-${itemno}-${serial}`)
|
||||
}
|
||||
|
||||
//人工操作项目
|
||||
public setJudgeItem = async (itemno: string, type: 1 | 2) => {
|
||||
// const { fileLog } = this;
|
||||
await examJudgeArtificialItem(Number(itemno), type);
|
||||
const str = JSON.stringify({
|
||||
method: 'examJudgeArtificialItem',
|
||||
itemno: Number(itemno),
|
||||
type
|
||||
})
|
||||
await this.fileLog.setExamJudgeData(str)
|
||||
console.info(judgeTag, `人工评判${type == 1 ? '进入' : '取消'}项目-${itemno}`)
|
||||
}
|
||||
private filePath: string
|
||||
private totalScore: number
|
||||
private prevJd: number = 0
|
||||
private prevWd: number = 0
|
||||
private dwztNum: number = 0
|
||||
private folderPath: string
|
||||
private modelPath: string
|
||||
private avPlayer: VoiceAnnounce
|
||||
private carztStr: string
|
||||
private rmndg: 0 | 1
|
||||
private mndgStr: string | undefined
|
||||
// 模拟灯光
|
||||
setMndg = async (mndgStr: string) => {
|
||||
this.mndgStr = mndgStr
|
||||
}
|
||||
private xmmcStr: string
|
||||
private xmmcCode: string
|
||||
private xmmcSingleCode: string
|
||||
private xmmcEndCode?: string
|
||||
private xmdm: string | number
|
||||
private xmxh: string
|
||||
private fileModel: FileModel
|
||||
private filePhoto: FilePhoto
|
||||
// 过程照片拍照
|
||||
getPhoto = async (empty?: boolean) => {
|
||||
const singlePlay: boolean = AppStorage.get<boolean>('singlePlay')
|
||||
//单机模式返回空照片
|
||||
if (singlePlay) {
|
||||
return ''
|
||||
} else {
|
||||
const photoBase64 = await this.filePhoto.getPhoto();
|
||||
console.info(judgeTag, '拍照完成')
|
||||
return photoBase64
|
||||
}
|
||||
}
|
||||
private usbService: UsbService
|
||||
//是否是考试模式
|
||||
private isExam: boolean
|
||||
//考试是否结束了
|
||||
private isExamEnd: boolean
|
||||
// 是否发送udp
|
||||
private isUdpEnd: boolean = false
|
||||
//是否手动结束考试
|
||||
private isManual: boolean
|
||||
//UDP服务序列号
|
||||
private serialIndex: number
|
||||
private fileUtil: FileUtils
|
||||
private judgeTask: JudgeTask
|
||||
private tempData: Plc
|
||||
//实时计算gps经纬度距离
|
||||
handDistance = async () => {
|
||||
@ -504,13 +512,25 @@ export default class Judge {
|
||||
// TODO 定时器缺失
|
||||
// globalThis.judgeTimer = judgeTimer;
|
||||
}
|
||||
//当前科目二的考试项目
|
||||
// private currentKm2ItemsObj: any
|
||||
//本地轨迹回放地址
|
||||
private trajectoryPath: string
|
||||
//当前科目二的考试项目
|
||||
// private currentKm2ItemsObj: any
|
||||
private isTrajectoryOpen: boolean;
|
||||
// 调代理接口是否断网了
|
||||
private isJudgeDisConnect: boolean;
|
||||
// 断网数据补传
|
||||
uploadDisConnectData = async () => {
|
||||
if (!this.isJudgeDisConnect) {
|
||||
return
|
||||
}
|
||||
const folderPath = this.fileLog.folderPath
|
||||
const examDataStr = await this.fileUtil.readFile(`${folderPath}/wuxi_dis_progress_data.txt`);
|
||||
const examDataArr = examDataStr.split('\n');
|
||||
for (let examDataStr of examDataArr) {
|
||||
const code = await writeObjectOut(JSON.parse(examDataStr));
|
||||
}
|
||||
}
|
||||
// 项目开始接口同步
|
||||
beginProject = async (ksxm: number) => {
|
||||
const carInfo = AppStorage.get<CarInfoType>('carInfo');
|
||||
@ -586,7 +606,6 @@ export default class Judge {
|
||||
}
|
||||
private videoData: RecordHandleType
|
||||
private disConnectNum: number = 0;
|
||||
|
||||
//调用监管接口
|
||||
sendWriteObjectOut: SendWriteObjectOut = async (data, filePath) => {
|
||||
const temp = await writeObjectOut(data, filePath);
|
||||
@ -702,7 +721,9 @@ export default class Judge {
|
||||
allitems = Reflect.ownKeys(itemInfoObj).map(cdsbKey => {
|
||||
const cdsb: CDSBInfo = Reflect.get(itemInfoObj, cdsbKey);
|
||||
const model = this.getModelData(`${examType}/${cdsb.modelKey}.txt`)
|
||||
const temp:ItemInfo = {xmdm:cdsb.xmdm,xmxh:cdsb.xmxh,model}
|
||||
const temp: ItemInfo = {
|
||||
xmdm: cdsb.xmdm, xmxh: cdsb.xmxh, model
|
||||
}
|
||||
return temp
|
||||
})
|
||||
}
|
||||
@ -769,7 +790,9 @@ export default class Judge {
|
||||
const passingScore = judgeUI.passingScore
|
||||
|
||||
const ksxm: JudgeKsxm[] = projects.map(project => {
|
||||
const temp:JudgeKsxm = {xmdm: Number(project.projectCode), xmxh: ''}
|
||||
const temp: JudgeKsxm = {
|
||||
xmdm: Number(project.projectCode), xmxh: ''
|
||||
}
|
||||
return temp
|
||||
})
|
||||
|
||||
@ -779,7 +802,9 @@ export default class Judge {
|
||||
})) || [];
|
||||
|
||||
const kfxm: JudgeKfxm[] = isDdxk ? (ddxkKfArr?.map(kf => {
|
||||
return { xmdm:Number(kf.split(',')[0]), kfdm:kf.split(',')[1]} as JudgeKfxm
|
||||
return {
|
||||
xmdm: Number(kf.split(',')[0]), kfdm: kf.split(',')[1]
|
||||
} as JudgeKfxm
|
||||
})) : []
|
||||
|
||||
const beginInfo: JudgeBeginObj = {
|
||||
@ -947,7 +972,9 @@ export default class Judge {
|
||||
//考试结束
|
||||
case 5:
|
||||
this.ksjs = ksjs;
|
||||
await fileLog.setExamJudgeData(JSON.stringify({method: 'examJudgeEndExam'}))
|
||||
await fileLog.setExamJudgeData(JSON.stringify({
|
||||
method: 'examJudgeEndExam'
|
||||
}))
|
||||
break;
|
||||
|
||||
//项目取消
|
||||
@ -1026,7 +1053,8 @@ export default class Judge {
|
||||
}
|
||||
}
|
||||
// 更改考试状态
|
||||
goVoiceAnnounce = async (event:number, xmdm:number, kf:JudgeEventKf[], xmjs:JudgeXmjs, ksjs:JudgeKsjs, xmxh:string) => {
|
||||
goVoiceAnnounce =
|
||||
async (event: number, xmdm: number, kf: JudgeEventKf[], xmjs: JudgeXmjs, ksjs: JudgeKsjs, xmxh: string) => {
|
||||
|
||||
const beginProject = this.beginProject
|
||||
const pointsDedute = this.pointsDedute
|
||||
@ -1078,11 +1106,15 @@ export default class Judge {
|
||||
judgeTask.addTask(async () => {
|
||||
console.info(judgeTag, `项目开始-${xmdm}-${project.name}`)
|
||||
await beginProject(xmdm)
|
||||
}, {isDelay: true})
|
||||
}, {
|
||||
isDelay: true
|
||||
})
|
||||
judgeTask.addTask(async () => {
|
||||
console.info(judgeTag, `项目-${xmdm}-上传照片 start`)
|
||||
await uploadProgressPhoto(xmdm)
|
||||
}, {isDelay: true})
|
||||
}, {
|
||||
isDelay: true
|
||||
})
|
||||
project.isUpload = true;
|
||||
Reflect.set(this.judgeUI.projects, xmdm, project)
|
||||
}
|
||||
@ -1231,7 +1263,12 @@ export default class Judge {
|
||||
ksdd: encodeURI(ksdd),
|
||||
kfsj: time
|
||||
}
|
||||
const data:RegulatoryInterfaceParams = {xtlb: '17', jkxlh: serialNumber, jkid: '17C53', drvexam}
|
||||
const data: RegulatoryInterfaceParams = {
|
||||
xtlb: '17',
|
||||
jkxlh: serialNumber,
|
||||
jkid: '17C53',
|
||||
drvexam
|
||||
}
|
||||
console.info(judgeTag + 'ksxm=>', data.drvexam.ksxm)
|
||||
|
||||
const temp = await this.sendWriteObjectOut(data, filePath);
|
||||
@ -1307,7 +1344,8 @@ export default class Judge {
|
||||
if (examSubject == '3') {
|
||||
if (totalScore < passingScore) {
|
||||
//考试不合格;考试模式,自动退出;
|
||||
if (param302 == '4' || param302 =='5' || param302 == '7' || param302 == '8') {}
|
||||
if (param302 == '4' || param302 == '5' || param302 == '7' || param302 == '8') {
|
||||
}
|
||||
} else {
|
||||
//考试合格
|
||||
}
|
||||
@ -1372,7 +1410,12 @@ export default class Judge {
|
||||
dwlc: [d1, d2, d3, d4, d5].map((d, index) => `${index + 1},${Math.floor(d / 100)}`).join(';'),
|
||||
}
|
||||
|
||||
const data:RegulatoryInterfaceParams = {xtlb: '17',jkxlh: serialNumber,jkid: '17C56', drvexam}
|
||||
const data: RegulatoryInterfaceParams = {
|
||||
xtlb: '17',
|
||||
jkxlh: serialNumber,
|
||||
jkid: '17C56',
|
||||
drvexam
|
||||
}
|
||||
let backTimeOut = setTimeout(() => {
|
||||
router.back()
|
||||
}, 90 * 1000)
|
||||
@ -1651,7 +1694,6 @@ export default class Judge {
|
||||
const sbxh: string = currentCdsb.sbbh || '0000000000'
|
||||
return sbxh
|
||||
}
|
||||
|
||||
getSbbm: GetgSbbm = (ksxm, xmxh) => {
|
||||
const judgeUI = this.judgeUI;
|
||||
const cdsbInfoObj = judgeUI.cdsbInfoObj;
|
||||
@ -1675,7 +1717,9 @@ export default class Judge {
|
||||
const tempItems: TKmItem[] = (examSubject == '2' ? testKm2Items : testKm3Items).map(item => {
|
||||
const kmItem: KmItem = Reflect.get(this.kmItems, item.code)
|
||||
const status = getCenterProjectStatus(kmItem.status)
|
||||
const temp:TKmItem = {code: item.code, status}
|
||||
const temp: TKmItem = {
|
||||
code: item.code, status
|
||||
}
|
||||
return temp
|
||||
})
|
||||
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import media from '@ohos.multimedia.media';
|
||||
import Prompt from '@system.prompt';
|
||||
import url from '@ohos.url';
|
||||
import fileuri from "@ohos.file.fileuri";
|
||||
import mediaLibrary from '@ohos.multimedia.mediaLibrary';
|
||||
import common from '@ohos.app.ability.common';
|
||||
import { BusinessError } from '@ohos.base';
|
||||
|
||||
const TAG = 'VoiceAnnounce'
|
||||
|
||||
@ -33,12 +32,13 @@ export default class VoiceAnnounce {
|
||||
|
||||
const tempUrls: Queue[] = urls.map((url, index) => {
|
||||
const callback: Function | undefined = (index === urls.length - 1) ? callbackFn : undefined
|
||||
const temp:Queue = {url, callback}
|
||||
const temp: Queue = {
|
||||
url, callback
|
||||
}
|
||||
return temp
|
||||
});
|
||||
|
||||
|
||||
|
||||
if (shit) {
|
||||
//队列清空,重新初始化
|
||||
this.isStopped = true;
|
||||
@ -175,7 +175,8 @@ class AVPlayer {
|
||||
|
||||
// 注册avplayer回调函数
|
||||
setAVPlayerCallback(callBack: Function) {
|
||||
this.avPlayer.on('error', (err) => {
|
||||
this.avPlayer.on('error', (err: BusinessError) => {
|
||||
console.log(TAG, '播放器错误', JSON.stringify(err))
|
||||
this.avPlayer && this.avPlayer.stop()
|
||||
this.avPlayer && this.avPlayer.reset()
|
||||
this.avPlayer && this.avPlayer.release()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user