1211 lines
41 KiB
Plaintext
Raw Normal View History

2024-07-02 11:10:33 +08:00
import router from '@ohos.router';
2024-07-02 10:26:42 +08:00
import Prompt from '@system.prompt';
2024-02-21 14:53:53 +08:00
import common from '@ohos.app.ability.common';
2024-07-02 11:10:33 +08:00
import EndPoPup from './compontents/judge/EndPopup';
import LoadingPopup from './compontents/judge/LoadingPopup';
import DeductedPopup from './compontents/judge/DeductionPopup';
import AmplifyPopup from './compontents/judge/AmplifyPopup';
import Judge from './judgeSDK/judge';
2024-07-05 09:34:03 +08:00
import { defaultJudgeConfigObj } from './judgeSDK/utils//judgeCommon';
2024-07-31 13:47:40 +08:00
import {uploadExamMileage} from '../api/judge'
2024-07-10 19:39:13 +08:00
2024-01-05 11:11:15 +08:00
import {
2024-07-02 11:10:33 +08:00
CARINFO,
CDSBInfo,
2024-07-10 19:39:13 +08:00
LANE,
2024-07-02 11:10:33 +08:00
MAPITEMPOINTITEM,
MAPPOINT,
MarkRule,
Project,
ProjectObj,
SYSSET,
SYSTEMPARMARR
} from './judgeSDK/api/judgeSDK.d';
2024-07-10 19:39:13 +08:00
2024-07-02 11:10:33 +08:00
import { chunkArr, formatTime, getCurrentHourTime, getCurrentTime } from '../common/utils/tools';
import { examJudgeEndExam } from './judgeSDK/api/index';
import { getSyncData } from '../common/service/initable';
2024-07-05 09:34:03 +08:00
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
2024-05-15 16:22:48 +08:00
import FileUtil from '../common/utils/File';
2024-07-02 11:10:33 +08:00
import SignDisplayCom from './compontents/signDisplayCom';
2024-01-05 11:11:15 +08:00
@Entry
@Component
struct Index {
2024-07-31 13:47:40 +08:00
async aboutToDisappear(){
clearInterval(this.mileageTimer)
}
2024-05-15 16:22:48 +08:00
async aboutToAppear() {
2024-07-10 19:39:13 +08:00
globalThis.windowClass.setWindowSystemBarEnable([])
2024-01-05 11:11:15 +08:00
const time = await getCurrentTime()
2024-05-15 16:22:48 +08:00
2024-01-05 11:11:15 +08:00
this.startTime = time.split(' ')[1]
this.startFullTime = await getCurrentTime(1);
this.startHourTime = await getCurrentHourTime()
2024-07-31 13:47:40 +08:00
this.startExamTime = time
2024-01-05 11:11:15 +08:00
2024-05-15 16:22:48 +08:00
setInterval(async () => {
2024-01-05 11:11:15 +08:00
this.time = await getCurrentTime();
this.examTime += 1;
2024-05-15 16:22:48 +08:00
}, 1000);
2024-01-05 11:11:15 +08:00
2024-05-15 16:22:48 +08:00
//初始化数据库表
await this.initDb()
2024-01-31 14:35:16 +08:00
//断点续考
await this.goDdxkItems()
2024-01-31 14:42:14 +08:00
2024-05-15 16:22:48 +08:00
//初始化评判
const judge = await this.initJudge();
2024-01-05 11:11:15 +08:00
this.judge = judge
2024-07-31 13:47:40 +08:00
2024-01-05 11:11:15 +08:00
}
2024-05-15 16:22:48 +08:00
//初始化相关数据库表
2024-07-02 11:10:33 +08:00
async initDb() {
2024-05-15 16:22:48 +08:00
const examSubject = globalThis.carInfo.examSubject;
2024-07-10 19:39:13 +08:00
this.examSubject = examSubject;
2024-05-15 16:22:48 +08:00
const {isTrajectoryOpen,trajectoryPath} = judgeConfig
await this.initStudent();
await this.initCar();
//是否开启轨迹回放模式
2024-07-02 11:10:33 +08:00
if (isTrajectoryOpen) {
2024-05-15 16:22:48 +08:00
this.initTrajectoryParam(trajectoryPath)
2024-07-02 11:10:33 +08:00
} else {
2024-07-10 19:39:13 +08:00
await this.initSystemParam()
2024-05-15 16:22:48 +08:00
await this.initMarkRules();
2024-06-18 16:44:24 +08:00
await this.initSysset();
2024-07-31 13:47:40 +08:00
this.singlePlay = globalThis.singlePlay
2024-05-15 16:22:48 +08:00
}
await this.initCDSBInfo()
// 科目三新增读取表数据
2024-07-02 11:10:33 +08:00
if (examSubject == 3) {
2024-05-15 16:22:48 +08:00
await this.initMapPoint()
await this.initMapPointItem()
2024-07-31 13:47:40 +08:00
//定时上传考试里程
// let mileageTimer = setInterval(()=>{
// this.uploadMileage()
// },5000)
// this.mileageTimer = mileageTimer
2024-05-15 16:22:48 +08:00
}
}
2024-07-02 11:10:33 +08:00
2024-05-15 16:22:48 +08:00
// 查询考车信息
async initCar() {
2024-01-31 14:35:16 +08:00
const result = await getSyncData('ES_CARINFO')
const carInfo = result[0] || {};
2024-02-21 14:53:53 +08:00
this.carName = decodeURI(carInfo.carclass)
this.carType = carInfo.kscx
2024-05-15 16:22:48 +08:00
this.carinfoArrr.push({
2024-07-02 11:10:33 +08:00
CARID: carInfo.carid,
IPADDR: '',
CARCLASS: decodeURI(carInfo.carclass),
KSCX: carInfo.kscx,
CARNAME: decodeURI(carInfo.carclass),
FLAG: carInfo.flag,
BK1: carInfo.bk1,
BK2: carInfo.bk2,
2024-05-15 16:22:48 +08:00
})
2024-01-05 11:11:15 +08:00
}
2024-05-15 16:22:48 +08:00
// 获取考生信息
async initStudent() {
2024-01-31 14:35:16 +08:00
const students = await getSyncData('USER')
const stuInfo = students[0] || {};
2024-07-31 13:47:40 +08:00
console.info('surenjun stuInfo=>', JSON.stringify(stuInfo))
const {xm,sfzmhm,lsh,kszp,ksdd,kssycs,kslx,ksxl} = stuInfo;
2024-07-02 10:02:22 +08:00
this.name = xm || '测试考生';
this.idCard = sfzmhm || '01234567891010';
2024-01-31 14:35:16 +08:00
this.lsh = lsh;
this.kszp = kszp;
this.ksdd = ksdd;
this.kssycs = kssycs;
2024-07-31 13:47:40 +08:00
this.ksxl = ksxl;
this.wayno = ksxl;
2024-01-31 14:35:16 +08:00
this.kslx = kslx;
2024-01-05 11:11:15 +08:00
}
2024-05-15 16:22:48 +08:00
// 获取扣分代码信息
async initMarkRules(markRules ?: MarkRule[]) {
2024-07-02 11:10:33 +08:00
const markRuleParams = markRules || (await getSyncData('MA_MARKRULE') as MarkRule[])
2024-05-15 16:22:48 +08:00
2024-07-02 11:10:33 +08:00
markRuleParams.forEach(mark => {
2024-05-15 16:22:48 +08:00
const tempObj = {
2024-07-02 11:10:33 +08:00
itemno: mark.itemno * 1,
markcatalog: mark.markcatalog,
markshow: decodeURI(mark.markshow),
markreal: mark.markreal * 1,
markserial: mark.markserial,
kfxh: mark.kfxh,
OnlyOneKind: mark.onlyoneid * 1,
NoCancelId: mark.nocancelid * 1,
GPS_SID: mark.gps_sid == 0 ? false : true
2024-05-15 16:22:48 +08:00
}
//筛选出人工评判的扣分
2024-07-05 09:34:03 +08:00
if (Number(tempObj.markserial) > 100 && Number(tempObj.markserial) < 200) {
2024-05-15 16:22:48 +08:00
this.manualMarkRules.push(tempObj)
}
this.markRuleListObj[`${mark.itemno}_${mark.markserial}`] = {
2024-07-02 11:10:33 +08:00
...tempObj,
2024-05-15 16:22:48 +08:00
markserial: mark.markserial,
2024-01-05 11:11:15 +08:00
};
})
}
// 获取sysset表信息
2024-07-02 11:10:33 +08:00
async initSysset(sysset?: SYSSET[]) {
const syssetParams = sysset || await getSyncData('MA_SYSSET')
2024-01-05 11:11:15 +08:00
//@ts-ignore
const serialNumberArr = syssetParams.filter(sys => sys.v_no === '901');
2024-01-31 14:35:16 +08:00
this.serialNumber = (serialNumberArr[0] && serialNumberArr[0].v_value) || '123456'
2024-06-18 16:44:24 +08:00
const {isTrajectoryOpen} = judgeConfig
const syssetJudgeConfigArr = []
2024-01-31 14:42:14 +08:00
2024-01-31 14:35:16 +08:00
//@ts-ignore
2024-05-15 16:22:48 +08:00
syssetParams.forEach((sys) => {
2024-07-02 11:10:33 +08:00
if (isTrajectoryOpen) {
2024-06-18 16:44:24 +08:00
sys.v_no = sys.key;
sys.v_name = sys.name;
sys.v_value = sys.value
}
2024-05-15 16:22:48 +08:00
const {v_no,v_value} = sys;
const v_no_num = v_no * 1;
const value = decodeURIComponent(v_value)
2024-07-02 11:10:33 +08:00
if (v_no_num >= 10 && v_no_num <= 900) {
2024-06-18 16:44:24 +08:00
syssetJudgeConfigArr.push({
2024-07-02 11:10:33 +08:00
key: v_no_num, value: value,
2024-05-15 16:22:48 +08:00
name: decodeURI(sys.v_name)
2024-01-31 14:35:16 +08:00
})
}
2024-06-18 16:44:24 +08:00
//科目三应行驶距离参数
2024-07-02 11:10:33 +08:00
if (sys.v_no == '303') {
2024-06-18 16:44:24 +08:00
this.examMileage = sys.v_value + '';
}
2024-07-05 09:34:03 +08:00
//364 绕车一周评判时机(1-开始考试后判 2-开始考试前判)
2024-07-10 19:39:13 +08:00
if (sys.v_no == '364' && sys.v_value == 2) {
2024-07-05 09:34:03 +08:00
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;
})
2024-07-16 15:02:36 +08:00
this.projectsObj[1].type = kfdm.length ? '4' : '3';
2024-07-05 09:34:03 +08:00
this.projectsObj = {
...this.projectsObj
}
}
2024-05-15 16:22:48 +08:00
this.judgeConfigObj[sys.v_no] = value
2024-07-16 15:02:36 +08:00
2024-01-31 14:35:16 +08:00
});
2024-06-18 16:44:24 +08:00
this.judgeConfig = syssetJudgeConfigArr;
2024-01-31 14:35:16 +08:00
}
2024-07-10 19:39:13 +08:00
//初始化systemParam表
async initSystemParam(sysParam?: SYSTEMPARMARR[]) {
2024-07-02 11:10:33 +08:00
const systemParms: any = sysParam || await getSyncData('MA_SYSTEMPARM')
2024-07-10 19:39:13 +08:00
let currentParams: any = router.getParams();
const {carName,carType,examSubject} = this;
//小车车型列表
const sCarTypes = ['C1', 'C2', 'C5']
2024-07-31 13:47:40 +08:00
if (globalThis.singlePlay) {
this.wayno = currentParams.wayno || 1;
}
2024-07-10 19:39:13 +08:00
const {isTrajectoryOpen} = judgeConfig
let carNo = '', allItems = [];
2024-07-02 11:10:33 +08:00
systemParms.forEach((systemParm) => {
2024-07-10 19:39:13 +08:00
if (isTrajectoryOpen) {
2024-07-31 13:47:40 +08:00
systemParm.no1 = systemParm.NO1 + '';
systemParm.no2 = systemParm.NO2 + '';
systemParm.no3 = systemParm.NO3 + '';
2024-07-10 19:39:13 +08:00
systemParm.txt1 = systemParm.TXT1;
systemParm.txt2 = systemParm.TXT2;
systemParm.txt3 = systemParm.TXT3;
}
const {no1,no2,no3,} = systemParm;
2024-01-31 14:35:16 +08:00
//获取当前考车的no2
2024-07-02 11:10:33 +08:00
if (no1 == 3 && no3 == 1) {
2024-05-15 16:22:48 +08:00
const txt1 = decodeURI(systemParm.txt1)
2024-07-02 11:10:33 +08:00
if (txt1 === carName) {
2024-07-10 19:39:13 +08:00
carNo = no2
2024-05-15 16:22:48 +08:00
}
2024-01-31 14:35:16 +08:00
}
//获取当前考车的考试项目
2024-07-10 19:39:13 +08:00
if (carNo !== '' && no1 == 3 && no2 == carNo && no3 == 10) {
allItems = decodeURIComponent(systemParm.txt1).split(',').filter(txt => txt !== '')
2024-07-31 13:47:40 +08:00
console.info('surenjun', JSON.stringify(allItems))
2024-01-31 14:35:16 +08:00
}
2024-07-10 19:39:13 +08:00
const txt2 = decodeURIComponent(systemParm.txt2);
if (
//科目二获取项目
(examSubject == 2 && allItems.length && no1 == 6 && allItems.includes(no2))
||
//科目三获取项目
(examSubject == 3 && no1 == 6)
) {
const name = decodeURI(systemParm.txt1)
//小车过滤掉 夜间模拟行驶
if (sCarTypes.includes(carType) && name === '夜间行驶') {
return
}
2024-01-31 14:35:16 +08:00
const currentProject = {
2024-07-10 19:39:13 +08:00
name,
2024-07-02 11:10:33 +08:00
abbreviation: decodeURI(systemParm.txt3),
projectCode: no2,
2024-07-10 19:39:13 +08:00
projectCodeCenter: txt2,
//是否是必考
isRequired: allItems.includes(no2 + ''),
2024-07-31 13:47:40 +08:00
//是否考过了
isEnd: false,
2024-01-31 14:35:16 +08:00
}
2024-07-16 15:02:36 +08:00
this.projectsObj[no2*1] = currentProject
2024-01-31 14:35:16 +08:00
this.projectsCenterObj[txt2] = currentProject
2024-07-10 19:39:13 +08:00
this.projects.push(currentProject);
2024-05-15 16:22:48 +08:00
}
this.systemparmArr.push({
2024-07-02 11:10:33 +08:00
'NO1': no1 * 1,
'NO2': no2 * 1,
'NO3': no3 * 1,
'TXT1': decodeURIComponent(systemParm.txt1),
'TXT2': decodeURIComponent(systemParm.txt2),
'TXT3': decodeURIComponent(systemParm.txt3),
2024-05-15 16:22:48 +08:00
})
})
const projects = this.projects;
2024-07-11 16:16:43 +08:00
if (!projects.length) {
Prompt.showToast({
2024-07-16 15:02:36 +08:00
message: '读取数据库信息失败,请重新联网更新!',
2024-07-11 16:16:43 +08:00
duration: 8000
});
router.back();
}
2024-05-15 16:22:48 +08:00
}
2024-01-05 11:11:15 +08:00
// 获取场地设备信息
2024-05-15 16:22:48 +08:00
async initCDSBInfo() {
2024-01-05 11:11:15 +08:00
const cdsbParams = await getSyncData('MA_CDSBINFO')
//@ts-ignore
2024-05-15 16:22:48 +08:00
cdsbParams.forEach((cdsb) => {
2024-01-05 11:11:15 +08:00
const key = decodeURI(cdsb.itemsno);
const newKey = key.split('~').join('_')
2024-01-31 14:35:16 +08:00
this.cdsbInfoObj[newKey] = {
2024-05-15 16:22:48 +08:00
kdid: cdsb.kdid,
sbbh: cdsb.sbbh,
sbbm: cdsb.sbbm,
itemsno: key,
modelKey: newKey,
2024-01-31 14:35:16 +08:00
//@ts-ignore
2024-05-15 16:22:48 +08:00
xmdm: key.split('~')[0] * 1,
xmxh: key.split('~')[1],
2024-01-05 11:11:15 +08:00
}
})
}
// 评判相关初始化
2024-05-15 16:22:48 +08:00
async initJudge() {
const judge = new Judge(this);
await judge.onJudgeFn(async (judgeData) => {
2024-01-05 11:11:15 +08:00
const {xmmcStr,carztStr,kfArr} = judgeData;
this.xmmcStr = xmmcStr;
this.carztStr = carztStr;
this.kfArr = kfArr;
});
return judge
}
2024-01-31 14:42:14 +08:00
2024-01-31 14:35:16 +08:00
// 断点续考判断
2024-05-15 16:22:48 +08:00
async goDdxkItems() {
const judgeConfigObj = this.judgeConfigObj
2024-07-10 19:39:13 +08:00
2024-07-31 13:47:40 +08:00
if (judgeConfigObj['432'] != 0) {
//断点续考判断
let currentParams: any = router.getParams();
const examItems: string = currentParams?.examItems;
// 2024-01-03 16:29:26;0;20300,;2,4^2,4;null;
if (examItems !== '' && examItems !== undefined) {
console.info('surenjun examItems=>', JSON.stringify(examItems))
const examItemsArrs = examItems.split(';');
const startTime = examItemsArrs[0]
const ddxkKsxmArr = examItemsArrs[2]?.split(',').filter(item => item) || []
const ddxkKfArr = examItemsArrs[3]?.split('^').filter(item => item) || []
if (judgeConfigObj['432'] == 2) {
//TODO 带项目带里程
if (ddxkKsxmArr?.length) {
//断点续考
ddxkKsxmArr.forEach(xmdm => {
const projectCode = this.projectsCenterObj[xmdm].projectCode
if(this.projectsObj[projectCode]){
this.projectsObj[projectCode].type = '3'
}
})
}
}
//扣分续考
2024-05-15 16:22:48 +08:00
ddxkKfArr.forEach((kf) => {
const [xmdm, kfdm] = kf.split(',')
2024-01-31 14:35:16 +08:00
const currentKf = this.markRuleListObj[`${xmdm}_${kfdm}`]
2024-07-31 13:47:40 +08:00
const currentProject = this.projectsObj[xmdm] || { name: '通用评判' }
if (this.projectsObj[xmdm]) {
this.projectsObj[xmdm].type = '4'
}
2024-01-31 14:35:16 +08:00
this.kfArr.push({
//扣分项目名称
2024-05-15 16:22:48 +08:00
xmmcStr: currentProject.name,
2024-01-31 14:35:16 +08:00
//@ts-ignore
xmdm,
2024-05-15 16:22:48 +08:00
desc: currentKf.markshow,
score: currentKf.markreal,
markcatalog: currentKf.markcatalog,
markserial: currentKf.markserial,
kfxh: currentKf.kfxh
2024-01-31 14:35:16 +08:00
})
2024-05-15 16:22:48 +08:00
this.totalScore += currentKf.markreal * 1;
2024-01-31 14:35:16 +08:00
})
this.ddxkKsxmArr = ddxkKsxmArr
this.ddxkKfArr = ddxkKfArr
this.ddxkTime = Date.parse(startTime);
2024-07-31 13:47:40 +08:00
this.isDdxk = true
2024-01-31 14:35:16 +08:00
}
}
2024-07-31 13:47:40 +08:00
2024-01-31 14:35:16 +08:00
}
2024-01-05 11:11:15 +08:00
2024-05-15 16:22:48 +08:00
// 初始化mapPoint表
2024-07-02 11:10:33 +08:00
async initMapPoint() {
2024-05-15 16:22:48 +08:00
const pointParams = await getSyncData('MA_MAP_POINT')
//@ts-ignore
2024-07-02 11:10:33 +08:00
pointParams.forEach(point => {
const {
point_no,
gps_e,
gps_n,
point_no_f,
point_type,
road_code,
gps_e_Location,
gps_n_Location,
f_gps_e,
f_gps_n,
passed
} = point;
2024-05-15 16:22:48 +08:00
this.mapPointArr.push({
2024-07-02 11:10:33 +08:00
point_no: point_no * 1,
gps_e: gps_e * 1,
gps_n: gps_n * 1,
point_no_f: point_no_f * 1,
point_type: point_type * 1,
2024-05-15 16:22:48 +08:00
road_code,
2024-07-02 11:10:33 +08:00
gps_e_Location: (gps_e_Location || 0) * 1,
gps_n_Location: (gps_n_Location || 0) * 1,
f_gps_e: f_gps_e * 1,
f_gps_n: f_gps_n * 1,
passed: passed * 1
2024-05-15 16:22:48 +08:00
})
})
}
// 初始化mapPointItem表
2024-07-02 11:10:33 +08:00
async initMapPointItem() {
2024-05-15 16:22:48 +08:00
const pointItemPoints = await getSyncData('MA_MAP_POINT_ITEM');
//@ts-ignore
pointItemPoints.forEach(itemPoint => {
const {point_no,itemno,itemno1,subname} = itemPoint
this.mapPointItemArr.push({
2024-07-02 11:10:33 +08:00
point_no: point_no * 1,
itemno: itemno * 1,
itemno1: itemno1 * 1,
subname
2024-05-15 16:22:48 +08:00
})
})
}
// 初始化本地systemparam表、markrule表
2024-07-02 11:10:33 +08:00
async initTrajectoryParam(trajectoryPath: string) {
2024-06-18 16:44:24 +08:00
const {isTrajectoryOpen} = judgeConfig
2024-05-15 16:22:48 +08:00
//轨迹回放读取 systemparam表、markrule表
2024-07-02 11:10:33 +08:00
const fileUtil = new FileUtil(this.context);
2024-05-15 16:22:48 +08:00
const folderPath = await fileUtil.initFolder(trajectoryPath);
const str = await fileUtil.readFile(folderPath);
const strArr = str.split('\n');
2024-07-02 11:10:33 +08:00
const [initData, beginData] = [strArr[0], strArr[1]];
2024-05-15 16:22:48 +08:00
const initDataObj = JSON.parse(initData)
2024-07-31 13:47:40 +08:00
const beginDataObj = JSON.parse(beginData)
2024-07-10 19:39:13 +08:00
// initDataObj.systemparm =
2024-06-18 16:44:24 +08:00
const examSubject = globalThis.carInfo.examSubject;
2024-07-02 11:10:33 +08:00
this.examSubject = isTrajectoryOpen ? (initDataObj.kskm * 1) : examSubject;
2024-06-18 16:44:24 +08:00
globalThis.carInfo.examSubject = this.examSubject
2024-07-31 13:47:40 +08:00
this.singlePlay = beginDataObj.exam == 0;
globalThis.singlePlay = beginDataObj.exam == 0;
await this.initSystemParam(initDataObj.systemparm)
2024-07-02 10:02:22 +08:00
await this.initMarkRules(initDataObj.mark);
2024-06-18 16:44:24 +08:00
await this.initSysset(initDataObj.sysset);
2024-05-15 16:22:48 +08:00
}
2024-07-31 13:47:40 +08:00
// 上传考试里程
async uploadMileage(){
if(!globalThis.singlePlay){
const {lsh,startExamTime:kskssj,jl:kslc} = this
const { carId ,examinationRoomId} = globalThis.carInfo;
await uploadExamMileage({
carId,examinationRoomId,
lsh,kskssj,kslc
})
console.info('surenjun 考试里程上传成功')
}
}
2024-01-05 11:11:15 +08:00
build() {
Column() {
Row() {
2024-05-15 16:22:48 +08:00
Row() {
Image($rawfile('judge/signal_logoS.png')).width(120)
Text(this.time).fontColor('#CCB48F').fontSize(32).padding({ left: 10, right: 5 })
2024-07-31 13:47:40 +08:00
Image($rawfile(this.isDwztRight ? 'judge/xh_green.png' : 'judge/xh_red.png')).width(50)
2024-07-02 11:10:33 +08:00
}.padding({ left: 20 })
2024-07-31 13:47:40 +08:00
2024-05-15 16:22:48 +08:00
Row() {
Text(`当前项目:${this.xmmcStr || '无'} `).fontColor('#E5CCA1').fontSize(32)
2024-01-05 11:11:15 +08:00
}
}
2024-05-15 16:22:48 +08:00
.width('100%')
.height('96')
.backgroundColor('#001A33')
.padding({ left: 15, right: 15 })
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(VerticalAlign.Center)
2024-01-05 11:11:15 +08:00
2024-05-15 16:22:48 +08:00
Row() {
Row() {
Column() {
Row() {
Column() {
Row() {
2024-01-05 11:11:15 +08:00
Text('考生姓名:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
Text(this.name).fontColor('#FFF').fontSize(this.FONTSIZE)
2024-05-15 16:22:48 +08:00
}.margin({ bottom: 10 })
Row() {
2024-01-05 11:11:15 +08:00
Text('开始时间:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
Text(this.startTime).fontColor('#FFF').fontSize(this.FONTSIZE)
2024-05-15 16:22:48 +08:00
}.margin({ bottom: 10 })
2024-07-02 11:10:33 +08:00
if (this.examSubject == 3) {
2024-05-15 16:22:48 +08:00
Row() {
Text('考试路线:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
2024-07-05 09:34:03 +08:00
Text(`线路${this.wayno}`).fontColor('#FFAD33').fontSize(this.FONTSIZE)
2024-05-15 16:22:48 +08:00
}
2024-01-05 11:11:15 +08:00
}
2024-05-15 16:22:48 +08:00
2024-01-05 11:11:15 +08:00
}.width('45%').alignItems(HorizontalAlign.Start)
2024-05-15 16:22:48 +08:00
Column() {
Row() {
2024-01-05 11:11:15 +08:00
Text('身份证号:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
Text(this.idCard).fontColor('#FFF').fontSize(this.FONTSIZE)
2024-05-15 16:22:48 +08:00
}.margin({ bottom: 10 })
Row() {
2024-01-05 11:11:15 +08:00
Text('考试用时:').fontColor('#E5CCA1').fontSize(this.FONTSIZE)
Text(formatTime(this.examTime)).fontColor('#FFF').fontSize(this.FONTSIZE)
2024-05-15 16:22:48 +08:00
}.margin({ bottom: 10 })
2024-07-02 11:10:33 +08:00
if (this.examSubject == 3) {
2024-05-15 16:22:48 +08:00
Row() {
2024-07-02 11:10:33 +08:00
if (this.judgeConfigObj['375'] == '0') {
Text(`应行驶:${this.examMileage}m`)
.fontColor('#E5CCA1')
.fontSize(this.FONTSIZE)
.padding({ right: 20 })
2024-05-15 16:22:48 +08:00
}
Text(`已行驶:${this.jl}m`).fontColor('#FFAD33').fontSize(this.FONTSIZE)
}
2024-01-05 11:11:15 +08:00
}
2024-05-15 16:22:48 +08:00
2024-01-05 11:11:15 +08:00
}.alignItems(HorizontalAlign.Start)
2024-05-15 16:22:48 +08:00
2024-01-05 11:11:15 +08:00
}.width('100%')
2024-05-15 16:22:48 +08:00
Column() {
2024-07-02 11:10:33 +08:00
Row() {
2024-05-15 16:22:48 +08:00
Text(this.carztStr).fontColor('#FFA500').fontSize(this.FONTSIZE)
2024-07-31 13:47:40 +08:00
if (this.judgeConfigObj['342'] == 0) {
Text(`${this.dw}挡`).fontColor('#FFA500').fontSize(this.FONTSIZE).padding({ left: 15, right: 15 })
Text(`${this.sd}km/h`).fontColor('#FFA500').fontSize(this.FONTSIZE)
}
2024-05-15 16:22:48 +08:00
}.height(40)
2024-07-02 11:10:33 +08:00
2024-05-15 16:22:48 +08:00
Row() {
Flex({ direction: FlexDirection.Column }) {
2024-07-02 11:10:33 +08:00
if (this.kfArr.length) {
2024-07-31 13:47:40 +08:00
List({ scroller: this.kfArrScroller }) {
2024-07-02 10:02:22 +08:00
ForEach(this.kfArr, (item) => {
ListItem() {
Column() {
Row() {
Text(item.xmmcStr).fontSize(this.BIGFONTSIZE).fontColor('#FFF')
Text(`${item.score}分`).fontSize(this.BIGFONTSIZE).fontColor('#FFF')
}
.width('100%')
.backgroundColor('#38260B')
.justifyContent(FlexAlign.SpaceBetween)
.padding({ top: 12, bottom: 12, left: 8, right: 5 })
2024-07-10 19:39:13 +08:00
Text(item.desc + `(${item.markcatalog})`)
2024-07-02 10:02:22 +08:00
.fontSize(this.BIGFONTSIZE)
.fontColor('#E5CBA1')
.margin({ top: 10, bottom: 8, left: 5, right: 5 })
}.margin({ top: 15 }).alignItems(HorizontalAlign.Start)
2024-07-02 11:10:33 +08:00
}.margin({ bottom: 25 })
2024-07-02 10:02:22 +08:00
})
2024-07-02 11:10:33 +08:00
}.padding({ left: 15, right: 15, top: 30, bottom: 5 })
} else {
2024-07-02 10:02:22 +08:00
Column() {
Row() {
Text('暂无扣分项').fontSize(this.BIGFONTSIZE).fontColor('#FFF')
}
.width('100%')
.backgroundColor('#38260B')
.justifyContent(FlexAlign.SpaceBetween)
.padding({ top: 12, bottom: 12, left: 8, right: 3 })
2024-07-02 11:10:33 +08:00
}.margin({ top: 35 }).padding({ left: 20, right: 20 }).alignItems(HorizontalAlign.Start)
2024-07-02 10:02:22 +08:00
}
2024-05-15 16:22:48 +08:00
}
2024-07-02 11:10:33 +08:00
.backgroundImage($rawfile('judge/score_bg.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.width(514)
.height(618)
.padding({ top: 18, bottom: 15, left: 13, right: 14 })
2024-05-15 16:22:48 +08:00
//科目二
2024-07-02 11:10:33 +08:00
if (this.examSubject == 2) {
Flex({ wrap: FlexWrap.Wrap, direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) {
List({}) {
ForEach(chunkArr(this.projects, 2), (item) => {
ListItem() {
Row() {
Row() {
2024-01-05 11:11:15 +08:00
//#FF7566 #00FFD5 #E6DECF
2024-05-15 16:22:48 +08:00
// Text(this.projectsObj[item[0].projectCode])
2024-07-02 11:10:33 +08:00
Text(item[0].abbreviation)
.fontSize(item[0].abbreviation.length > 5 ? 28 : 32)
.fontColor(this.getProjectColor(this.projectsObj[item[0].projectCode].type))
}
.backgroundImage($rawfile('judge/project_item.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.width('48.5%')
.height(115)
.margin({ bottom: 5 })
.justifyContent(FlexAlign.Center)
if (item[1]) {
Row() {
2024-05-15 16:22:48 +08:00
//#FF7566 #00FFD5 #E6DECF
2024-07-02 11:10:33 +08:00
Text(item[1].abbreviation)
.fontSize(item[1].abbreviation.length > 5 ? 28 : 32)
.fontColor(this.getProjectColor(this.projectsObj[item[1].projectCode].type))
}
.backgroundImage($rawfile('judge/project_item.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.width('48.5%')
.height(115)
.margin({ left: 5, bottom: 5 })
.justifyContent(FlexAlign.Center)
2024-05-15 16:22:48 +08:00
}
2024-01-05 11:11:15 +08:00
}
}
2024-05-15 16:22:48 +08:00
});
}
2024-07-02 11:10:33 +08:00
}
.backgroundImage($rawfile('judge/project_bg.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.width('57%')
.height('100%')
.padding(30)
.margin({ right: 10 })
2024-05-15 16:22:48 +08:00
}
//科目三
2024-07-02 11:10:33 +08:00
if (this.examSubject == 3) {
Column() {
Flex({
wrap: FlexWrap.Wrap,
direction: FlexDirection.Row,
justifyContent: FlexAlign.SpaceBetween
}) {
List({}) {
ForEach(this.projects, (project) => {
ListItem() {
2024-07-31 13:47:40 +08:00
Text(project.name) {
}
2024-07-02 11:10:33 +08:00
.fontColor(this.getProjectColor(this.projectsObj[project.projectCode].type))
2024-07-31 13:47:40 +08:00
.margin({ bottom: 3 })
.fontSize(22)
}.margin({ bottom: 3 })
2024-07-02 11:10:33 +08:00
})
}.lanes(2).margin({ left: 25 })
}
.width('100%')
2024-07-31 13:47:40 +08:00
.height('57%')
2024-07-02 11:10:33 +08:00
.backgroundImage($rawfile('judge/project_km3_bg.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.padding(30)
.margin({ right: 5 })
2024-07-10 19:39:13 +08:00
if (this.projects.length) {
Flex({
wrap: FlexWrap.Wrap,
direction: FlexDirection.Row,
justifyContent: FlexAlign.SpaceAround
}) {
List() {
ForEach(this.artSubject3Projects, (item, index) => {
ListItem() {
2024-05-15 16:22:48 +08:00
}
2024-07-10 19:39:13 +08:00
.backgroundImage(
$rawfile(
`judge/km3/${this.getIsExitManualProject(index) ? (this.getIsEndManualProject(index)) : (item + '_gray')}.png`
), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.width(174)
2024-07-31 13:47:40 +08:00
.height(118 * 0.95)
.margin({ bottom: 8 })
2024-07-10 19:39:13 +08:00
.onClick(() => {
this.setManualProjectFn(index)
})
2024-05-15 16:22:48 +08:00
})
2024-07-31 13:47:40 +08:00
}.lanes(3).margin({ left: 5, top: 12 })
2024-07-10 19:39:13 +08:00
}
2024-05-15 16:22:48 +08:00
}
2024-07-10 19:39:13 +08:00
2024-07-02 11:10:33 +08:00
}
.backgroundImage($rawfile('judge/project_bg.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.width(660)
.height(640)
.padding(44)
.margin({ right: 10 })
2024-05-15 16:22:48 +08:00
}
}.margin({ top: 15 }).height('80%').justifyContent(FlexAlign.SpaceBetween)
}.width('100%').height('100%').alignItems(HorizontalAlign.Start).margin({ top: 10 })
2024-01-05 11:11:15 +08:00
}.height('100%').alignItems(HorizontalAlign.Start)
}.width('75%').height('100%')
2024-05-15 16:22:48 +08:00
Column() {
Column() {
Row() {
2024-07-31 13:47:40 +08:00
Text(this.totalScore <= 0 ? '0' : this.totalScore + '').fontColor('#FFEECC').fontSize(55)
2024-05-15 16:22:48 +08:00
Text('分').fontColor('#FFEECC').fontSize(30).padding({ top: 5 })
}
.width(334)
.height(120)
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.border({ width: 5, color: '#4D4136', radius: 30 })
.onClick(() => {
this.signDisplayComVisible = true
})
Row() {
Image(this.kszp).width('85%').height('85%')
}
.width(226)
.height(312)
.backgroundImage($rawfile('judge/photo_bg.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
2024-07-02 11:10:33 +08:00
.margin({ top: 30, bottom: 15 })
2024-05-15 16:22:48 +08:00
}
2024-07-02 11:10:33 +08:00
Column() {
if (this.examSubject == 3) {
Row() {
Row() {
}
.width(60)
.height(60)
.backgroundImage($rawfile('judge/manual_judge.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
Text('人工评判').fontColor('#FFF').fontSize(32).padding({ right: 12 })
}
.width(334)
.height(110)
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
.backgroundImage($rawfile('judge/button_nor.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.margin({ bottom: 10 })
.onClick(() => {
if (this.judgeConfigObj['342'] == 0) {
2024-05-15 16:22:48 +08:00
this.isDeductedPopShow = true
2024-07-02 11:10:33 +08:00
} else {
2024-07-02 10:26:42 +08:00
Prompt.showToast({
2024-05-15 16:22:48 +08:00
message: '平台配置不允许人工评判!',
duration: 4000
});
}
})
}
2024-07-02 11:10:33 +08:00
Row() {
Row() {
}
.width(60)
.height(60)
.backgroundImage($rawfile('judge/phone.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
Text('呼叫请求').fontColor('#FFF').fontSize(32).padding({ right: 12 })
}
.width(334)
.height(110)
.justifyContent(FlexAlign.Center)
.alignItems(VerticalAlign.Center)
2024-05-15 16:22:48 +08:00
.backgroundImage($rawfile('judge/button_nor.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
2024-07-02 11:10:33 +08:00
.margin({ bottom: 10 })
2024-05-15 16:22:48 +08:00
2024-07-02 11:10:33 +08:00
Row() {
}
2024-05-15 16:22:48 +08:00
.width(334)
.height(100)
.backgroundImage($rawfile('judge/anniu_nor.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '100%', height: '100%' })
.onClick(() => {
2024-07-02 11:10:33 +08:00
if (this.judgeConfigObj['353'] == '0') {
2024-05-15 16:22:48 +08:00
this.endPopupVisible = true
2024-07-02 11:10:33 +08:00
} else {
2024-07-02 10:26:42 +08:00
Prompt.showToast({
2024-05-15 16:22:48 +08:00
message: '车上不允许手动结束考试!',
duration: 4000
});
}
})
2024-07-02 11:10:33 +08:00
}.margin({ bottom: 30 })
2024-05-15 16:22:48 +08:00
}
.width('25%')
.height('100%')
.justifyContent(FlexAlign.SpaceBetween)
.alignItems(HorizontalAlign.Center)
.margin({ bottom: 20 })
}.height('90%').justifyContent(FlexAlign.Start).padding({ top: 37, left: 60, bottom: 35, right: 60 })
2024-01-05 11:11:15 +08:00
//结束考试弹窗
2024-05-15 16:22:48 +08:00
if (this.endPopupVisible) {
2024-01-05 11:11:15 +08:00
EndPoPup({
2024-05-15 16:22:48 +08:00
title: '确定结束考试吗?',
cancelFn: () => {
2024-01-05 11:11:15 +08:00
this.endPopupVisible = false;
},
2024-05-15 16:22:48 +08:00
confirmFn: async () => {
2024-07-31 13:47:40 +08:00
if (this.judgeConfigObj['344'] == 1) {
Prompt.showToast({
message: '考试未结束,不允许手动退出!',
duration: 4000
});
return
}
2024-01-05 11:11:15 +08:00
this.endPopupVisible = false;
2024-01-31 14:35:16 +08:00
this.loadingPopupVisible = true
2024-01-05 11:11:15 +08:00
clearInterval(this.timer);
clearInterval(globalThis.judgeTimer)
globalThis.windowClass.setWindowSystemBarEnable(['navigation'])
2024-07-31 13:47:40 +08:00
this.judge.checkExamIsEnd(true);
2024-01-05 11:11:15 +08:00
}
})
}
2024-05-15 16:22:48 +08:00
//loading 弹窗
if (this.loadingPopupVisible) {
2024-01-05 11:11:15 +08:00
LoadingPopup({
2024-05-15 16:22:48 +08:00
title: '正在生成考试记录,请稍后...',
2024-01-05 11:11:15 +08:00
})
}
2024-01-31 14:35:16 +08:00
2024-05-15 16:22:48 +08:00
if (this.signDisplayComVisible) {
2024-01-31 14:35:16 +08:00
Column() {
SignDisplayCom({
2024-05-15 16:22:48 +08:00
showBack: false,
2024-07-31 13:47:40 +08:00
scaleNum: 1.8,
msgStr: this.judge.plcStr || '',
2024-05-15 16:22:48 +08:00
}).margin({ top: 100 })
2024-07-02 11:10:33 +08:00
Row() {
}
2024-05-15 16:22:48 +08:00
.width(240)
.height(240)
.position({ x: '81%', y: 80 })
.backgroundImage($rawfile('judge/close.png'), ImageRepeat.NoRepeat)
.backgroundImageSize({ width: '33.33%', height: '33.33%' })
.onClick(() => {
this.signDisplayComVisible = false
})
}.width('100%').height('100%').position({ y: 0 }).backgroundColor('rgba(0,0,0,0.6)')
2024-01-31 14:35:16 +08:00
}
2024-05-15 16:22:48 +08:00
//科目三人工扣分弹窗
2024-07-10 19:39:13 +08:00
if (this.isDeductedPopShow && this.examSubject == 3) {
2024-05-15 16:22:48 +08:00
DeductedPopup({
2024-07-31 13:47:40 +08:00
defaultTabIndex: this.defaultTabIndex,
2024-07-02 11:10:33 +08:00
currentItems: Reflect.ownKeys(this.projectsObj).map(projectKey => {
2024-07-05 09:34:03 +08:00
//@ts-ignore
2024-05-15 16:22:48 +08:00
const project = this.projectsObj[projectKey]
2024-07-16 15:02:36 +08:00
return project.type == '2' ? project.projectCode : undefined
}).filter(project => project !== undefined),
2024-07-02 11:10:33 +08:00
markRules: this.manualMarkRules,
closePopup: () => {
2024-07-31 13:47:40 +08:00
this.isDeductedPopShow = false;
this.defaultTabIndex = 0;
2024-07-02 11:10:33 +08:00
},
confirmMark: async (itemno, serial) => {
2024-05-15 16:22:48 +08:00
const judge = this.judge
2024-07-02 11:10:33 +08:00
await judge.setJudgeMark(itemno, serial);
2024-05-15 16:22:48 +08:00
this.isDeductedPopShow = false
}
})
}
//科目三人工项目确认框
2024-07-10 19:39:13 +08:00
if (this.isAmplifyPopShow && this.examSubject == 3) {
2024-05-15 16:22:48 +08:00
AmplifyPopup({
2024-07-02 11:10:33 +08:00
amplifyImgIndex: this.amplifiedImgIndex,
confirmAmplify: async (amplify) => {
2024-05-15 16:22:48 +08:00
const judge = this.judge
2024-07-10 19:39:13 +08:00
await judge.setJudgeItem(amplify.projectCode, 1);
2024-05-15 16:22:48 +08:00
this.isAmplifyPopShow = false
},
2024-07-02 11:10:33 +08:00
closeAmplifyPop: () => {
2024-05-15 16:22:48 +08:00
this.isAmplifyPopShow = false
}
})
}
2024-01-05 11:11:15 +08:00
}
.height('100%').backgroundColor('#000').justifyContent(FlexAlign.Start)
}
2024-05-15 16:22:48 +08:00
getProjectColor(type: string) {
switch (type) {
case '1':
return '#E6DECF';
break;
case '2':
return '#FFAD33';
break;
case '3':
2024-07-10 19:39:13 +08:00
return '#ff109d0a';
2024-05-15 16:22:48 +08:00
break;
case '4':
return '#FF7566';
break;
default:
2024-07-10 19:39:13 +08:00
return '#E6DECF';
break;
}
}
//人工项目操作
async setManualProjectFn(index: number) {
const {
judgeConfigObj,
isManualProjectIn,
getIsExitManualProject,
artSubject3ProjectsCodesArr,
currentXmdm,
} = this;
const projectCode = artSubject3ProjectsCodesArr[index]
if (getIsExitManualProject(index)) {
// 正在进行的项目 取消项目
if (isManualProjectIn && projectCode === currentXmdm) {
await this.judge.setJudgeItem(currentXmdm, 2);
Prompt.showToast({
message: '项目取消',
duration: 2000
})
return
}
// 靠边停车时候可以触发
if (judgeConfigObj['343'] == 0) {
const xmmcStr = this.xmmcStr;
if (xmmcStr == '无' || xmmcStr == '') {
this.amplifiedImgIndex = index;
this.isAmplifyPopShow = true
} else {
if (index === 5) {
Prompt.showToast({
message: `${xmmcStr}未结束,不允许靠边停车`,
duration: 8000
});
}
}
} else {
this.amplifiedImgIndex = index;
this.isAmplifyPopShow = true
}
2024-01-05 11:11:15 +08:00
}
}
2024-01-31 14:35:16 +08:00
2024-05-15 16:22:48 +08:00
// 获取是否能人工进项目
2024-07-02 11:10:33 +08:00
getIsExitManualProject = (index: number) => {
2024-07-10 19:39:13 +08:00
const {
judgeConfigObj,
artSubject3ProjectsCodesArr,
projectsObj,
carztStr,
isManualProjectIn,
isProjectIn,
currentXmdm,
getProjectIsInRoad
} = this;
const projectCode = artSubject3ProjectsCodesArr[index];
const projectType = projectsObj[projectCode].type;
2024-07-16 15:02:36 +08:00
2024-07-10 19:39:13 +08:00
//不允许人工触发的项目列表,以","分隔
2024-05-15 16:22:48 +08:00
const unExitManualProjects = judgeConfigObj['332'].split(',') || [];
2024-07-10 19:39:13 +08:00
//直线行驶中不进其他考试项目(0-否 1-是)
const param348 = judgeConfigObj['348'] || '0',
//里程不够允许手工点靠边停车0-否 1-是)
param387 = judgeConfigObj['387'] || '0',
//里程不够不报靠边停车0-否+1-是+2-必考项目未完成且里程不够不报项目)
param319 = judgeConfigObj['319'] || '0',
//人工项目是否能取消 1:可取消;
param340 = judgeConfigObj['340'] || '0',
//307参数里设置的项目项目已经做过后续不能人工触发
param307 = (judgeConfigObj['307'] || '').split(',');
//非行驶状态(没有速度),人工项目不能触发(按钮灰色)
if (carztStr === '停车') {
2024-05-15 16:22:48 +08:00
return false
}
2024-07-10 19:39:13 +08:00
//车上是否能进行人工操作(0-能1-不能人工评判2-不能人工进项目3-都不能)
if (judgeConfigObj['342'] === '3' || judgeConfigObj['342'] === '2') {
return false
}
2024-07-16 17:32:25 +08:00
2024-07-10 19:39:13 +08:00
//不允许人工触发的项目列表
2024-07-02 11:10:33 +08:00
if (unExitManualProjects.includes(artSubject3ProjectsCodesArr[index])) {
2024-05-15 16:22:48 +08:00
return false
}
2024-07-10 19:39:13 +08:00
//项目进行中不能人工触发
2024-07-31 13:47:40 +08:00
if (isProjectIn) {
if (param340 == 1) {
if (isManualProjectIn && (currentXmdm == projectCode)) {
2024-07-16 17:32:25 +08:00
return true
2024-07-31 13:47:40 +08:00
} else {
2024-07-16 17:32:25 +08:00
return false
}
2024-07-11 16:16:43 +08:00
}
2024-07-16 17:32:25 +08:00
return false
2024-07-10 19:39:13 +08:00
}
//项目路段信息判断
2024-07-31 13:47:40 +08:00
if (!getProjectIsInRoad(projectCode + '')) {
2024-07-10 19:39:13 +08:00
return false
}
//@ts-ignore 直线行驶中不进其他考试项目(0-否 1-是)
2024-07-02 11:10:33 +08:00
if (param348 == '0' && projectsObj['9']?.type == 2) {
2024-05-15 16:22:48 +08:00
return index === 0 ? true : false
}
2024-07-10 19:39:13 +08:00
//项目已经做过,后续不能人工触发
if (param307.includes(projectCode) && (projectType == '3' || projectType == '4')) {
return false
}
//319不为0或者387不为1里程不够时靠边停车项目不能触发
if ((param387 != '1' || param319 != '0') && index === 5) {
const {examMileage,isRequiredProjectsEnd,jl} = this;
//里程是否达标 && 必考项目是否全完成
return jl >= Number(examMileage) && isRequiredProjectsEnd
2024-05-15 16:22:48 +08:00
}
return true
}
2024-07-10 19:39:13 +08:00
// 判断项目是否在当前路段号
2024-07-31 13:47:40 +08:00
getProjectIsInRoad = (projectCode: string,) => {
2024-07-10 19:39:13 +08:00
const {
judgeConfigObj,
2024-07-31 13:47:40 +08:00
lane:{ road, num, count }
2024-07-10 19:39:13 +08:00
} = this;
const projectRoads = {
//直线行驶
2024-07-16 15:02:36 +08:00
'3': (judgeConfigObj['514']?.split(',') || []),
2024-07-10 19:39:13 +08:00
//变更车道
2024-07-31 13:47:40 +08:00
'4': judgeConfigObj['515']?.split(',') || [],
2024-07-10 19:39:13 +08:00
//超车
2024-07-31 13:47:40 +08:00
'10': judgeConfigObj['516']?.split(',') || [],
2024-07-10 19:39:13 +08:00
//靠边停车
2024-07-31 13:47:40 +08:00
'11': judgeConfigObj['517']?.split(',') || [],
2024-07-10 19:39:13 +08:00
//会车
2024-07-31 13:47:40 +08:00
'9': judgeConfigObj['518']?.split(',') || [],
2024-07-10 19:39:13 +08:00
//掉头
2024-07-31 13:47:40 +08:00
'12': judgeConfigObj['519']?.split(',') || [],
2024-07-10 19:39:13 +08:00
};
//未测绘得道路上或者不在差分状态
2024-07-31 13:47:40 +08:00
if (road === '') {
2024-07-10 19:39:13 +08:00
return false
}
//设置了514-519参数只能在设置的路段触发对应项目
2024-07-31 13:47:40 +08:00
if (projectRoads[projectCode].includes(road)) {
2024-07-10 19:39:13 +08:00
//如果525为1则514-519设置的路段不能触发对应项目
2024-07-31 13:47:40 +08:00
if (judgeConfigObj['525'] == '1') {
2024-07-10 19:39:13 +08:00
return false
}
2024-07-31 13:47:40 +08:00
} else {
2024-07-10 19:39:13 +08:00
return false
}
//405参数为2是如果在最左侧车道超车项目不能触发;
2024-07-31 13:47:40 +08:00
if (projectCode == '10' &&
2024-07-11 16:16:43 +08:00
judgeConfigObj['402'] == '2' &&
(num === count) &&
num > 0
2024-07-31 13:47:40 +08:00
) {
2024-07-10 19:39:13 +08:00
return false
}
// 车道总数少于2条超车和变道不能触发
2024-07-31 13:47:40 +08:00
if (projectCode == '10' || projectCode == '4') {
if (count < 2) {
return false
}
2024-07-10 19:39:13 +08:00
}
return true
}
// 获取人工项目是否已做
getIsEndManualProject = (index: number) => {
const projectName = this.artSubject3Projects[index];
const projectCode = this.artSubject3ProjectsCodesArr[index];
const type = this.projectsObj[projectCode].type
if (type == '2') {
return projectName
}
return (type == '3' || type == '4') ? `${projectName}_red` : `${projectName}_green`;
}
2024-07-05 09:34:03 +08:00
scroller: Scroller = new Scroller()
//页面通用字体大小
2024-07-10 19:39:13 +08:00
@State wayno: number = 0
2024-07-05 09:34:03 +08:00
@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 = ''
2024-07-31 13:47:40 +08:00
@State startExamTime: string = ''
2024-07-05 09:34:03 +08:00
//科目类型
@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
2024-07-10 19:39:13 +08:00
markcatalog: string
2024-07-05 09:34:03 +08:00
}[] = []
@State name: string = ''
@State idCard: string = ''
2024-07-31 13:47:40 +08:00
@State singlePlay: boolean = false;
2024-07-05 09:34:03 +08:00
@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 = ''
2024-07-31 13:47:40 +08:00
@State ksxl: string = ''
2024-07-05 09:34:03 +08:00
@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[] = []
2024-07-10 19:39:13 +08:00
//手动项目是否在进行中
@State isManualProjectIn: boolean = false;
//项目是否进行中
@State isProjectIn: boolean = false;
//正在进行的项目代码
@State currentXmdm: string = ''
2024-07-31 13:47:40 +08:00
// 必考项目除靠边停车是否全部完成
2024-07-10 19:39:13 +08:00
@State isRequiredProjectsEnd: boolean = false;
2024-07-31 13:47:40 +08:00
// 考试项目是否全部完成
// @State isAllProjectsEnd: boolean = false;
2024-07-10 19:39:13 +08:00
@State lane: LANE = { road: '', num: 0, count: 0 }
2024-07-31 13:47:40 +08:00
@State roadData: Object = {};
2024-07-16 15:02:36 +08:00
//定位差分状态时候正常
2024-07-31 13:47:40 +08:00
@State isDwztRight: boolean = false;
@State defaultTabIndex: number = 0;
2024-07-05 09:34:03 +08:00
private context = getContext(this) as common.UIAbilityContext;
2024-07-31 13:47:40 +08:00
public kfArrScroller: Scroller = new Scroller()
//档位
@State dw: string = ''
//速度
@State sd: string = ''
@State mileageTimer: number = 0;
2024-01-05 11:11:15 +08:00
}