fix: 修改部分文件

This commit is contained in:
wangzhongjie 2025-02-18 10:47:28 +08:00
parent 24c1a22168
commit f041e2a8bb
11 changed files with 75 additions and 110 deletions

View File

@ -11,7 +11,7 @@ import {
getMySystemSetTable,
upDataZhongxinginitialization,
upDateTable
} from '../../common/service/initable'
} from './initable'
import { GlobalConfig } from '../../config/index'
import testNapi from '@ohos.hiserialsdk'
import fs from '@ohos.file.fs';
@ -280,6 +280,7 @@ export async function takePhotoFn(context) {
let fd
const devPath = "/dev/ttyS3"
let chuankoufd
function openChuankouFn(callback) {
console.log('SerialOpen in indexservice, path=' + devPath)

View File

@ -30,7 +30,6 @@ import FileUtil from '../../common/utils/File';
import { GlobalConfig } from '../../config/index';
import prompt from '@ohos.promptAction';
import DB, { ColumnType } from '../database/DbSql';
import App from '@system.app';
//读表
//参数平台
@ -123,57 +122,6 @@ export function sqlInsertCommonFn(tableName, resultArr, delFlag = true) {
reject(err)
})
})
// const accountTable = new AccountTable(() => {
// accountTable.query('0', async (result) => {
// console.log('表长度', result.length, tableName)
// if (result.length == 0 || !delFlag) {
// console.log('sqlsqlinsert', resultArr.length)
// if (resultArr.length == 0) {
// resolve(true)
// return
// }
// let INSERT_SQL = "INSERT INTO " + tableName
// + " (" + map[tableName].ACCOUNT_TABLE.columns.toString() + ") VALUES "
//
// resultArr.map((data, i) => {
// data.id = !delFlag ? `${i + result.length}` : `${i}`
// let str = '('
// map[tableName].ACCOUNT_TABLE.columns.map((res, index) => {
// if (map[tableName].ACCOUNT_TABLE.columns.length - 1 == index) {
// str += data[res] ? `'${data[res]}'` : 'NULL'
// } else {
// str += (data[res] ? `'${data[res]}'` : 'NULL') + ','
// }
// })
// if (i == resultArr.length - 1) {
// str += ')'
// } else {
// str += '),'
// }
// INSERT_SQL += str
// })
// console.log('sqlsINSERT_SQLINSERT_SQL', INSERT_SQL)
// accountTable.sqlOperate(INSERT_SQL, tableName, (val) => {
// console.log('teststet3', val, tableName)
//
// console.log('sqlsqlinsert,', val, 'tableName', tableName)
// resolve(val)
// })
// }
// else {
// if (delFlag) {
// console.log("sql message 删除表")
// await delSyncTable(tableName, context)
// const result = await sqlInsertCommonFn(tableName, resultArr, context)
// resolve(result)
// return
// }
// const result = await sqlInsertCommonFn(tableName, resultArr, context)
// resolve(result)
// }
// }, true);
// }, map[tableName], context);
})
}

View File

