彈框
This commit is contained in:
parent
86a905e949
commit
4e4d357f7a
@ -338,6 +338,8 @@ export async function getEsCarModel(context) {
|
|||||||
|
|
||||||
export async function upDataZhongxinginitialization(param) {
|
export async function upDataZhongxinginitialization(param) {
|
||||||
return new Promise(async(resolve, reject) => {
|
return new Promise(async(resolve, reject) => {
|
||||||
|
console.log('teststet00',JSON.stringify(param))
|
||||||
|
|
||||||
if (!param.carId) {
|
if (!param.carId) {
|
||||||
resolve(false)
|
resolve(false)
|
||||||
return
|
return
|
||||||
@ -352,6 +354,8 @@ export async function upDataZhongxinginitialization(param) {
|
|||||||
const result=await sqlInsertCommonFn(tableList[i], JSON.parse(data) || [], param.context)
|
const result=await sqlInsertCommonFn(tableList[i], JSON.parse(data) || [], param.context)
|
||||||
result?(flag=true):(flag=false)
|
result?(flag=true):(flag=false)
|
||||||
}
|
}
|
||||||
|
console.log('teststet1',JSON.stringify(param))
|
||||||
|
|
||||||
if(!flag){
|
if(!flag){
|
||||||
prompt.showToast({
|
prompt.showToast({
|
||||||
message: '本地文件初始化数据库失败',
|
message: '本地文件初始化数据库失败',
|
||||||
|
|||||||
@ -25,6 +25,8 @@ import prompt from '@ohos.prompt'
|
|||||||
import promptAction from '@ohos.promptAction';
|
import promptAction from '@ohos.promptAction';
|
||||||
import { getUDP } from './GlobalUdp';
|
import { getUDP } from './GlobalUdp';
|
||||||
import { dateFormat } from '../utils/tools'
|
import { dateFormat } from '../utils/tools'
|
||||||
|
import { getSyncData } from '../service/initable';
|
||||||
|
import VoiceAnnounce from '../../pages/judgeSDK/utils/voiceAnnouncements';
|
||||||
|
|
||||||
|
|
||||||
export default class UdpClientByCenter {
|
export default class UdpClientByCenter {
|
||||||
@ -41,6 +43,7 @@ export default class UdpClientByCenter {
|
|||||||
private lsh: string = null
|
private lsh: string = null
|
||||||
private context
|
private context
|
||||||
private stashFn: StashFunction
|
private stashFn: StashFunction
|
||||||
|
private errorStep: number=0
|
||||||
private interval
|
private interval
|
||||||
private headLenth: number = 9
|
private headLenth: number = 9
|
||||||
//消息头长度
|
//消息头长度
|
||||||
@ -49,6 +52,7 @@ export default class UdpClientByCenter {
|
|||||||
private initParam
|
private initParam
|
||||||
private onMessage_1Callback:Function = ()=>{}
|
private onMessage_1Callback:Function = ()=>{}
|
||||||
public currentValue:string = ''
|
public currentValue:string = ''
|
||||||
|
private avPlayer
|
||||||
|
|
||||||
constructor(udplocalIp: string, udplocalIpPort: string, udpOppositeIp: string, udpOppositeIpPort: string) {
|
constructor(udplocalIp: string, udplocalIpPort: string, udpOppositeIp: string, udpOppositeIpPort: string) {
|
||||||
this.localIp = udplocalIp
|
this.localIp = udplocalIp
|
||||||
@ -57,6 +61,7 @@ export default class UdpClientByCenter {
|
|||||||
this.oppositeIpPort = udpOppositeIpPort
|
this.oppositeIpPort = udpOppositeIpPort
|
||||||
this.stashFn = () => {
|
this.stashFn = () => {
|
||||||
}
|
}
|
||||||
|
this.avPlayer = new VoiceAnnounce();
|
||||||
this.udp = socket.constructUDPSocketInstance();
|
this.udp = socket.constructUDPSocketInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,12 +321,36 @@ export default class UdpClientByCenter {
|
|||||||
if(strachArr[83]!='4'){
|
if(strachArr[83]!='4'){
|
||||||
this.chafenFlag++
|
this.chafenFlag++
|
||||||
if(this.chafenFlag>=15&&!globalThis.dialogOpen){
|
if(this.chafenFlag>=15&&!globalThis.dialogOpen){
|
||||||
getUDP(globalThis.context,true)
|
// getUDP(globalThis.context,true)
|
||||||
globalThis.title='差分状态异常'
|
globalThis.title='差分状态异常'
|
||||||
globalThis.type='3'
|
globalThis.type='3'
|
||||||
AppStorage.SetOrCreate('errorMsg', 1);
|
AppStorage.SetOrCreate('errorMsg', 1);
|
||||||
|
if(this.errorStep!=1){
|
||||||
|
this.errorStep=1
|
||||||
|
this.avPlayer.playAudio(['voice/差分状态异常.wav'])
|
||||||
|
getSyncData('MA_SYSSET').then(syssetParams => {
|
||||||
|
// @ts-ignore
|
||||||
|
syssetParams.forEach(sys => {
|
||||||
|
// 差分长时间是SINGLE状态报考车故障,停止考试(0-否 1-是)
|
||||||
|
if (sys.v_no === '424'&&sys.v_value==1){
|
||||||
|
//plc差分丢失
|
||||||
|
console.log('sys.v_valuesys.v_valuesys.v_value',sys.v_value)
|
||||||
|
AppStorage.SetOrCreate('errorCode', 0);
|
||||||
|
AppStorage.SetOrCreate('errorCodeFlage', true);
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// const errorParam = syssetParams.filter(sys => sys.v_no === '424') //
|
||||||
|
// that.studentRefreshStatue = studentRefreshParam?.[0]?.v_value || '0'
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
AppStorage.SetOrCreate('errorCode', -1);
|
||||||
|
AppStorage.SetOrCreate('errorCodeFlage', false);
|
||||||
|
this.errorStep=0
|
||||||
globalThis.dialogOpen=false
|
globalThis.dialogOpen=false
|
||||||
}
|
}
|
||||||
this.chafenFlag=0
|
this.chafenFlag=0
|
||||||
@ -373,6 +402,29 @@ export default class UdpClientByCenter {
|
|||||||
globalThis.type='3'
|
globalThis.type='3'
|
||||||
if(!globalThis.dialogOpen){
|
if(!globalThis.dialogOpen){
|
||||||
AppStorage.SetOrCreate('errorMsg', 1);
|
AppStorage.SetOrCreate('errorMsg', 1);
|
||||||
|
if(this.errorStep!=1){
|
||||||
|
console.log('sys.v_valuesys.v_valuesys.v_value11221')
|
||||||
|
|
||||||
|
this.errorStep=1
|
||||||
|
this.avPlayer.playAudio(['voice/差分状态异常.wav'])
|
||||||
|
getSyncData('MA_SYSSET').then(syssetParams => {
|
||||||
|
console.log('sys.v_valuesys.v_valuesys.v_value11221',JSON.stringify(syssetParams))
|
||||||
|
// @ts-ignore
|
||||||
|
syssetParams.forEach(sys => {
|
||||||
|
// 差分长时间是SINGLE状态报考车故障,停止考试(0-否 1-是)
|
||||||
|
if (sys.v_no === '424'&&sys.v_value==1){
|
||||||
|
//plc差分丢失
|
||||||
|
AppStorage.SetOrCreate('errorCode', 0);
|
||||||
|
AppStorage.SetOrCreate('errorCodeFlage', true);
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// const errorParam = syssetParams.filter(sys => sys.v_no === '424') //
|
||||||
|
// that.studentRefreshStatue = studentRefreshParam?.[0]?.v_value || '0'
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
num = 0
|
num = 0
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,10 +28,10 @@ export default class EntryAbility extends UIAbility {
|
|||||||
globalThis.examinerInfo = {}
|
globalThis.examinerInfo = {}
|
||||||
globalThis.deviceNo = '';
|
globalThis.deviceNo = '';
|
||||||
globalThis.hasAuth = false
|
globalThis.hasAuth = false
|
||||||
globalThis.version = '2022.08.13.01'//洛阳
|
// globalThis.version = '2022.08.13.01'//洛阳
|
||||||
|
// globalThis.judgeVersion = '2022.12.05.1'
|
||||||
globalThis.judgeVersion = '2022.12.05.1'
|
globalThis.judgeVersion = '2022.12.05.1'
|
||||||
// globalThis.version = '2022.12.05.1'
|
globalThis.version = '2022.08.13.01'
|
||||||
// globalThis.judgeVersion = '2022.08.13.01'
|
|
||||||
// globalThis.version = '2024.11.22.14'//济南
|
// globalThis.version = '2024.11.22.14'//济南
|
||||||
// globalThis.judgeVersion = '2024.11.22.14'
|
// globalThis.judgeVersion = '2024.11.22.14'
|
||||||
globalThis.videoVersion= '1.0'
|
globalThis.videoVersion= '1.0'
|
||||||
|
|||||||
@ -76,7 +76,6 @@ struct Index {
|
|||||||
if (this.loading) {
|
if (this.loading) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
router.pushUrl({
|
router.pushUrl({
|
||||||
url: 'pages/Settings',
|
url: 'pages/Settings',
|
||||||
}, router.RouterMode.Single);
|
}, router.RouterMode.Single);
|
||||||
@ -102,6 +101,13 @@ struct Index {
|
|||||||
if (this.loading) {
|
if (this.loading) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
const data=AppStorage.Get('errorCode'); // returns 47
|
||||||
|
if(data==0){
|
||||||
|
globalThis.title='差分状态异常'
|
||||||
|
globalThis.type='3'
|
||||||
|
AppStorage.SetOrCreate('errorMsg', 1);
|
||||||
|
return
|
||||||
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.angle = 360
|
this.angle = 360
|
||||||
}, 1000)
|
}, 1000)
|
||||||
@ -150,7 +156,6 @@ struct Index {
|
|||||||
url: 'pages/UserInfo',
|
url: 'pages/UserInfo',
|
||||||
}, router.RouterMode.Single)
|
}, router.RouterMode.Single)
|
||||||
} else {
|
} else {
|
||||||
this.loading = true
|
|
||||||
this.testXMLToJSONInWorker()
|
this.testXMLToJSONInWorker()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -437,7 +442,7 @@ struct Index {
|
|||||||
if (this.num >= 3) {
|
if (this.num >= 3) {
|
||||||
this.heartMsg()
|
this.heartMsg()
|
||||||
}
|
}
|
||||||
const data=AppStorage.Get('errorMsg'); // returns 47
|
const data=AppStorage.Get('errorMsg');
|
||||||
console.log('1123',data,globalThis.type,globalThis.dialogOpen)
|
console.log('1123',data,globalThis.type,globalThis.dialogOpen)
|
||||||
if(data==1){
|
if(data==1){
|
||||||
if(globalThis.type=='3'&&!globalThis.dialogOpen){
|
if(globalThis.type=='3'&&!globalThis.dialogOpen){
|
||||||
|
|||||||
@ -376,7 +376,7 @@ struct UserInfo {
|
|||||||
that.jkxlh = serialNumberArr?.[0]?.v_value || '1234567'
|
that.jkxlh = serialNumberArr?.[0]?.v_value || '1234567'
|
||||||
const ksxtbhArr = syssetParams.filter(sys => sys.v_no === '902')
|
const ksxtbhArr = syssetParams.filter(sys => sys.v_no === '902')
|
||||||
that.ksxtbh = ksxtbhArr?.[0]?.v_value || '222'
|
that.ksxtbh = ksxtbhArr?.[0]?.v_value || '222'
|
||||||
const studentRefreshParam = syssetParams.filter(sys => sys.v_no === '452')
|
const studentRefreshParam = syssetParams.filter(sys => sys.v_no === '452') //判断自动更新
|
||||||
that.studentRefreshStatue = studentRefreshParam?.[0]?.v_value || '0'
|
that.studentRefreshStatue = studentRefreshParam?.[0]?.v_value || '0'
|
||||||
const openCheckFlagParam = syssetParams.filter(sys => sys.v_no == '17')
|
const openCheckFlagParam = syssetParams.filter(sys => sys.v_no == '17')
|
||||||
const openCheckFlag = openCheckFlagParam?.[0]?.v_value == '1' ? '1' : '0'
|
const openCheckFlag = openCheckFlagParam?.[0]?.v_value == '1' ? '1' : '0'
|
||||||
@ -402,25 +402,29 @@ struct UserInfo {
|
|||||||
that.openDeviceByIDCard()
|
that.openDeviceByIDCard()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (that.list.length) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
//0不自动更新 1自动更新(不限次数) 2没有考生更新2次
|
//0不自动更新 1自动更新(不限次数) 2没有考生更新2次
|
||||||
if (that.studentRefreshStatue == '2') {
|
if (that.studentRefreshStatue == '2') {
|
||||||
|
if(that.list.length == 0){
|
||||||
clearInterval(that.interval)
|
clearInterval(that.interval)
|
||||||
that.interval = setInterval(() => {
|
that.interval = setInterval(() => {
|
||||||
if (that.list.length == 0 && that.numCount < 3) {
|
if (that.numCount < 3) {
|
||||||
that.numCount++
|
that.numCount++
|
||||||
that.getExaminationStudentInfoFn()
|
that.getExaminationStudentInfoFn()
|
||||||
}
|
}
|
||||||
}, 5000)
|
}, 5000)
|
||||||
} else if (that.studentRefreshStatue == '1') {
|
}else{
|
||||||
clearInterval(that.interval)
|
|
||||||
that.interval = setInterval(() => {
|
|
||||||
if (that.list.length == 0) {
|
|
||||||
that.getExaminationStudentInfoFn()
|
that.getExaminationStudentInfoFn()
|
||||||
}
|
}
|
||||||
|
} else if (that.studentRefreshStatue == '1') {
|
||||||
|
if(that.list.length == 0){
|
||||||
|
clearInterval(that.interval)
|
||||||
|
that.interval = setInterval(() => {
|
||||||
|
that.getExaminationStudentInfoFn()
|
||||||
}, 5000)
|
}, 5000)
|
||||||
|
}else{
|
||||||
|
that.getExaminationStudentInfoFn()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// this.getExaminationItemFn()
|
// this.getExaminationItemFn()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import router from '@ohos.router';
|
||||||
|
|
||||||
@CustomDialog
|
@CustomDialog
|
||||||
export default struct errorMsgDialog {
|
export default struct errorMsgDialog {
|
||||||
private controller?: CustomDialogController
|
private controller?: CustomDialogController
|
||||||
@ -51,6 +53,16 @@ export default struct errorMsgDialog {
|
|||||||
.commStyle()
|
.commStyle()
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
if (this.controller != undefined) {
|
if (this.controller != undefined) {
|
||||||
|
const errorCode=AppStorage.Get('errorMsg');
|
||||||
|
const errorCodeFlage=AppStorage.Get('errorCodeFlage');
|
||||||
|
console.log('errorCode',errorCode,errorCodeFlage)
|
||||||
|
if(errorCode==0&&errorCodeFlage){
|
||||||
|
router.replaceUrl({
|
||||||
|
url: 'pages/Index',
|
||||||
|
}, router.RouterMode.Single);
|
||||||
|
router.clear();
|
||||||
|
|
||||||
|
}
|
||||||
this.cancel()
|
this.cancel()
|
||||||
this.controller.close()
|
this.controller.close()
|
||||||
}
|
}
|
||||||
@ -64,15 +76,32 @@ export default struct errorMsgDialog {
|
|||||||
}
|
}
|
||||||
.commStyle()
|
.commStyle()
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
|
const errorCode=AppStorage.Get('errorMsg');
|
||||||
|
const errorCodeFlage=AppStorage.Get('errorCodeFlage');
|
||||||
|
console.log('errorCode',errorCode,errorCodeFlage)
|
||||||
|
if(errorCode==0&&errorCodeFlage){
|
||||||
|
router.replaceUrl({
|
||||||
|
url: 'pages/Index',
|
||||||
|
}, router.RouterMode.Single);
|
||||||
|
router.clear();
|
||||||
|
|
||||||
|
}
|
||||||
|
console.log('errorCode',errorCode,errorCodeFlage)
|
||||||
|
|
||||||
if (this.controller != undefined){
|
if (this.controller != undefined){
|
||||||
this.confirm()
|
this.confirm()
|
||||||
this.controller.close()
|
this.controller.close()
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}.padding({bottom:20})
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}.backgroundColor('#E6E3DF')
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
.padding({bottom:20})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.
|
||||||
|
backgroundColor('#E6E3DF')
|
||||||
.borderRadius(19 * globalThis.ratio)
|
.borderRadius(19 * globalThis.ratio)
|
||||||
.constraintSize({ minWidth: 520 })
|
.constraintSize({ minWidth: 520 })
|
||||||
}
|
}
|
||||||
@ -91,8 +120,10 @@ export default struct errorMsgDialog {
|
|||||||
}, 2000)
|
}, 2000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
aboutToDisappear() {
|
aboutToDisappear() {
|
||||||
this.title = ''
|
this.title = ''
|
||||||
this.angle = 0
|
this.angle = 0
|
||||||
|
AppStorage.SetOrCreate('errorCodeFlage', false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user