fix: 优化了部分代码

This commit is contained in:
wangzhongjie 2025-02-19 15:22:19 +08:00
parent 05664bd38f
commit 76186f4e97

View File

@ -30,7 +30,7 @@ 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';
import { CarInfoType } from '../model'; import { CarInfoType, CommonType, KfdmType } from '../model';
@Entry @Entry
@Component @Component
@ -56,18 +56,13 @@ struct Index {
@State startHourTime: string = '' @State startHourTime: string = ''
@State startExamTime: string = '' @State startExamTime: string = ''
//科目类型 //科目类型
@State examSubject: 2 | 3 = 3; @State examSubject: string = '3';
@State ddxkTime: number = 0; @State ddxkTime: number = 0;
@State ddxkKsxmArr: string[] = [] @State ddxkKsxmArr: string[] = []
@State ddxkKfArr: string[] = [] @State ddxkKfArr: string[] = []
@State xmmcStr: string = '' @State xmmcStr: string = ''
@State carztStr: string = '' @State carztStr: string = ''
@State kfArr: { @State kfArr: KfdmType[] = []
xmmcStr?: string,
score: string,
desc: string
markcatalog: string
}[] = []
@State name: string = '' @State name: string = ''
@State idCard: string = '' @State idCard: string = ''
@State singlePlay: boolean = false; @State singlePlay: boolean = false;
@ -80,8 +75,8 @@ struct Index {
@State cdsbInfoObj: CDSBInfo = {} @State cdsbInfoObj: CDSBInfo = {}
@State itemInfoObj: CDSBInfo = {} @State itemInfoObj: CDSBInfo = {}
@State timer: number = 0 @State timer: number = 0
@State judgeConfig: { [k: string]: string }[] = [] @State judgeConfig: CommonType[] = []
@State judgeConfigObj: { [k: string]: any } = defaultJudgeConfigObj @State judgeConfigObj: object = defaultJudgeConfigObj
//流水号 //流水号
@State lsh: string = '' @State lsh: string = ''
@State kszp: string = '' @State kszp: string = ''
@ -123,7 +118,6 @@ struct Index {
@State isRequiredProjectsEnd: boolean = false; @State isRequiredProjectsEnd: boolean = false;
// @State isAllProjectsEnd: boolean = false; // @State isAllProjectsEnd: boolean = false;
@State lane: LANE = { road: '', num: 0, count: 0 } @State lane: LANE = { road: '', num: 0, count: 0 }
@State roadData: Object = {};
//定位差分状态时候正常 //定位差分状态时候正常
@State isDwztRight: boolean = true; @State isDwztRight: boolean = true;
@State defaultTabIndex: number = 0; @State defaultTabIndex: number = 0;
@ -173,13 +167,13 @@ struct Index {
//初始化相关数据库表 //初始化相关数据库表
async initDb() { async initDb() {
this.examSubject = this.carInfo.examSubject; this.examSubject = this.carInfo.examSubject;
const { isTrajectoryOpen, trajectoryPath } = judgeConfig // const { isTrajectoryOpen, trajectoryPath } = judgeConfig
await this.initStudent(); await this.initStudent();
await this.initCar(); await this.initCar();
//是否开启轨迹回放模式 //是否开启轨迹回放模式
if (isTrajectoryOpen) { if (judgeConfig.isTrajectoryOpen) {
this.initTrajectoryParam(trajectoryPath) this.initTrajectoryParam(judgeConfig.trajectoryPath)
} else { } else {
await this.initSystemParam() await this.initSystemParam()
await this.initMarkRules(); await this.initMarkRules();
@ -189,7 +183,7 @@ struct Index {
await this.initItemInfo() await this.initItemInfo()
// 科目三新增读取表数据 // 科目三新增读取表数据
if (examSubject == 3) { if (this.examSubject == '3') {
await this.initMapPoint() await this.initMapPoint()
await this.initMapPointItem() await this.initMapPointItem()
//定时上传考试里程 //定时上传考试里程