@ -14,6 +14,10 @@ export interface CarConfigurationParamsType {
type: string;
}
export interface CarConfigurationParams {
body: Record<string, string>;
}
export interface CarInfoType {
carId?: string;
examinationRoomId?: string;

View File

@ -0,0 +1,9 @@
export interface MASYSTEMPARMType {
id: string;
no1: number;
no2: number;
no3: number;
txt1: string;
txt2: string;
txt3: string;
}

View File

@ -15,3 +15,5 @@ export * from "./UserInfo"
export * from "./CarCheck"
export * from "./api"
export * from "./TableColumn"

View File

@ -5,7 +5,7 @@ import TopLogo from './compontents/TopLogo';
import testNapi from '@ohos.hiserialsdk';
import { dateFormat } from '../common/utils/tools';
import { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock';
import { baseInfo } from '../model/Common';
import { BaseInfoType } from '../model/Common';
import { CarCheckDataType, CarConfigurationParams, CarInfoType } from '../model/CarCheck';
import { BusinessError } from '@ohos.base';
@ -136,7 +136,7 @@ struct Index {
this.checkListCopy = JSON.parse(JSON.stringify(this.checkList))
return
}
const baseInfo = AppStorage.get('baseInfo') as baseInfo
const baseInfo = AppStorage.get('baseInfo') as BaseInfoType
//模拟真实数据
const param: CarConfigurationParams = {
body: {
@ -262,16 +262,16 @@ struct Index {
this.zjFlag = true
let flag = false
for (let item in this.warnFlag) {
if (this.warnFlag[item] == '1') {
flag = true
}
}
// Object.keys(this.warnFlag).map((key) => {
// if (this.warnFlag[key] == '0') {
// for (let item in this.warnFlag) {
// if (this.warnFlag[item] == '1') {
// flag = true
// }
// })
// }
Object.keys(this.warnFlag).forEach((item) => {
if (this.warnFlag[item] === '1') {
flag = true;
}
});
this.vocObj.playAudio({
type: 1,
name: flag ? 'zjwtg.wav' : 'zjtg.wav'

View File

@ -3,7 +3,6 @@ import TopLogo from './compontents/TopLogo';
import Md5 from '../common/utils/md5';
import promptAction from '@ohos.promptAction';
import errorMsgDialog from './compontents/errorMsgDialog';
// import { voiceService } from '../common/service/voiceService';
import imageBtn from './compontents/imageBtn';
import { UserLoginType } from '../model/ExaminerLogin';
import { BusinessError } from '@ohos.base';

View File

@ -18,7 +18,7 @@ import UdpEvent from '../common/utils/UdpEvent';
import { delPic } from '../service/videoService';
import imageBtn from './compontents/imageBtn';
import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
import { baseInfo } from '../model/Common';
import { BaseInfoType } from '../model/Common';
import { CarCheckDataType } from '../model/CarCheck';
// import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
@ -32,7 +32,7 @@ struct Index {
@State hasAuth: boolean = false;
@State dialogVisiable: boolean = false;
@State singlePlay: boolean = false;
@State baseInfo: baseInfo = {};
@State baseInfo: BaseInfoType = {};
@State deviceId: string = '';
@State angle: number = 0
@State dialogRatio: number = 0.8

View File

@ -1,6 +1,7 @@
import TopLogo from './compontents/TopLogo';
import { getSyncData } from '../common/service/initable';
import router from '@ohos.router';
import { MASYSTEMPARMType } from '../model';
const cBg = $rawfile('judge/km3/road/luxian_pre.png');
const lBg = $rawfile('judge/km3/road/luxian_nor.png');
@ -12,16 +13,16 @@ const ltBg = $rawfile('judge/km3/road/luxian_nor.png');
@Component
struct Index {
@State @Watch('outClick') outFlag: boolean = false;
@State roadObj: any = {}
@State roadObj: ESObject = {}
async aboutToAppear() {
//读取systemparam表的no1等于4的
const systemParms: any = await getSyncData('MA_SYSTEMPARM')
systemParms.forEach((systemParm) => {
const systemParms: Array<MASYSTEMPARMType> = await getSyncData('MA_SYSTEMPARM') as MASYSTEMPARMType[];
systemParms.forEach((systemParm: MASYSTEMPARMType) => {
//TODO 字段名称待修改
const { no1, no2, no3, txt1, txt2 } = systemParm;
if (no1 == 4) {
this.roadObj[no2] = no2
// const { no1, no2, no3, txt1, txt2 } = systemParm;
if (systemParm.no1 == 4) {
this.roadObj[systemParm.no2] = systemParm.no2
}
})
}

View File

@ -22,6 +22,7 @@ import imageBtn from './compontents/imageBtn';
import FileUtil from '../common/utils/File';
import DB, { ColumnType } from '../common/database/DbSql';
import { LabelBlockType, QKParamType, SckType, SystemParamType, User } from '../model';
import { BusinessError } from '@ohos.base';
@Entry
@Component
@ -103,11 +104,11 @@ struct UserInfo {
this.ksksLimit = true
if (this.singlePlay) {
const { examSubject } = this.carInfo;
// const { examSubject } = this.carInfo;
this.currentUser.id = '0'
await upDateTableByArray('USER', [this.currentUser])
router.pushUrl({
url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
url: this.carInfo.examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
params: {
sczb: Number(this.isBoardPrePareSetPopupOpen),
kfdm: this.sczbkf,
@ -788,7 +789,7 @@ struct UserInfo {
this.getExaminationStudentInfoFn()
return
}
}).catch((error) => {
}).catch((error: BusinessError) => {
console.log('error12error' + error)
})