2024-07-05 09:34:03 +08:00
|
|
|
|
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';
|
2024-07-31 13:47:40 +08:00
|
|
|
|
import { getCurrentTime } from '../../../common/utils/tools';
|
|
|
|
|
|
import { MarkRule, SYSSET } from '../../judgeSDK/api/judgeSDK.d';
|
|
|
|
|
|
import { uploadExamProgressData, writeObjectOut } from '../../../api/judge';
|
|
|
|
|
|
import JudgeTask from '../../judgeSDK/utils/judgeTask';
|
|
|
|
|
|
import FilePhoto from '../../judgeSDK/utils/filePhoto';
|
2024-07-05 09:34:03 +08:00
|
|
|
|
|
|
|
|
|
|
interface SEL {
|
|
|
|
|
|
fontColor: string
|
|
|
|
|
|
bgColor: string
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-31 13:47:40 +08:00
|
|
|
|
//考前模拟人工扣分
|
2024-07-05 09:34:03 +08:00
|
|
|
|
@Component
|
|
|
|
|
|
export default struct DeductedPopup {
|
|
|
|
|
|
private context = getContext(this) as common.UIAbilityContext;
|
2024-07-31 13:47:40 +08:00
|
|
|
|
private judgeTask: JudgeTask
|
|
|
|
|
|
private filePhoto: FilePhoto
|
2024-07-05 09:34:03 +08:00
|
|
|
|
private avPlayer
|
|
|
|
|
|
@State name: string = ''
|
|
|
|
|
|
@State idCard: string = ''
|
|
|
|
|
|
@State lsh: string = ''
|
|
|
|
|
|
@State kszp: string = ''
|
|
|
|
|
|
@State ksdd: string = ''
|
|
|
|
|
|
@State kssycs: string = ''
|
|
|
|
|
|
@State kslx: string = ''
|
2024-07-31 13:47:40 +08:00
|
|
|
|
@State ksxl: string = ''
|
|
|
|
|
|
@State score: number = 100;
|
|
|
|
|
|
@State judgeConfigObj: { [k: string]: any } = {}
|
2024-07-05 09:34:03 +08:00
|
|
|
|
@State kfdmArr: {
|
|
|
|
|
|
xmdm: number,
|
|
|
|
|
|
kfdm: string,
|
2024-07-31 13:47:40 +08:00
|
|
|
|
markreal: number,
|
|
|
|
|
|
markcatalog: string
|
2024-09-03 19:28:07 +08:00
|
|
|
|
score:number
|
2024-07-05 09:34:03 +08:00
|
|
|
|
}[] = []
|
|
|
|
|
|
//开始考试前判绕车一周评判是否开启
|
|
|
|
|
|
@State isOpen: boolean = false
|
|
|
|
|
|
//监管序列号
|
|
|
|
|
|
@State serialNumber: number = 0;
|
|
|
|
|
|
@State examSubject: number = 2;
|
|
|
|
|
|
@State markRuleListObj: MarkRule = {}
|
2024-12-05 18:31:06 +08:00
|
|
|
|
@State fontSize: number = 28
|
2024-07-05 09:34:03 +08:00
|
|
|
|
@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
|
2025-02-13 15:30:48 +08:00
|
|
|
|
@State carInfo: object = {}
|
|
|
|
|
|
@State singlePlay: boolean = false
|
2024-07-05 09:34:03 +08:00
|
|
|
|
private closePopup: Function = () => {
|
|
|
|
|
|
}
|
|
|
|
|
|
private confirmMark: Function = (itemno: number, serial: string) => {
|
|
|
|
|
|
}
|
2024-07-31 13:47:40 +08:00
|
|
|
|
private endLoading: Function = () => {
|
|
|
|
|
|
}
|
2024-07-05 09:34:03 +08:00
|
|
|
|
@State selectedLineStyle: SEL = {
|
|
|
|
|
|
fontColor: '#FFF',
|
|
|
|
|
|
bgColor: '#B36E00'
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-31 13:47:40 +08:00
|
|
|
|
async aboutToAppear() {
|
2025-02-13 15:30:48 +08:00
|
|
|
|
this.carInfo=AppStorage.get('carInfo')
|
|
|
|
|
|
this.singlePlay=AppStorage.get('singlePlay')
|
2024-07-31 13:47:40 +08:00
|
|
|
|
this.avPlayer = new VoiceAnnounce();
|
|
|
|
|
|
this.judgeTask = new JudgeTask();
|
|
|
|
|
|
const mediaTest = new FilePhoto(this.context);
|
|
|
|
|
|
this.filePhoto = mediaTest
|
2024-07-05 09:34:03 +08:00
|
|
|
|
//上车准备
|
|
|
|
|
|
// this.universalMarkRules = this.markRules.filter(item => this.currentItems.includes(item.itemno+''))
|
|
|
|
|
|
const {isTrajectoryOpen} = judgeConfig;
|
|
|
|
|
|
if (isTrajectoryOpen) {
|
2024-07-31 13:47:40 +08:00
|
|
|
|
await this.initDb()
|
2024-07-05 09:34:03 +08:00
|
|
|
|
} else {
|
2024-07-31 13:47:40 +08:00
|
|
|
|
await this.initSysset()
|
|
|
|
|
|
await this.initMarkRules()
|
|
|
|
|
|
await this.initStudent()
|
2024-07-05 09:34:03 +08:00
|
|
|
|
}
|
2024-07-31 13:47:40 +08:00
|
|
|
|
|
|
|
|
|
|
// const {judgeTask} = this;
|
|
|
|
|
|
// judgeTask.addTask(async () => {
|
|
|
|
|
|
// await this.beginProject();
|
|
|
|
|
|
// }, { isDelay: true })
|
|
|
|
|
|
// judgeTask.addTask(async () => {
|
|
|
|
|
|
// await this.uploadProgressPhoto();
|
|
|
|
|
|
// }, { isDelay: true })
|
2024-07-05 09:34:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//本地数据初始化
|
|
|
|
|
|
async initDb() {
|
|
|
|
|
|
const {isTrajectoryOpen,trajectoryPath} = judgeConfig
|
2025-02-13 15:30:48 +08:00
|
|
|
|
const examSubject = this.carInfo.examSubject;
|
2024-07-05 09:34:03 +08:00
|
|
|
|
//轨迹回放读取 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()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-31 13:47:40 +08:00
|
|
|
|
// 过程照片拍照
|
|
|
|
|
|
getPhoto = async (empty?: boolean) => {
|
|
|
|
|
|
//单机模式返回空照片
|
2025-02-13 15:30:48 +08:00
|
|
|
|
if (this.singlePlay) {
|
2024-07-31 13:47:40 +08:00
|
|
|
|
return ''
|
|
|
|
|
|
} else {
|
|
|
|
|
|
const {filePhoto} = this;
|
|
|
|
|
|
const photoBase64 = await filePhoto.getPhoto();
|
|
|
|
|
|
return photoBase64
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 扣分操作
|
|
|
|
|
|
async pointsDedute() {
|
|
|
|
|
|
const index = this.currentIndex ? this.currentUniversalPageIndex : this.currentPageIndex;
|
|
|
|
|
|
const mark = this.universalMarkRules[index * 7 + this.selectedLine];
|
|
|
|
|
|
const {judgeConfigObj,kssycs,avPlayer,judgeTask} = this;
|
2024-11-26 15:35:05 +08:00
|
|
|
|
this.kfdmArr.push({
|
|
|
|
|
|
xmdm: 1,
|
|
|
|
|
|
kfdm: mark.markserial,
|
|
|
|
|
|
markreal: mark.markreal,
|
|
|
|
|
|
markcatalog: mark.markcatalog ,
|
|
|
|
|
|
score:mark.score
|
|
|
|
|
|
})
|
2024-07-31 13:47:40 +08:00
|
|
|
|
const kfdmArr = this.kfdmArr
|
|
|
|
|
|
|
|
|
|
|
|
//计算总扣分
|
|
|
|
|
|
let score = kfdmArr.reduce((p, n) => {
|
|
|
|
|
|
p += n.markreal * 1
|
|
|
|
|
|
return p
|
|
|
|
|
|
}, 0);
|
|
|
|
|
|
this.score = score
|
|
|
|
|
|
|
|
|
|
|
|
this.confirmMark(this.kfdmArr.map((kf) => ({
|
|
|
|
|
|
xmdm: kf.xmdm,
|
|
|
|
|
|
kfdm: kf.kfdm,
|
|
|
|
|
|
})))
|
|
|
|
|
|
|
|
|
|
|
|
if (judgeConfigObj['418'] == '1' || judgeConfig.kfVoiceOpen) {
|
2024-09-03 19:28:07 +08:00
|
|
|
|
avPlayer.playAudio([`voice/${mark.markcatalog}.mp3`,`voice/mark_${Math.abs(mark.score)}.mp3`], false, () => {
|
2024-07-31 13:47:40 +08:00
|
|
|
|
this.closePopup(true)
|
|
|
|
|
|
});
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2024-09-03 19:28:07 +08:00
|
|
|
|
this.closePopup();
|
2024-07-31 13:47:40 +08:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if (score < 90) {
|
|
|
|
|
|
this.closePopup(true)
|
|
|
|
|
|
avPlayer.playAudio(['voice/exam_waiting.mp3', `voice/kfdesc.mp3`])
|
|
|
|
|
|
judgeTask.addTask(async () => {
|
|
|
|
|
|
//扣分
|
|
|
|
|
|
await this.kfFn();
|
|
|
|
|
|
}, { isDelay: true })
|
|
|
|
|
|
|
|
|
|
|
|
judgeTask.addTask(async () => {
|
|
|
|
|
|
//项目结束
|
|
|
|
|
|
await this.endProject();
|
|
|
|
|
|
}, { isDelay: true })
|
|
|
|
|
|
|
|
|
|
|
|
judgeTask.addTask(async () => {
|
|
|
|
|
|
//结束考试
|
|
|
|
|
|
await this.endFn()
|
|
|
|
|
|
}, { isDelay: true })
|
|
|
|
|
|
}
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
let voiceURL = score < 90 ? `voice/${kssycs == '1' ? 'exam_no_pass_finish' : 'exam_no_pass'}.mp3` : 'voice/exam_pass.mp3'
|
|
|
|
|
|
|
|
|
|
|
|
let kfScore = 0;
|
|
|
|
|
|
if (kfdmArr.length) {
|
|
|
|
|
|
kfdmArr.forEach((kf, index) => {
|
|
|
|
|
|
kfScore += Math.abs(Number(kf.markreal));
|
|
|
|
|
|
if (kfScore <= 100) {
|
|
|
|
|
|
judgeTask.addTask(() => {
|
|
|
|
|
|
if (index === kfdmArr.length - 1) {
|
|
|
|
|
|
avPlayer.playAudio([`voice/${kf.markcatalog}.mp3`, voiceURL], false, () => {
|
|
|
|
|
|
this.endLoading(true)
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
|
|
|
avPlayer.playAudio([`voice/${kf.markcatalog}.mp3`])
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.confirmMark(this.kfdmArr.map((kf) => ({
|
|
|
|
|
|
xmdm: kf.xmdm,
|
|
|
|
|
|
kfdm: kf.kfdm,
|
|
|
|
|
|
})))
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//项目开始
|
|
|
|
|
|
async beginProject() {
|
|
|
|
|
|
//项目开始 //过程照片 //扣分 //结束考试
|
2025-02-13 15:30:48 +08:00
|
|
|
|
const carInfo = this.carInfo;
|
2024-07-31 13:47:40 +08:00
|
|
|
|
const { examSubject,plateNo } = carInfo;
|
|
|
|
|
|
const {serialNumber,lsh,idCard,ksxl,kslx,ksdd} = this
|
|
|
|
|
|
const time = await getCurrentTime();
|
|
|
|
|
|
const beginData = {
|
|
|
|
|
|
xtlb: '17', jkxlh: serialNumber, jkid: '17C52',
|
|
|
|
|
|
drvexam: {
|
|
|
|
|
|
// 考试科目 身份证号码
|
|
|
|
|
|
lsh,
|
|
|
|
|
|
kskm: examSubject,
|
|
|
|
|
|
sfzmhm: idCard,
|
|
|
|
|
|
ksxm: '40100',
|
|
|
|
|
|
ksxl,
|
|
|
|
|
|
kchp: decodeURI(plateNo),
|
|
|
|
|
|
ksdd: decodeURI(ksdd),
|
|
|
|
|
|
kslx: decodeURI(kslx) || '',
|
|
|
|
|
|
kssj: time
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
const code = await writeObjectOut(beginData)
|
|
|
|
|
|
//TODO code待处理
|
2024-08-12 10:19:31 +08:00
|
|
|
|
// if (code == 1) {
|
|
|
|
|
|
//
|
|
|
|
|
|
// }
|
2024-07-31 13:47:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//过程照片
|
|
|
|
|
|
async uploadProgressPhoto() {
|
|
|
|
|
|
const {serialNumber,lsh,idCard,ksdd,kfdmArr,getPhoto} = this;
|
2025-02-13 15:30:48 +08:00
|
|
|
|
const carInfo = this.carInfo;
|
2024-07-31 13:47:40 +08:00
|
|
|
|
const { examSubject,plateNo,carNo } = carInfo;
|
|
|
|
|
|
const time = await getCurrentTime();
|
|
|
|
|
|
console.info('surenjun uploadProgressPhoto',)
|
|
|
|
|
|
const photoBase64 = await getPhoto()
|
|
|
|
|
|
const photoData = {
|
|
|
|
|
|
xtlb: '17', jkxlh: serialNumber, jkid: '17C54',
|
|
|
|
|
|
drvexam: {
|
|
|
|
|
|
lsh,
|
|
|
|
|
|
kskm: examSubject,
|
|
|
|
|
|
ksxm: '40100',
|
|
|
|
|
|
sfzmhm: idCard,
|
|
|
|
|
|
kchp: decodeURI(plateNo),
|
|
|
|
|
|
zpsj: time,
|
|
|
|
|
|
//@ts-ignore
|
|
|
|
|
|
// zp: encodeURIComponent(photoBase64),
|
|
|
|
|
|
zp: photoBase64,
|
|
|
|
|
|
cs: 0,
|
|
|
|
|
|
ksdd: decodeURI(ksdd)
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
const code = await writeObjectOut(photoData);
|
|
|
|
|
|
console.info('surenjun uploadProgressPhoto end',)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 扣分
|
|
|
|
|
|
async kfFn() {
|
|
|
|
|
|
const {serialNumber,lsh,idCard,ksdd,kfdmArr} = this;
|
|
|
|
|
|
const kfLen = kfdmArr.length;
|
|
|
|
|
|
const kf = kfdmArr[kfLen -1];
|
2025-02-13 15:30:48 +08:00
|
|
|
|
const carInfo = this.carInfo;
|
2024-07-31 13:47:40 +08:00
|
|
|
|
const { examSubject} = carInfo;
|
|
|
|
|
|
const time = await getCurrentTime();
|
|
|
|
|
|
const kfData = {
|
|
|
|
|
|
xtlb: '17', jkxlh: serialNumber, jkid: '17C53',
|
|
|
|
|
|
drvexam: {
|
|
|
|
|
|
lsh,
|
|
|
|
|
|
kskm: examSubject,
|
|
|
|
|
|
// 通用评判科二10000,科三30000
|
|
|
|
|
|
ksxm: 40100,
|
|
|
|
|
|
kfxm: kf.markcatalog,
|
|
|
|
|
|
kfxmmx: `${'1'},${kf.kfdm}`,
|
|
|
|
|
|
sfzmhm: idCard,
|
|
|
|
|
|
kchp: decodeURI(carInfo.plateNo),
|
|
|
|
|
|
kffs: 2,
|
|
|
|
|
|
ksdd: decodeURI(ksdd),
|
|
|
|
|
|
kfsj: time
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
const code = await writeObjectOut(kfData);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 项目结束
|
|
|
|
|
|
async endProject() {
|
2025-02-13 15:30:48 +08:00
|
|
|
|
const carInfo = this.carInfo;
|
2024-07-31 13:47:40 +08:00
|
|
|
|
const { examSubject,plateNo,carNo } = carInfo;
|
|
|
|
|
|
const {lsh,idCard,serialNumber,ksdd,kslx,ksxl,} = this;
|
|
|
|
|
|
const time = await getCurrentTime();
|
|
|
|
|
|
const endProjectData = {
|
|
|
|
|
|
xtlb: '17', jkxlh: serialNumber, jkid: '17C55',
|
|
|
|
|
|
drvexam: {
|
|
|
|
|
|
lsh,
|
|
|
|
|
|
kskm: examSubject,
|
|
|
|
|
|
sfzmhm: idCard,
|
|
|
|
|
|
ksxm: '40100',
|
|
|
|
|
|
czlx: '1',
|
|
|
|
|
|
ksxl,
|
|
|
|
|
|
kchp: decodeURI(plateNo),
|
|
|
|
|
|
ksdd: decodeURI(ksdd),
|
|
|
|
|
|
kslx: encodeURI(kslx) || '',
|
|
|
|
|
|
jssj: time
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
const code = await writeObjectOut(endProjectData);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//考试结束
|
|
|
|
|
|
async endFn() {
|
|
|
|
|
|
const {serialNumber,lsh,idCard,score,getPhoto} = this;
|
2025-02-13 15:30:48 +08:00
|
|
|
|
const carInfo = this.carInfo;
|
2024-07-31 13:47:40 +08:00
|
|
|
|
const { examSubject,plateNo } = carInfo;
|
|
|
|
|
|
const time = await getCurrentTime();
|
|
|
|
|
|
const photoBase64 = await getPhoto();
|
|
|
|
|
|
const endData = {
|
|
|
|
|
|
xtlb: '17', jkxlh: serialNumber, jkid: '17C56',
|
|
|
|
|
|
drvexam: {
|
|
|
|
|
|
lsh,
|
|
|
|
|
|
kchp: decodeURI(plateNo),
|
|
|
|
|
|
kskm: examSubject,
|
|
|
|
|
|
sfzmhm: idCard,
|
|
|
|
|
|
//@ts-ignore
|
|
|
|
|
|
// zp: encodeURIComponent(photoBase64),
|
|
|
|
|
|
zp: photoBase64,
|
|
|
|
|
|
jssj: time,
|
|
|
|
|
|
kscj: (score * 1) > 0 ? score : 0,
|
|
|
|
|
|
kslc: 0,
|
|
|
|
|
|
dwlc: '',
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
const code = await writeObjectOut(endData);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-05 09:34:03 +08:00
|
|
|
|
//获取sysset表数据
|
|
|
|
|
|
async initSysset(sysset?: SYSSET[]) {
|
|
|
|
|
|
const syssetParams = sysset || await getSyncData('MA_SYSSET');
|
2024-07-31 13:47:40 +08:00
|
|
|
|
console.info('surenjun syssetParams', JSON.stringify(syssetParams));
|
2024-07-05 09:34:03 +08:00
|
|
|
|
//@ts-ignore
|
|
|
|
|
|
syssetParams.forEach(sys => {
|
|
|
|
|
|
//监管序列号
|
2024-07-10 19:39:13 +08:00
|
|
|
|
if (sys.v_no == '901') {
|
2024-07-05 09:34:03 +08:00
|
|
|
|
this.serialNumber = sys.v_value || '123456'
|
|
|
|
|
|
}
|
|
|
|
|
|
//364 绕车一周评判时机(1-开始考试后判 2-开始考试前判)
|
2024-07-10 19:39:13 +08:00
|
|
|
|
if (sys.v_no == '364') {
|
2024-07-05 09:34:03 +08:00
|
|
|
|
const isOpen = sys.v_value == 2
|
|
|
|
|
|
if (isOpen) {
|
|
|
|
|
|
this.avPlayer.playAudio(['voice/上车准备.mp3'])
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-07-31 13:47:40 +08:00
|
|
|
|
this.judgeConfigObj[sys.v_no] = decodeURIComponent(sys.v_value)
|
2024-07-05 09:34:03 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//获取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
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-10 19:39:13 +08:00
|
|
|
|
if (mark.itemno == 1 && Number(mark.markserial) > 100 && Number(mark.markserial) < 200) {
|
2024-07-05 09:34:03 +08:00
|
|
|
|
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] || {};
|
2024-07-31 13:47:40 +08:00
|
|
|
|
|
|
|
|
|
|
const {xm,sfzmhm,lsh,kszp,ksdd,kssycs,kslx,ksxl} = stuInfo;
|
2024-07-05 09:34:03 +08:00
|
|
|
|
this.name = xm || '测试考生';
|
|
|
|
|
|
this.idCard = sfzmhm || '01234567891010';
|
|
|
|
|
|
this.lsh = lsh;
|
|
|
|
|
|
this.kszp = kszp;
|
|
|
|
|
|
this.ksdd = ksdd;
|
|
|
|
|
|
this.kssycs = kssycs;
|
|
|
|
|
|
this.kslx = kslx;
|
2024-07-31 13:47:40 +08:00
|
|
|
|
this.ksxl = ksxl;
|
2024-07-05 09:34:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//上一页 下一页
|
|
|
|
|
|
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() {
|
2024-12-05 18:31:06 +08:00
|
|
|
|
}.width(40).height(36).backgroundImage($rawfile(`judge/km3/zuo_nor.png`)).margin({ left: 24, top: 4 })
|
2024-07-05 09:34:03 +08:00
|
|
|
|
|
|
|
|
|
|
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() {
|
2024-12-05 18:31:06 +08:00
|
|
|
|
}.width(40).height(36).backgroundImage($rawfile(`judge/km3/you_nor.png`)).margin({ left: 4, top: 4 })
|
2024-07-05 09:34:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
.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 })
|
|
|
|
|
|
}
|
2024-12-05 18:31:06 +08:00
|
|
|
|
.width(180)
|
2024-07-05 09:34:03 +08:00
|
|
|
|
.height(80)
|
|
|
|
|
|
.justifyContent(FlexAlign.Start)
|
|
|
|
|
|
.alignItems(VerticalAlign.Center)
|
|
|
|
|
|
.backgroundImage($rawfile(`judge/km3/button_nor.png`))
|
|
|
|
|
|
.backgroundImageSize({ width: '100%', height: '100%' })
|
2024-07-31 13:47:40 +08:00
|
|
|
|
.onClick(async () => {
|
|
|
|
|
|
this.pointsDedute()
|
2024-07-05 09:34:03 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}.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)
|
2024-08-05 09:47:44 +08:00
|
|
|
|
.position({ x: '10%', y: '10%' })
|
2024-07-05 09:34:03 +08:00
|
|
|
|
.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%' })
|
2024-07-31 13:47:40 +08:00
|
|
|
|
.onClick(async () => {
|
|
|
|
|
|
//没有扣分项目通过
|
|
|
|
|
|
this.closePopup(this.kfdmArr.length ? true : false)
|
|
|
|
|
|
|
2024-12-05 18:31:06 +08:00
|
|
|
|
// judgeTask.addTask(async () => {
|
|
|
|
|
|
// await this.endProject()
|
|
|
|
|
|
// }, { isDelay: true })
|
2024-07-31 13:47:40 +08:00
|
|
|
|
|
2024-07-05 09:34:03 +08:00
|
|
|
|
})
|
|
|
|
|
|
}.width('100%').height('100%').position({ y: 0 }).backgroundColor('rgba(0,0,0,0.7)')
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|