Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	entry/src/main/ets/pages/UserInfo.ets
This commit is contained in:
surenjun 2025-03-27 10:33:15 +08:00
commit b6bbba02e8
2 changed files with 66 additions and 46 deletions

View File

@ -136,8 +136,8 @@ export const RealNumData = {
8: 18, 8: 18,
9: 5, 9: 5,
10: 29, 10: 29,
11: 30, 11: 31,
12: 31, 12: 30,
13: 32, 13: 32,
14: 28, 14: 28,
15: 28, 15: 28,

View File

@ -209,48 +209,66 @@ struct UserInfo {
this.list = await getSyncData('USERLIST') this.list = await getSyncData('USERLIST')
// @ts-ignore // @ts-ignore
const data = await getSyncData('USER') const data = await getSyncData('USER')
console.log('useruser,', JSON.stringify(this.list))
console.log('useruser1,', JSON.stringify(data))
const user = data[0] const user = data[0]
if (user && Number(user.kssycs)) { if(!Number(user.kssycs)){
let flag = false
this.list.forEach(res => {
if (res.sfzmhm == user.sfzmhm) {
flag = true
res.kssycs = user.kssycs
this.getCurrentStudent(res.sfzmhm)
}
})
if (!flag) {
this.currentUser = (this.list.length ? this.list[0] : EmptyCandidateObject)
globalThis.lsh =
this.list.length
? this.currentUser.lsh
:'1111111111111'
console.info('surenjun 当前的流水号1为:' + globalThis.lsh)
}
} else if (user && (user.kssycs == '0' || user.kssycs == '')) {
console.log('datadatadatadata')
this.list = this.list.filter(res => { this.list = this.list.filter(res => {
return res.sfzmhm != user.sfzmhm return res.sfzmhm != user.sfzmhm
}) })
this.pageIndex = 0 }
this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) this.pageIndex = 0
if (this.dataList.length) { this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4)
setTimeout(() => { if (this.dataList.length) {
this.currentUser = this.dataList[0] setTimeout(() => {
this.currentUser.ksy2 = globalThis.kgxm this.currentUser = this.dataList[0]
globalThis.lsh = this.currentUser.lsh this.currentUser.ksy2 = globalThis.kgxm
console.info('surenjun 当前的流水号2为:' + globalThis.lsh) globalThis.lsh = this.currentUser.lsh
}, 200) }, 200)
} else { } else {
this.currentUser = EmptyCandidateObject this.currentUser = EmptyCandidateObject
globalThis.lsh = '1111111111111' globalThis.lsh = '1111111111111'
console.info('surenjun 当前的流水号3为:' + globalThis.lsh)
}
} }
this.list.forEach((res, index) => { this.list.forEach((res, index) => {
res.id = index.toString() res.id = index.toString()
}) })
await upDateTableByArray('USERLIST', this.list || []) await upDateTableByArray('USERLIST', this.list || [])
// if(this.)
// if (user && Number(user.kssycs)) {
//
// let flag = false
// this.list.forEach(res => {
// if (res.sfzmhm == user.sfzmhm) {
// flag = true
// res.kssycs = user.kssycs
// this.getCurrentStudent(res.sfzmhm)
// }
// })
// if (!flag) {
// this.currentUser = (this.list.length ? this.list[0] : EmptyCandidateObject)
// globalThis.lsh = this.list.length?this.currentUser.lsh:'1111111111111'
// }
// } else if (user && (user.kssycs == '0' || user.kssycs == '')) {
// console.log('datadatadatadata')
// this.list = this.list.filter(res => {
// return res.sfzmhm != user.sfzmhm
// })
// this.pageIndex = 0
// this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4)
// if (this.dataList.length) {
// setTimeout(() => {
// this.currentUser = this.dataList[0]
// this.currentUser.ksy2 = globalThis.kgxm
// globalThis.lsh = this.currentUser.lsh
// }, 200)
// } else {
// this.currentUser = EmptyCandidateObject
// globalThis.lsh = '1111111111111'
// }
// }
} else { } else {
await this.getExaminationStudentInfoFn() await this.getExaminationStudentInfoFn()
} }
@ -273,6 +291,7 @@ struct UserInfo {
//监听远程开始考试 //监听远程开始考试
globalThis.udpEvent.onBeginExam(async () => { globalThis.udpEvent.onBeginExam(async () => {
console.info('surenjun', 'userInfo收到UdpEvent事件')
if (this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow) { if (this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow) {
await this.prePareSCZB() await this.prePareSCZB()
} else { } else {
@ -645,8 +664,7 @@ struct UserInfo {
this.startExam = false this.startExam = false
// await upDateTableByArray('USER', []) // await upDateTableByArray('USER', [])
// await upDateTableByArray('USERLIST', []) // await upDateTableByArray('USERLIST', [])
await DB.clearTable('USER')
await DB.clearTable('USERLIST')
this.type = '2' this.type = '2'
this.errorDialog.open() this.errorDialog.open()
this.updateTimeLimit = true this.updateTimeLimit = true
@ -654,6 +672,8 @@ struct UserInfo {
try { try {
getExaminationStudentInfo(param).then(async (res) => { getExaminationStudentInfo(param).then(async (res) => {
console.log("temp log ", JSON.stringify(res)) console.log("temp log ", JSON.stringify(res))
await DB.clearTable('USER')
await DB.clearTable('USERLIST')
this.errorDialog.close() this.errorDialog.close()
setTimeout(() => { setTimeout(() => {
this.updateTimeLimit = false this.updateTimeLimit = false
@ -718,21 +738,21 @@ struct UserInfo {
return res.kssycs == '1' return res.kssycs == '1'
}) })
if (this.dataList.length) { if (this.dataList.length) {
if (user.length) { // if (user.length) {
setTimeout(() => { // setTimeout(() => {
this.currentUser = user[0] // this.currentUser = user[0]
this.currentUser.ksy2 = globalThis.kgxm // this.currentUser.ksy2 = globalThis.kgxm
globalThis.lsh = this.currentUser.lsh // globalThis.lsh = this.currentUser.lsh
globalThis.ksyh = this.currentUser.ksy1sfzmhm // globalThis.ksyh = this.currentUser.ksy1sfzmhm
}, 200) // }, 200)
} else { // } else {
setTimeout(() => { setTimeout(() => {
this.currentUser = this.dataList[0] this.currentUser = this.dataList[0]
this.currentUser.ksy2 = globalThis.kgxm this.currentUser.ksy2 = globalThis.kgxm
globalThis.ksyh = this.currentUser.ksy1sfzmhm globalThis.ksyh = this.currentUser.ksy1sfzmhm
globalThis.lsh = this.currentUser.lsh globalThis.lsh = this.currentUser.lsh
}, 200) }, 200)
} // }
} else { } else {
this.currentUser = EmptyCandidateObject this.currentUser = EmptyCandidateObject
globalThis.lsh = '1111111111111' globalThis.lsh = '1111111111111'