fix: 优化类型定义和函数调用,添加缺失的类型注解
This commit is contained in:
parent
b37b5e9581
commit
3475fc9961
@ -84,7 +84,7 @@ export async function initCarInfoCache(params: initCarInfoCacheParams) {
|
|||||||
|
|
||||||
//参数下发读表接口
|
//参数下发读表接口
|
||||||
export async function initCenterCache(params: object, url: string) {
|
export async function initCenterCache(params: object, url: string) {
|
||||||
const timeInfo = AppStorage.get('timeInfo')
|
const timeInfo: string = AppStorage.get('timeInfo')
|
||||||
return await request<object>({
|
return await request<object>({
|
||||||
url: '/para/initCenterCache.ws',
|
url: '/para/initCenterCache.ws',
|
||||||
data: params,
|
data: params,
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import { getSyncData } from '../common/service/initable';
|
|||||||
import writeObjectOutNew from './judgeNew';
|
import writeObjectOutNew from './judgeNew';
|
||||||
import FileUtil from '../common/utils/File';
|
import FileUtil from '../common/utils/File';
|
||||||
import http from '@ohos.net.http';
|
import http from '@ohos.net.http';
|
||||||
|
import { MASYSSETTableType, RegulatoryInterfaceParams } from '../model';
|
||||||
|
import { GetSyncData } from '../utils/table/Operation';
|
||||||
|
|
||||||
let baseHost: string = AppStorage.get('host');
|
let baseHost: string = AppStorage.get('host');
|
||||||
|
|
||||||
@ -25,7 +27,7 @@ interface WR {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 通用监管接口
|
// 通用监管接口
|
||||||
export async function writeObjectOut(params: ESObject, filePath?: string): Promise<WR> {
|
export async function writeObjectOut(params: RegulatoryInterfaceParams, filePath?: string): Promise<WR> {
|
||||||
const singlePlay: boolean = AppStorage.get('singlePlay')
|
const singlePlay: boolean = AppStorage.get('singlePlay')
|
||||||
if (singlePlay) {
|
if (singlePlay) {
|
||||||
return { code: 1 }
|
return { code: 1 }
|
||||||
@ -33,7 +35,7 @@ export async function writeObjectOut(params: ESObject, filePath?: string): Promi
|
|||||||
let JGHOST: string = AppStorage.get("JGHOST")
|
let JGHOST: string = AppStorage.get("JGHOST")
|
||||||
//获取监管接口地址路径
|
//获取监管接口地址路径
|
||||||
if (!JGHOST) {
|
if (!JGHOST) {
|
||||||
const syssetParams = await getSyncData('MA_SYSSET') || [];
|
const syssetParams: MASYSSETTableType[] = await GetSyncData<MASYSSETTableType>("MA_SYSSET");
|
||||||
|
|
||||||
syssetParams.forEach(sys => {
|
syssetParams.forEach(sys => {
|
||||||
if (sys.v_no == '839') {
|
if (sys.v_no == '839') {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import request from '../utils/Request'
|
import request from '../utils/Request'
|
||||||
import http from '@ohos.net.http'
|
import http from '@ohos.net.http'
|
||||||
import { FaceCompareResp } from '../model'
|
import { FaceCompareResp, GetExaminationItemRsp, GetExaminationStudentInfoResponse } from '../model'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 照片比对
|
* 照片比对
|
||||||
@ -39,8 +39,8 @@ export async function faceCompare(params: FaceCompareParams) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export async function getExaminationStudentInfo(params: object) {
|
export async function getExaminationStudentInfo(params: ESObject) {
|
||||||
return request({
|
return request<GetExaminationStudentInfoResponse>({
|
||||||
url: '/der2/services/exam/getExaminationStudentInfo.ws',
|
url: '/der2/services/exam/getExaminationStudentInfo.ws',
|
||||||
data: params,
|
data: params,
|
||||||
method: http.RequestMethod.POST,
|
method: http.RequestMethod.POST,
|
||||||
@ -67,7 +67,7 @@ interface GetExaminationItemParams {
|
|||||||
|
|
||||||
//获取断点续考
|
//获取断点续考
|
||||||
export async function getExaminationItem(params: GetExaminationItemParams) {
|
export async function getExaminationItem(params: GetExaminationItemParams) {
|
||||||
return request({
|
return request<GetExaminationItemRsp>({
|
||||||
url: '/der2/services/exam/getExaminationItem.ws',
|
url: '/der2/services/exam/getExaminationItem.ws',
|
||||||
data: `<getExaminationItemReq>
|
data: `<getExaminationItemReq>
|
||||||
<head>
|
<head>
|
||||||
|
|||||||
@ -93,4 +93,5 @@ export interface BaseInfoType {
|
|||||||
export interface RouteParamsType {
|
export interface RouteParamsType {
|
||||||
sczb?: string;
|
sczb?: string;
|
||||||
kfdm?: string;
|
kfdm?: string;
|
||||||
|
type?: string;
|
||||||
}
|
}
|
||||||
@ -88,6 +88,7 @@ interface JudgeFile {
|
|||||||
|
|
||||||
/** 考试过程数据 */
|
/** 考试过程数据 */
|
||||||
export interface DrvexamType extends BaseExamFields {
|
export interface DrvexamType extends BaseExamFields {
|
||||||
|
lsh?: string;
|
||||||
zp?: string;
|
zp?: string;
|
||||||
sbxh?: string;
|
sbxh?: string;
|
||||||
kffs?: string;
|
kffs?: string;
|
||||||
@ -95,4 +96,7 @@ export interface DrvexamType extends BaseExamFields {
|
|||||||
kfxm?: string;
|
kfxm?: string;
|
||||||
kfxmmx?: string;
|
kfxmmx?: string;
|
||||||
ghks?: string;
|
ghks?: string;
|
||||||
|
ksxtbh?: string;
|
||||||
|
ksysfzmhm?: string;
|
||||||
|
Ksy2sfzmhm?: string;
|
||||||
}
|
}
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { DrvexamType } from ".";
|
||||||
|
|
||||||
export interface RegistrationDeviceNoRsp {
|
export interface RegistrationDeviceNoRsp {
|
||||||
registrationDeviceNoRsp: RegistrationDeviceNoRspDetails;
|
registrationDeviceNoRsp: RegistrationDeviceNoRspDetails;
|
||||||
}
|
}
|
||||||
@ -17,9 +19,12 @@ interface ImageCompareRsp {
|
|||||||
body: ESObject
|
body: ESObject
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GetExaminationStudentInfoResponse {
|
||||||
|
getExaminationStudentInfoRsp: ImageCompareRsp
|
||||||
|
}
|
||||||
|
|
||||||
export interface FaceCompareResp {
|
export interface FaceCompareResp {
|
||||||
imageCompareRsp?: ImageCompareRsp
|
imageCompareRsp?: ImageCompareRsp
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ResponseDataType {
|
export interface ResponseDataType {
|
||||||
@ -34,6 +39,9 @@ export interface ExaminerLoginInfo {
|
|||||||
username?: string;
|
username?: string;
|
||||||
kgxm?: string;
|
kgxm?: string;
|
||||||
ksyh?: string;
|
ksyh?: string;
|
||||||
|
plateNo?: string
|
||||||
|
isNeedCheck?: string
|
||||||
|
examSubject?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SpzdType {
|
export interface SpzdType {
|
||||||
@ -78,7 +86,35 @@ interface ES_CHECK_CAR_ITEMItem {
|
|||||||
ITEMS: string;
|
ITEMS: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ObtainCarExamInfoParams {
|
export interface ObtainCarExamInfoParams {
|
||||||
time: string
|
time: string
|
||||||
deviceNo: string
|
deviceNo: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//监管接口参数
|
||||||
|
export interface RegulatoryInterfaceParams {
|
||||||
|
xtlb?: string;
|
||||||
|
jkxlh?: string;
|
||||||
|
jkid?: string;
|
||||||
|
drvexam?: DrvexamType
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BeginExamRequest {
|
||||||
|
keystr?: string;
|
||||||
|
message?: string | Resource;
|
||||||
|
code?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
// { getExaminationItemRsp: { body: { ykxx: '' } } }
|
||||||
|
export interface GetExaminationItemRsp {
|
||||||
|
getExaminationItemRsp: GetExaminationItemRspDetails
|
||||||
|
}
|
||||||
|
|
||||||
|
interface GetExaminationItemRspDetails {
|
||||||
|
head?: Head;
|
||||||
|
body: GetExaminationItemRspBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface GetExaminationItemRspBody {
|
||||||
|
ykxx: string;
|
||||||
|
}
|
||||||
@ -20,7 +20,7 @@ import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
|
|||||||
import { BaseInfoType } from '../model/Common';
|
import { BaseInfoType } from '../model/Common';
|
||||||
import { CarInfoType } from '../model/CarCheck';
|
import { CarInfoType } from '../model/CarCheck';
|
||||||
import { InitializeTheCentralTableType, MASYSSETTableType, TimeInfo } from '../model';
|
import { InitializeTheCentralTableType, MASYSSETTableType, TimeInfo } from '../model';
|
||||||
import { GetCarInfo, GetDeviceInfo, UseAuth } from './index/utils';
|
import { GetCarInfo, GetDeviceInfo, UseAuth } from './Index/utils';
|
||||||
import { GetSyncData, InitializeTheCentralTable } from '../utils/table/Operation';
|
import { GetSyncData, InitializeTheCentralTable } from '../utils/table/Operation';
|
||||||
import { BusinessError } from '@ohos.base';
|
import { BusinessError } from '@ohos.base';
|
||||||
|
|
||||||
@ -57,9 +57,7 @@ struct Index {
|
|||||||
alignment: DialogAlignment.Center,
|
alignment: DialogAlignment.Center,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
private fileUtil: FileUtil
|
|
||||||
private interval = -1;
|
private interval = -1;
|
||||||
// private vocObj = null;
|
|
||||||
private avPlayer: VoiceAnnounce
|
private avPlayer: VoiceAnnounce
|
||||||
private timeInfo: TimeInfo
|
private timeInfo: TimeInfo
|
||||||
private context = getContext(this) as common.UIAbilityContext;
|
private context = getContext(this) as common.UIAbilityContext;
|
||||||
@ -503,37 +501,6 @@ struct Index {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// userAuth() {
|
|
||||||
// return new Promise((reslove, reject) => {
|
|
||||||
// const permissions: Array<Permissions> =
|
|
||||||
// ["ohos.permission.SET_TIME", "ohos.permission.READ_IMAGEVIDEO", "ohos.permission.DISTRIBUTED_DATASYNC",
|
|
||||||
// 'ohos.permission.CONNECTIVITY_INTERNAL', 'ohos.permission.CAMERA', 'ohos.permission.READ_MEDIA',
|
|
||||||
// 'ohos.permission.WRITE_MEDIA', 'ohos.permission.FILE_ACCESS_MANAGER'];
|
|
||||||
// let context = this.context;
|
|
||||||
// let atManager = abilityAccessCtrl.createAtManager();
|
|
||||||
//
|
|
||||||
// atManager.requestPermissionsFromUser(context, permissions).then((data) => {
|
|
||||||
// this.initParams()
|
|
||||||
// let grantStatus: Array<number> = data.authResults;
|
|
||||||
// let length: number = grantStatus.length;
|
|
||||||
// for (let i = 0; i < length; i++) {
|
|
||||||
// if (grantStatus[i] === 0) {
|
|
||||||
// // 用户授权,可以继续访问目标操作
|
|
||||||
// reslove(true)
|
|
||||||
// } else {
|
|
||||||
// reject()
|
|
||||||
// // 用户拒绝授权,提示用户必须授权才能访问当前页面的功能,并引导用户到系统设置中打开相应的权限
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // 授权成功
|
|
||||||
// }).catch((err: BusinessError) => {
|
|
||||||
// console.error(`Failed to request permissions from user. Code is ${err.code}, message is ${err.message}`);
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
async initParams() {
|
async initParams() {
|
||||||
//设置plc udp 同步requesthost
|
//设置plc udp 同步requesthost
|
||||||
await getUDP(this.context, false)
|
await getUDP(this.context, false)
|
||||||
|
|||||||
@ -30,7 +30,8 @@ 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, CommonType, KfdmType } from '../model';
|
import { CarInfoType, CommonType, KfdmType, User } from '../model';
|
||||||
|
import { GetSyncData } from '../utils/table/Operation';
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
@ -215,7 +216,7 @@ struct Index {
|
|||||||
|
|
||||||
// 获取考生信息
|
// 获取考生信息
|
||||||
async initStudent() {
|
async initStudent() {
|
||||||
const students = await getSyncData('USER')
|
const students = await GetSyncData<User>('USER')
|
||||||
const stuInfo = students[0] || {};
|
const stuInfo = students[0] || {};
|
||||||
const { xm, sfzmhm, lsh, kszp, ksdd, kssycs, kslx, ksxl, xldm } = stuInfo;
|
const { xm, sfzmhm, lsh, kszp, ksdd, kssycs, kslx, ksxl, xldm } = stuInfo;
|
||||||
this.name = xm || '测试考生';
|
this.name = xm || '测试考生';
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import IDCardSDK from '@ohos.idcard';
|
|||||||
import common from '@ohos.app.ability.common';
|
import common from '@ohos.app.ability.common';
|
||||||
import promptAction from '@ohos.promptAction';
|
import promptAction from '@ohos.promptAction';
|
||||||
import FilePhoto from './judgeSDK/utils/filePhoto';
|
import FilePhoto from './judgeSDK/utils/filePhoto';
|
||||||
import { getSyncData, sqlInsertCommonFn, upDateTableByArray } from '../common/service/initable';
|
import { sqlInsertCommonFn, upDateTableByArray } from '../common/service/initable';
|
||||||
import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData';
|
import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData';
|
||||||
import BoardPrePareSetPopup from './compontents/judge/BoardPrePareSetPopup';
|
import BoardPrePareSetPopup from './compontents/judge/BoardPrePareSetPopup';
|
||||||
import LoadingPopup from './compontents/judge/LoadingPopup';
|
import LoadingPopup from './compontents/judge/LoadingPopup';
|
||||||
@ -21,8 +21,25 @@ import errorMsgDialog from './compontents/errorMsgDialog';
|
|||||||
import imageBtn from './compontents/imageBtn';
|
import imageBtn from './compontents/imageBtn';
|
||||||
import FileUtil from '../common/utils/File';
|
import FileUtil from '../common/utils/File';
|
||||||
import DB, { ColumnType } from '../common/database/DbSql';
|
import DB, { ColumnType } from '../common/database/DbSql';
|
||||||
import { CarInfoType, IdCard, LabelBlockType, QKParamType, SckType, SystemParamType, User } from '../model';
|
import {
|
||||||
|
BeginExamRequest,
|
||||||
|
CarInfoType,
|
||||||
|
DrvexamType,
|
||||||
|
ExaminerLoginInfo,
|
||||||
|
GetExaminationItemRsp,
|
||||||
|
IdCard,
|
||||||
|
LabelBlockType,
|
||||||
|
MASYSSETTableType,
|
||||||
|
QKParamType,
|
||||||
|
RegulatoryInterfaceParams,
|
||||||
|
RouteParamsType,
|
||||||
|
SckType,
|
||||||
|
SystemParamType,
|
||||||
|
User
|
||||||
|
} from '../model';
|
||||||
import { BusinessError } from '@ohos.base';
|
import { BusinessError } from '@ohos.base';
|
||||||
|
import { GetSyncData } from '../utils/table/Operation';
|
||||||
|
import { GetCurrentUserKeyValue } from './UserInfo/utils';
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
@ -208,13 +225,15 @@ struct UserInfo {
|
|||||||
this.initData()
|
this.initData()
|
||||||
//身份证读卡器初始化
|
//身份证读卡器初始化
|
||||||
// this.openDeviceByIDCard()
|
// this.openDeviceByIDCard()
|
||||||
const routerParam = router.getParams() || { type: 0 };
|
const routerParam: RouteParamsType = router.getParams() as RouteParamsType
|
||||||
console.log('routerParam', JSON.stringify(routerParam))
|
console.log('routerParam', JSON.stringify(routerParam))
|
||||||
|
|
||||||
if (!this.singlePlay) {
|
if (!this.singlePlay) {
|
||||||
if (routerParam.type != 1) {
|
if (routerParam.type != "1") {
|
||||||
this.list = await getSyncData('USERLIST')
|
// this.list = await getSyncData('USERLIST')
|
||||||
const data = await getSyncData('USER')
|
this.list = await GetSyncData<User>("USERLIST")
|
||||||
|
// const data = await getSyncData('USER')
|
||||||
|
const data = await GetSyncData<User>("USER")
|
||||||
console.log('useruser,', JSON.stringify(this.list))
|
console.log('useruser,', JSON.stringify(this.list))
|
||||||
console.log('useruser1,', JSON.stringify(data))
|
console.log('useruser1,', JSON.stringify(data))
|
||||||
|
|
||||||
@ -271,16 +290,16 @@ struct UserInfo {
|
|||||||
// }
|
// }
|
||||||
this.sczbkf = [];
|
this.sczbkf = [];
|
||||||
initJudgeUdp()
|
initJudgeUdp()
|
||||||
|
// TODO UDP更改
|
||||||
//监听远程开始考试
|
//监听远程开始考试
|
||||||
globalThis.udpEvent.onBeginExam(async () => {
|
// globalThis.udpEvent.onBeginExam(async () => {
|
||||||
console.info('surenjun', 'userInfo收到UdpEvent事件')
|
// console.info('surenjun', 'userInfo收到UdpEvent事件')
|
||||||
if (this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow) {
|
// if (this.isBoardPrePareSetPopupOpen && !this.isFirstBoardPrePareSetPopupBtnShow) {
|
||||||
await this.prePareSCZB()
|
// await this.prePareSCZB()
|
||||||
} else {
|
// } else {
|
||||||
await this.prePareExam()
|
// await this.prePareExam()
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,12 +317,12 @@ struct UserInfo {
|
|||||||
|
|
||||||
stopDeviceById() {
|
stopDeviceById() {
|
||||||
if (this.faceFlag == '1') {
|
if (this.faceFlag == '1') {
|
||||||
testNapi && testNapi.StopReadCard()
|
testNapi.StopReadCard()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通过身份证获取当前学员
|
// 通过身份证获取当前学员
|
||||||
async getCurrentStudent(id) {
|
async getCurrentStudent(id: string) {
|
||||||
let flag = false
|
let flag = false
|
||||||
// this.pageIndex
|
// this.pageIndex
|
||||||
console.log('currentidid', id)
|
console.log('currentidid', id)
|
||||||
@ -320,13 +339,11 @@ struct UserInfo {
|
|||||||
this.examinerLoginInfo.ksyh = res.ksy1sfzmhm
|
this.examinerLoginInfo.ksyh = res.ksy1sfzmhm
|
||||||
AppStorage.setOrCreate('examinerLoginInfo', this.examinerLoginInfo)
|
AppStorage.setOrCreate('examinerLoginInfo', this.examinerLoginInfo)
|
||||||
AppStorage.setOrCreate('lsh', res.lsh)
|
AppStorage.setOrCreate('lsh', res.lsh)
|
||||||
const { examSubject } = this.carInfo;
|
// const { examSubject } = this.carInfo;
|
||||||
// this.currentUser.kszp=this.photo+res.kszp
|
|
||||||
// this.currentUser.ksmjzp=this.photo+this.currentUser.ksmjzp
|
|
||||||
if (this.singlePlay) {
|
if (this.singlePlay) {
|
||||||
this.stopDeviceById()
|
this.stopDeviceById()
|
||||||
router.pushUrl({
|
router.pushUrl({
|
||||||
url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
|
url: this.carInfo.examSubject == "3" ? 'pages/Roads' : 'pages/Judge',
|
||||||
params: {
|
params: {
|
||||||
sczb: Number(this.isBoardPrePareSetPopupOpen),
|
sczb: Number(this.isBoardPrePareSetPopupOpen),
|
||||||
kfdm: this.sczbkf,
|
kfdm: this.sczbkf,
|
||||||
@ -389,7 +406,7 @@ struct UserInfo {
|
|||||||
thisVar.address = baseInfos[4];
|
thisVar.address = baseInfos[4];
|
||||||
thisVar.idCard = baseInfos[5];
|
thisVar.idCard = baseInfos[5];
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
thisVar.getCurrentStudent(baseInfos[5])
|
this.getCurrentStudent(baseInfos[5])
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,20 +462,21 @@ struct UserInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async heartMsg() {
|
async heartMsg() {
|
||||||
globalThis.udpClient2 & globalThis.udpClient2.setMsgCallBack(async (val) => {
|
// TODO UDP缺失
|
||||||
if (val.id == '32') {
|
// globalThis.udpClient2 & globalThis.udpClient2.setMsgCallBack(async (val) => {
|
||||||
AppStorage.setOrCreate('signNum', val.body[1])
|
// if (val.id == '32') {
|
||||||
if (val.body[0] == '7') {
|
// AppStorage.setOrCreate('signNum', val.body[1])
|
||||||
//缺考处理
|
// if (val.body[0] == '7') {
|
||||||
this.getqkFn()
|
// //缺考处理
|
||||||
this.signNum = val.body[1]
|
// this.getqkFn()
|
||||||
}
|
// this.signNum = val.body[1]
|
||||||
} else if (val.id == '42') {
|
// }
|
||||||
//收到中心缺考确认消息
|
// } else if (val.id == '42') {
|
||||||
console.log('qkfnqkfn', val.body[0])
|
// //收到中心缺考确认消息
|
||||||
this.qkFn()
|
// console.log('qkfnqkfn', val.body[0])
|
||||||
}
|
// this.qkFn()
|
||||||
})
|
// }
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
//考点端查询缺考指令内容消息请求
|
//考点端查询缺考指令内容消息请求
|
||||||
@ -471,16 +489,18 @@ struct UserInfo {
|
|||||||
carNo: this.carInfo.carNo as string,
|
carNo: this.carInfo.carNo as string,
|
||||||
placeId: this.carInfo.examinationRoomId as string
|
placeId: this.carInfo.examinationRoomId as string
|
||||||
}
|
}
|
||||||
globalThis.udpClient2.sendMsgExt(param, this.context)
|
// TODO UDP缺失
|
||||||
|
// globalThis.udpClient2.sendMsgExt(param, this.context)
|
||||||
}
|
}
|
||||||
|
|
||||||
async initSysset() {
|
async initSysset() {
|
||||||
const that = this;
|
const that = this;
|
||||||
DB.queryListBySql("select * from MA_SYSSET", ['id', 'v_no', 'v_name', 'v_value'].map(item => ({
|
// DB.queryListBySql("select * from MA_SYSSET", ['id', 'v_no', 'v_name', 'v_value'].map(item => ({
|
||||||
type: ColumnType.STRING,
|
// type: ColumnType.STRING,
|
||||||
name: item,
|
// name: item,
|
||||||
columnName: item
|
// columnName: item
|
||||||
}))).then((syssetParams: any) => {
|
// }))).then((syssetParams: any) => {
|
||||||
|
GetSyncData<MASYSSETTableType>("MA_SYSSET").then((syssetParams: MASYSSETTableType[]) => {
|
||||||
const serialNumberArr = syssetParams.filter(sys => sys.v_no === '901')
|
const serialNumberArr = syssetParams.filter(sys => sys.v_no === '901')
|
||||||
that.jkxlh = serialNumberArr?.[0]?.v_value || ''
|
that.jkxlh = serialNumberArr?.[0]?.v_value || ''
|
||||||
const ksxtbhArr = syssetParams.filter(sys => sys.v_no === '902')
|
const ksxtbhArr = syssetParams.filter(sys => sys.v_no === '902')
|
||||||
@ -556,15 +576,9 @@ struct UserInfo {
|
|||||||
if (!Number(this.systemParam.Param305Str)) {
|
if (!Number(this.systemParam.Param305Str)) {
|
||||||
that.systemParam.Param305Str = '2'
|
that.systemParam.Param305Str = '2'
|
||||||
}
|
}
|
||||||
// console.log('Param305Str',that.systemParam.Param305Str)
|
|
||||||
// delHilog(this.Param305Str)
|
|
||||||
// delPic(that.systemParam.Param305Str,1)
|
|
||||||
// delPic(that.systemParam.Param305Str,2)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// faceParam?.[0]?.v_value ||
|
|
||||||
|
|
||||||
|
|
||||||
//0不自动更新 1自动更新(不限次数) 2没有考生更新2次
|
//0不自动更新 1自动更新(不限次数) 2没有考生更新2次
|
||||||
if (that.studentRefreshStatue == '2') {
|
if (that.studentRefreshStatue == '2') {
|
||||||
@ -596,14 +610,6 @@ struct UserInfo {
|
|||||||
// this.getExaminationItemFn()
|
// this.getExaminationItemFn()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// const db = new AccountTable(() => {
|
|
||||||
// }, MA_SYSSET);
|
|
||||||
// db.getRdbStore(() => {
|
|
||||||
// db.query('0', (syssetParams) => {
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//人脸比对窗口关闭
|
//人脸比对窗口关闭
|
||||||
@ -665,23 +671,28 @@ struct UserInfo {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.updateTimeLimit = false
|
this.updateTimeLimit = false
|
||||||
}, 3000)
|
}, 3000)
|
||||||
// @ts-ignore
|
|
||||||
if (!res || res?.getExaminationStudentInfoRsp?.head?.resultCode == '1') {
|
if (!res || res?.getExaminationStudentInfoRsp?.head?.resultCode == '1') {
|
||||||
this.dataList = []
|
this.dataList = []
|
||||||
this.list = []
|
this.list = []
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let dataList = []
|
let dataList: User[] = []
|
||||||
this.list = []
|
this.list = []
|
||||||
|
|
||||||
// @ts-ignore
|
// for (let key in res.getExaminationStudentInfoRsp.body) {
|
||||||
for (let key in res.getExaminationStudentInfoRsp.body) {
|
// const a = res.getExaminationStudentInfoRsp.body[key]
|
||||||
// @ts-ignore
|
// if (a instanceof Array) {
|
||||||
const a = res.getExaminationStudentInfoRsp.body[key]
|
// dataList = a
|
||||||
if (a instanceof Array) {
|
// } else {
|
||||||
dataList = a
|
// dataList = [a]
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
for (const key of Object.keys(res.getExaminationStudentInfoRsp.body)) {
|
||||||
|
const a: User[] | User = res.getExaminationStudentInfoRsp.body[key];
|
||||||
|
if (Array.isArray(a)) {
|
||||||
|
dataList = a;
|
||||||
} else {
|
} else {
|
||||||
dataList = [a]
|
dataList = [a];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dataList.length) {
|
if (dataList.length) {
|
||||||
@ -698,9 +709,10 @@ struct UserInfo {
|
|||||||
this.startExam = true
|
this.startExam = true
|
||||||
}
|
}
|
||||||
listData.id = index.toString()
|
listData.id = index.toString()
|
||||||
for (let i in listData) {
|
// TODO 需要修改
|
||||||
listData[i] = decodeURI(listData[i])
|
// for (let i in listData) {
|
||||||
}
|
// listData[i] = decodeURI(listData[i])
|
||||||
|
// }
|
||||||
if (this.systemParam.Param828Str == '1' || this.systemParam.Param828Str == '2') {
|
if (this.systemParam.Param828Str == '1' || this.systemParam.Param828Str == '2') {
|
||||||
// listData.ksy2=listData.ksy1;
|
// listData.ksy2=listData.ksy1;
|
||||||
listData.ksy2 = this.examinerLoginInfo.kgxm
|
listData.ksy2 = this.examinerLoginInfo.kgxm
|
||||||
@ -747,12 +759,13 @@ struct UserInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.pageIndex = 0
|
this.pageIndex = 0
|
||||||
getSyncData('USER').then(data => {
|
// getSyncData('USER').then(data => {
|
||||||
|
GetSyncData<User>("USER").then(data => {
|
||||||
if (data?.[0]) {
|
if (data?.[0]) {
|
||||||
this.getCurrentStudent(data[0].sfzmhm)
|
this.getCurrentStudent(data[0].sfzmhm)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}).catch((error) => {
|
}).catch((error: BusinessError) => {
|
||||||
this.updateTimeLimit = false
|
this.updateTimeLimit = false
|
||||||
this.errorDialog.close()
|
this.errorDialog.close()
|
||||||
console.log('error12error' + error)
|
console.log('error12error' + error)
|
||||||
@ -793,7 +806,6 @@ struct UserInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
globalThis.udpClient2.sendMsgExt(param, this.context)
|
globalThis.udpClient2.sendMsgExt(param, this.context)
|
||||||
// @ts-ignore
|
|
||||||
if (res.examinationStuAbsentRsp.head.resultCode == '0') {
|
if (res.examinationStuAbsentRsp.head.resultCode == '0') {
|
||||||
this.pageIndex = 0
|
this.pageIndex = 0
|
||||||
this.qkFlag = false
|
this.qkFlag = false
|
||||||
@ -811,15 +823,14 @@ struct UserInfo {
|
|||||||
if (!this.currentUser.lsh || this.singlePlay) {
|
if (!this.currentUser.lsh || this.singlePlay) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const { carId, examinationRoomId } = this.carInfo;
|
// const { carId, examinationRoomId } = this.carInfo;
|
||||||
const examItems = await getExaminationItem({
|
const examItems = await getExaminationItem({
|
||||||
time: getCurrentTime(),
|
time: await getCurrentTime() || "",
|
||||||
carId,
|
carId: this.carInfo.carId,
|
||||||
lsh: this.currentUser.lsh || '',
|
lsh: this.currentUser.lsh || '',
|
||||||
examinationRoomId
|
examinationRoomId: this.carInfo.examinationRoomId
|
||||||
});
|
});
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
if (examItems?.getExaminationItemRsp?.body?.kssycs != 0) {
|
if (examItems?.getExaminationItemRsp?.body?.kssycs != 0) {
|
||||||
this.getExaminationStudentInfoFn()
|
this.getExaminationStudentInfoFn()
|
||||||
} else {
|
} else {
|
||||||
@ -832,16 +843,14 @@ struct UserInfo {
|
|||||||
async sfbdinterfaceFn() {
|
async sfbdinterfaceFn() {
|
||||||
AppStorage.setOrCreate('statue', 4)
|
AppStorage.setOrCreate('statue', 4)
|
||||||
this.stepFlag = true
|
this.stepFlag = true
|
||||||
const { carId, examinationRoomId } = this.carInfo;
|
let examItems: GetExaminationItemRsp = { getExaminationItemRsp: { body: { ykxx: '' } } };
|
||||||
let examItems = { getExaminationItemRsp: { body: { ykxx: '' } } };
|
|
||||||
if (!this.singlePlay) {
|
if (!this.singlePlay) {
|
||||||
//获取已考项目
|
//获取已考项目
|
||||||
// @ts-ignore
|
|
||||||
examItems = await getExaminationItem({
|
examItems = await getExaminationItem({
|
||||||
time: getCurrentTime(),
|
time: await getCurrentTime(),
|
||||||
carId,
|
carId: this.carInfo.carId,
|
||||||
lsh: this.currentUser.lsh || '',
|
lsh: this.currentUser.lsh || '',
|
||||||
examinationRoomId
|
examinationRoomId: this.carInfo.examinationRoomId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.currentUser.id = '1'
|
this.currentUser.id = '1'
|
||||||
@ -850,17 +859,17 @@ struct UserInfo {
|
|||||||
|
|
||||||
avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => {
|
avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => {
|
||||||
console.info('surenjun', '播放结束开始考试接口调用')
|
console.info('surenjun', '播放结束开始考试接口调用')
|
||||||
const { code, keystr, message } = await this.beginExam() || {};
|
// const { code, keystr, message } = await this.beginExam() || {};
|
||||||
|
const res = await this.beginExam()
|
||||||
console.info('surenjun', '开始考试接口调用结束')
|
console.info('surenjun', '开始考试接口调用结束')
|
||||||
// console.info('surenjun',code +'')
|
//TODO code转换
|
||||||
//@ts-ignore TODO code转换
|
|
||||||
|
|
||||||
if (code != 1) {
|
if (res.code != 1) {
|
||||||
avPlayer.playAudio([code == -200 ? 'voice/photo_error.mp3' : 'voice/监管审核未通过.mp3']);
|
avPlayer.playAudio([res.code == -200 ? 'voice/photo_error.mp3' : 'voice/监管审核未通过.mp3']);
|
||||||
this.isLoadingPopupVisible = false
|
this.isLoadingPopupVisible = false
|
||||||
this.isExamStart = false
|
this.isExamStart = false
|
||||||
promptAction.showToast({
|
promptAction.showToast({
|
||||||
message,
|
message: res.message,
|
||||||
duration: 4000
|
duration: 4000
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
@ -876,7 +885,7 @@ struct UserInfo {
|
|||||||
sczb: Number(this.isBoardPrePareSetPopupOpen),
|
sczb: Number(this.isBoardPrePareSetPopupOpen),
|
||||||
kfdm: this.sczbkf,
|
kfdm: this.sczbkf,
|
||||||
//真实监管项目
|
//真实监管项目
|
||||||
kString: decodeURIComponent(keystr || '')
|
kString: decodeURIComponent(res.keystr || '')
|
||||||
}
|
}
|
||||||
}, router.RouterMode.Single);
|
}, router.RouterMode.Single);
|
||||||
this.updateTimeLimit = false
|
this.updateTimeLimit = false
|
||||||
@ -887,19 +896,21 @@ struct UserInfo {
|
|||||||
|
|
||||||
// 检测车门、熄火信号
|
// 检测车门、熄火信号
|
||||||
async checkSignal(): Promise<boolean> {
|
async checkSignal(): Promise<boolean> {
|
||||||
const { isCheckFireOpen } = judgeConfig
|
// const { isCheckFireOpen } = judgeConfig
|
||||||
const { systemParam, isBoardPrePareSetPopupOpen } = this;
|
// const { systemParam } = this;
|
||||||
const Param803Str = systemParam.Param803Str
|
const Param803Str = this.systemParam.Param803Str
|
||||||
if (Param803Str === '') {
|
if (Param803Str === '') {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (isCheckFireOpen) {
|
if (judgeConfig.isCheckFireOpen) {
|
||||||
resolve(true)
|
resolve(true)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let plcValue = globalThis.udpClient.getCurrentMessage();
|
// TODO UDP缺失
|
||||||
const msgArr = plcValue.split(',') || ''
|
// let plcValue = globalThis.udpClient.getCurrentMessage();
|
||||||
|
let plcValue = "";
|
||||||
|
const msgArr = plcValue.split(',').map(Number) || ''
|
||||||
const mkg = msgArr[14];
|
const mkg = msgArr[14];
|
||||||
const fdjzs = msgArr[25];
|
const fdjzs = msgArr[25];
|
||||||
const aqd = msgArr[19];
|
const aqd = msgArr[19];
|
||||||
@ -947,7 +958,7 @@ struct UserInfo {
|
|||||||
|
|
||||||
}
|
}
|
||||||
//请点火
|
//请点火
|
||||||
if (fdjzs * 1 <= 0 && Param803Str.includes('5')) {
|
if (fdjzs <= 0 && Param803Str.includes('5')) {
|
||||||
this.avPlayer.playAudio(['voice/点火.mp3'])
|
this.avPlayer.playAudio(['voice/点火.mp3'])
|
||||||
promptAction.showToast({
|
promptAction.showToast({
|
||||||
message: '请点火',
|
message: '请点火',
|
||||||
@ -969,7 +980,7 @@ struct UserInfo {
|
|||||||
// if (isBoardPrePareSetPopupOpen) {
|
// if (isBoardPrePareSetPopupOpen) {
|
||||||
if (false) {
|
if (false) {
|
||||||
//请熄火
|
//请熄火
|
||||||
if (fdjzs * 1 > 0) {
|
if (fdjzs > 0) {
|
||||||
this.avPlayer.playAudio(['voice/熄火.mp3'])
|
this.avPlayer.playAudio(['voice/熄火.mp3'])
|
||||||
promptAction.showToast({
|
promptAction.showToast({
|
||||||
message: '请熄火',
|
message: '请熄火',
|
||||||
@ -991,9 +1002,8 @@ struct UserInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 开始考试
|
// 开始考试
|
||||||
async beginExam() {
|
async beginExam(): Promise<BeginExamRequest> {
|
||||||
const { carId, examinationRoomId } = this.carInfo;
|
// const { examSubject, plateNo } = this.carInfo;
|
||||||
const { examSubject, plateNo } = this.carInfo;
|
|
||||||
const date = new Date()
|
const date = new Date()
|
||||||
const startHourTime = await getCurrentHourTime()
|
const startHourTime = await getCurrentHourTime()
|
||||||
AppStorage.setOrCreate('startHourTime', startHourTime)
|
AppStorage.setOrCreate('startHourTime', startHourTime)
|
||||||
@ -1003,19 +1013,19 @@ struct UserInfo {
|
|||||||
this.isLoadingPopupVisible = false
|
this.isLoadingPopupVisible = false
|
||||||
return { code: -200 }
|
return { code: -200 }
|
||||||
}
|
}
|
||||||
const drvexam = {
|
const drvexam: DrvexamType = {
|
||||||
lsh: this.currentUser.lsh || '',
|
lsh: "this.currentUser.lsh",
|
||||||
kskm: examSubject,
|
kskm: this.carInfo.examSubject,
|
||||||
ksxtbh: this.ksxtbh || '222',
|
ksxtbh: this.ksxtbh || '222',
|
||||||
sfzmhm: this.currentUser.sfzmhm || '',
|
sfzmhm: this.currentUser.sfzmhm || '',
|
||||||
ksysfzmhm: this.currentUser.ksy1sfzmhm || '',
|
ksysfzmhm: this.currentUser.ksy1sfzmhm || '',
|
||||||
ksxl: this.currentUser.xldm,
|
ksxl: this.currentUser.xldm,
|
||||||
zp: photoBase64,
|
zp: photoBase64,
|
||||||
kssj: dateFormat(date) || '',
|
kssj: dateFormat(date) || '',
|
||||||
kchp: decodeURI(plateNo),
|
kchp: decodeURI(this.carInfo.plateNo),
|
||||||
Ksy2sfzmhm: this.currentUser.ksy2sfzmhm || ''
|
Ksy2sfzmhm: this.currentUser.ksy2sfzmhm || ''
|
||||||
}
|
}
|
||||||
const param = {
|
const param: RegulatoryInterfaceParams = {
|
||||||
drvexam,
|
drvexam,
|
||||||
xtlb: '17',
|
xtlb: '17',
|
||||||
//接口序列号
|
//接口序列号
|
||||||
@ -1039,7 +1049,7 @@ struct UserInfo {
|
|||||||
this.currentUser.id = '0'
|
this.currentUser.id = '0'
|
||||||
DB.insertData("USER", this.currentUser).then(res => {
|
DB.insertData("USER", this.currentUser).then(res => {
|
||||||
console.log("USER insert success",)
|
console.log("USER insert success",)
|
||||||
}).catch(err => {
|
}).catch((err: BusinessError) => {
|
||||||
console.log("USER insert fail", JSON.stringify(err))
|
console.log("USER insert fail", JSON.stringify(err))
|
||||||
})
|
})
|
||||||
// await upDateTableByArray('USER', [this.currentUser])
|
// await upDateTableByArray('USER', [this.currentUser])
|
||||||
@ -1062,8 +1072,9 @@ struct UserInfo {
|
|||||||
outClick() {
|
outClick() {
|
||||||
clearInterval(this.interval)
|
clearInterval(this.interval)
|
||||||
this.stopDeviceById()
|
this.stopDeviceById()
|
||||||
globalThis.udpClient2 && globalThis.udpClient2?.setMsgCallBack(() => {
|
// TODO 缺失UDP
|
||||||
})
|
// globalThis.udpClient2 && globalThis.udpClient2?.setMsgCallBack(() => {
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 几个按钮公共样式
|
// 几个按钮公共样式
|
||||||
@ -1082,7 +1093,7 @@ struct UserInfo {
|
|||||||
TopLogo({ outFlag: $outFlag }).margin({ bottom: 10 })
|
TopLogo({ outFlag: $outFlag }).margin({ bottom: 10 })
|
||||||
Row() {
|
Row() {
|
||||||
Row() {
|
Row() {
|
||||||
ForEach(this.dataList, (item) => {
|
ForEach(this.dataList, (item: User) => {
|
||||||
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||||
Column() {
|
Column() {
|
||||||
CommText({
|
CommText({
|
||||||
@ -1137,10 +1148,10 @@ struct UserInfo {
|
|||||||
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
|
Flex({ justifyContent: FlexAlign.SpaceBetween }) {
|
||||||
Row() {
|
Row() {
|
||||||
Column() {
|
Column() {
|
||||||
if (this.currentUser['kszp']) {
|
if (this.currentUser.kszp) {
|
||||||
Avatar({
|
Avatar({
|
||||||
ratio: this.ratio,
|
ratio: this.ratio,
|
||||||
url: this.currentUser['kszp'] ? this.currentUser['kszp'] : ''
|
url: this.currentUser.kszp ? this.currentUser.kszp : ''
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Avatar({
|
Avatar({
|
||||||
@ -1148,10 +1159,10 @@ struct UserInfo {
|
|||||||
url: ""
|
url: ""
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (this.currentUser['ksmjzp']) {
|
if (this.currentUser.ksmjzp) {
|
||||||
Avatar({
|
Avatar({
|
||||||
ratio: this.ratio,
|
ratio: this.ratio,
|
||||||
url: this.currentUser['ksmjzp'] ? this.currentUser['ksmjzp'] : ''
|
url: this.currentUser.ksmjzp ? this.currentUser.ksmjzp : ''
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -1163,8 +1174,12 @@ struct UserInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Column() {
|
Column() {
|
||||||
ForEach(this.labelBlocks, (item) => {
|
ForEach(this.labelBlocks, (item: LabelBlockType) => {
|
||||||
LabelBlock({ label: item.label, ratio: this.ratio, value: this.currentUser[item.key] })
|
LabelBlock({
|
||||||
|
label: item.label,
|
||||||
|
ratio: this.ratio,
|
||||||
|
value: GetCurrentUserKeyValue(this.currentUser, item.key)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1284,10 +1299,10 @@ struct UserInfo {
|
|||||||
// 上车准备弹窗
|
// 上车准备弹窗
|
||||||
if (this.isBoardPrePareSetPopupShow) {
|
if (this.isBoardPrePareSetPopupShow) {
|
||||||
BoardPrePareSetPopup({
|
BoardPrePareSetPopup({
|
||||||
closePopup: (bool) => {
|
closePopup: () => {
|
||||||
this.isBoardPrePareSetPopupShow = false;
|
this.isBoardPrePareSetPopupShow = false;
|
||||||
},
|
},
|
||||||
confirmMark: (kfdm) => {
|
confirmMark: (kfdm: SckType[]) => {
|
||||||
this.sczbkf = kfdm
|
this.sczbkf = kfdm
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
54
entry/src/main/ets/pages/UserInfo/utils.ets
Normal file
54
entry/src/main/ets/pages/UserInfo/utils.ets
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
import { User } from "../../model";
|
||||||
|
|
||||||
|
export const GetCurrentUserKeyValue = (user: User, key: string): string => {
|
||||||
|
switch (key) {
|
||||||
|
case "sfzmhm":
|
||||||
|
return user.sfzmhm;
|
||||||
|
case "xm":
|
||||||
|
return user.xm;
|
||||||
|
case "lsh":
|
||||||
|
return user.lsh;
|
||||||
|
case "ksy1":
|
||||||
|
return user.ksy1;
|
||||||
|
case "ksy2":
|
||||||
|
return user.ksy2;
|
||||||
|
case "id":
|
||||||
|
return user.id;
|
||||||
|
case "kszp":
|
||||||
|
return user.kszp;
|
||||||
|
case "ksmjzp":
|
||||||
|
return user.ksmjzp;
|
||||||
|
case "bz1":
|
||||||
|
return user.bz1;
|
||||||
|
case "jxmc":
|
||||||
|
return user.jxmc;
|
||||||
|
case "kchp":
|
||||||
|
return user.kchp;
|
||||||
|
case "kscx":
|
||||||
|
return user.kscx;
|
||||||
|
case "ksdd":
|
||||||
|
return user.ksdd;
|
||||||
|
case "kssycs":
|
||||||
|
return user.kssycs;
|
||||||
|
case "ksxl":
|
||||||
|
return user.ksxl;
|
||||||
|
case "ksy1sfzmhm":
|
||||||
|
return user.ksy1sfzmhm;
|
||||||
|
case "kszt":
|
||||||
|
return user.kszt;
|
||||||
|
case "xb":
|
||||||
|
return user.xb;
|
||||||
|
case "xh":
|
||||||
|
return user.xh;
|
||||||
|
case "xldm":
|
||||||
|
return user.xldm;
|
||||||
|
case "yycs":
|
||||||
|
return user.yycs;
|
||||||
|
case "ksy2sfzmhm":
|
||||||
|
return user.ksy2sfzmhm;
|
||||||
|
case "kslx":
|
||||||
|
return user.kslx || '';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -12,15 +12,6 @@ class UdpClient {
|
|||||||
private disconnectEvents: Array<Function> = []
|
private disconnectEvents: Array<Function> = []
|
||||||
private dealMethod: DealMethod
|
private dealMethod: DealMethod
|
||||||
|
|
||||||
private dealMessage() {
|
|
||||||
this.udp?.on("message", value => {
|
|
||||||
let result = this?.dealMethod(value.message)
|
|
||||||
this.messageEvents.forEach(cb => {
|
|
||||||
cb(result)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
init(udpLocalIp: string, udpLocalIpPort: string, udpOppositeIp: string, udpOppositeIpPort: string) {
|
init(udpLocalIp: string, udpLocalIpPort: string, udpOppositeIp: string, udpOppositeIpPort: string) {
|
||||||
this.localIp = udpLocalIp
|
this.localIp = udpLocalIp
|
||||||
this.oppositeIp = udpOppositeIp
|
this.oppositeIp = udpOppositeIp
|
||||||
@ -70,12 +61,25 @@ class UdpClient {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private dealMessage() {
|
||||||
|
this.udp?.on("message", value => {
|
||||||
|
let result = this?.dealMethod(value.message)
|
||||||
|
this.messageEvents.forEach(cb => {
|
||||||
|
cb(result)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const objUDPClient = new UdpClient()
|
export const objUDPClient = new UdpClient()
|
||||||
|
|
||||||
|
// 中心心跳
|
||||||
export const centerUDPClient = new UdpClient()
|
export const centerUDPClient = new UdpClient()
|
||||||
|
|
||||||
|
// 中心GPS
|
||||||
|
// 顶灯
|
||||||
export const lightUDPClient = new UdpClient()
|
export const lightUDPClient = new UdpClient()
|
||||||
|
|
||||||
|
// 获取后置机信号
|
||||||
export const judgeUDPClient = new UdpClient()
|
export const judgeUDPClient = new UdpClient()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user