From 50c9093256bbb32cc450db8c25f23d13fd1ef475 Mon Sep 17 00:00:00 2001 From: lixiao <932184220@qq.com> Date: Thu, 10 Apr 2025 08:57:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/api/judge.ets | 53 ++++++++++++---------- entry/src/main/ets/pages/TerminalInfos.ets | 1 + entry/src/main/ets/utils/DbSql.ets | 4 +- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/entry/src/main/ets/api/judge.ets b/entry/src/main/ets/api/judge.ets index cb10de62..3bf30d9e 100644 --- a/entry/src/main/ets/api/judge.ets +++ b/entry/src/main/ets/api/judge.ets @@ -60,10 +60,13 @@ export async function writeObjectOut(params: RegulatoryInterfaceParams, filePath params.drvexam = params.drvexam ?? {}; params.drvexam.zp = params.drvexam.zp === undefined ? undefined : encodeURIComponent(params.drvexam.zp); - const drvexamArrs = Reflect.ownKeys(params.drvexam) - .filter(dKey => Reflect.get(params.drvexam, dKey) != undefined) - .map((key: string) => ( - `<${key}>${Reflect.get(params.drvexam, key)}`)); + const drvexamArrs = Object.entries(params.drvexam) + .filter((item: [string, string]) => item[1] != undefined) + .map((item: [string, object]) => `<${item[0]}>${item[1]}`) + // const drvexamArrs = Reflect.ownKeys(params.drvexam) + // .filter(dKey => Reflect.get(params.drvexam, dKey) != undefined) + // .map((key: string) => ( + // `<${key}>${Reflect.get(params.drvexam, key)}`)); if (filePath) { const fileUtil = new FileUtils(context); @@ -237,27 +240,27 @@ export async function uploadExamMileage(params: UploadExamMileage) { } // 上传考试成绩 -export async function uploadExamGrade(params: ESObject) { - // const singlePlay = globalThis.singlePlay - const singlePlay: boolean = AppStorage.get('singlePlay') || false - if (singlePlay) { - return - } - const paramsArrs = Reflect.ownKeys(params).map((key: string) => (`<${key}>${params[key]}`)) - const time = GetCurrentTime() - return request({ - url: '/der2/services/exam/uploadExamGrade.ws', - data: ` - - - - ${paramsArrs} - - `, - method: http.RequestMethod.POST, - xml: true - }) -} +// export async function uploadExamGrade(params: ESObject) { +// // const singlePlay = globalThis.singlePlay +// const singlePlay: boolean = AppStorage.get('singlePlay') || false +// if (singlePlay) { +// return +// } +// const paramsArrs = Reflect.ownKeys(params).map((key) => (`<${key}>${params[key]}`)) +// const time = GetCurrentTime() +// return request({ +// url: '/der2/services/exam/uploadExamGrade.ws', +// data: ` +// +// +// +// ${paramsArrs} +// +// `, +// method: http.RequestMethod.POST, +// xml: true +// }) +// } function validateIP(path: string) { const reg = new RegExp(`(\w+):\/\/([^/:]+)(:\d*)?`) diff --git a/entry/src/main/ets/pages/TerminalInfos.ets b/entry/src/main/ets/pages/TerminalInfos.ets index 3d919018..f34ec6ad 100644 --- a/entry/src/main/ets/pages/TerminalInfos.ets +++ b/entry/src/main/ets/pages/TerminalInfos.ets @@ -101,6 +101,7 @@ struct Index { gateway: this.inputTextList1[5], //value.gateway网关 netMask: this.inputTextList1[4], //value.netMask网络掩码 dnsServers: this.inputTextList1[6], + domain: "" }, (error: BusinessError) => { if (error) { Prompt.showToast({ diff --git a/entry/src/main/ets/utils/DbSql.ets b/entry/src/main/ets/utils/DbSql.ets index b9a8a958..f29f41fd 100644 --- a/entry/src/main/ets/utils/DbSql.ets +++ b/entry/src/main/ets/utils/DbSql.ets @@ -187,7 +187,7 @@ class DbUtils { } // - parseResultSet(result: relationalStore.ResultSet, columns: ColumnInfo[]): T[] { + parseResultSet(result: relationalStore.ResultSet, columns: ColumnInfo[]): T[] { // 1.声明最终返回的结果 let arr: T[] = []; // 2.判断是否有结果 @@ -199,7 +199,7 @@ class DbUtils { // 3.1.去下一行 result.goToNextRow(); // 3.2.解析这行数据,转为对象 - let obj: Record = {}; + let obj: object = new Object(); columns.forEach(info => { let val: string | number; switch (info.type) {