fix: 过程数据关闭
This commit is contained in:
		
							parent
							
								
									d8be9c6540
								
							
						
					
					
						commit
						06ad18fccb
					
				| @ -1,5 +1,5 @@ | |||||||
| { | { | ||||||
|   "lockfileVersion": 1, |   "lockfileVersion": 2, | ||||||
|   "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", |   "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", | ||||||
|   "specifiers": {}, |   "specifiers": {}, | ||||||
|   "packages": {} |   "packages": {} | ||||||
|  | |||||||
| @ -752,7 +752,6 @@ export class BaseJudge { | |||||||
| 
 | 
 | ||||||
|   async judgeEnd(judgeUI: JudgePage, that: JudgeBusiness, isManual?: boolean) { |   async judgeEnd(judgeUI: JudgePage, that: JudgeBusiness, isManual?: boolean) { | ||||||
|     dConsole.info(JudgeTag, '收到远程结束考试消息3') |     dConsole.info(JudgeTag, '收到远程结束考试消息3') | ||||||
|     dConsole.closeProcessData() |  | ||||||
|     const isAllProjectsEnd = judgeUI.isAllProjectsEnd |     const isAllProjectsEnd = judgeUI.isAllProjectsEnd | ||||||
|     const examSubject = judgeUI.examSubject |     const examSubject = judgeUI.examSubject | ||||||
|     const singlePlay = judgeUI.singlePlay |     const singlePlay = judgeUI.singlePlay | ||||||
|  | |||||||
| @ -219,6 +219,7 @@ struct UserInfoPage { | |||||||
|   ] |   ] | ||||||
| 
 | 
 | ||||||
|   async onPageShow() { |   async onPageShow() { | ||||||
|  |     dConsole.closeProcessData() | ||||||
|     this.avPlayer = new VoiceAnnounce(this.context); |     this.avPlayer = new VoiceAnnounce(this.context); | ||||||
|     this.isExamStart = false |     this.isExamStart = false | ||||||
|     this.startExam = false |     this.startExam = false | ||||||
| @ -1183,6 +1184,7 @@ struct UserInfoPage { | |||||||
|               .onClick(() => { |               .onClick(() => { | ||||||
|                 if ((this.systemParam.Param352Str == '1' && this.currentUser.kssycs == '1') || |                 if ((this.systemParam.Param352Str == '1' && this.currentUser.kssycs == '1') || | ||||||
|                   this.systemParam.Param770Str == '1') { |                   this.systemParam.Param770Str == '1') { | ||||||
|  |                   dConsole.log(UserInfoTag, '不允许缺考') | ||||||
|                   return |                   return | ||||||
|                 } |                 } | ||||||
|                 // this.qkFlag = true |                 // this.qkFlag = true | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| // 日志向外暴露的方法 | // 日志向外暴露的方法 | ||||||
| import worker from '@ohos.worker'; | import worker from '@ohos.worker'; | ||||||
| import { GlobalConfig } from '../config'; | import { GlobalConfig, LogTag } from '../config'; | ||||||
| import { LogWorkerMessage, ProcessDataEnumType, WorkerMessageType } from '../model/index'; | import { LogWorkerMessage, ProcessDataEnumType, WorkerMessageType } from '../model/index'; | ||||||
| import dayTs from './Date'; | import dayTs from './Date'; | ||||||
| 
 | 
 | ||||||
| @ -87,13 +87,12 @@ class logWorker { | |||||||
| 
 | 
 | ||||||
|   // 关闭过程数据写入 |   // 关闭过程数据写入 | ||||||
|   closeProcessData() { |   closeProcessData() { | ||||||
|  |     dConsole.log(LogTag, "关闭过程数据1") | ||||||
|     let params: LogWorkerMessage = { |     let params: LogWorkerMessage = { | ||||||
|       type: WorkerMessageType.CloseProcessData, |       type: WorkerMessageType.CloseProcessData, | ||||||
|     } |     } | ||||||
|     if (this.isLogEnabled === "1") { |  | ||||||
|     this.workerInstance?.postMessage(JSON.stringify(params)) |     this.workerInstance?.postMessage(JSON.stringify(params)) | ||||||
|   } |   } | ||||||
|   } |  | ||||||
| 
 | 
 | ||||||
|   // 通用日志方法 |   // 通用日志方法 | ||||||
|   private logWithLevel(level: 'log' | 'info' | 'error' | 'low', ...args: ESObject[]): void { |   private logWithLevel(level: 'log' | 'info' | 'error' | 'low', ...args: ESObject[]): void { | ||||||
|  | |||||||
| @ -33,6 +33,7 @@ workerPort.onmessage = (e: MessageEvents) => { | |||||||
|   } |   } | ||||||
|   //   关闭过程数据 |   //   关闭过程数据 | ||||||
|   if (result.type === WorkerMessageType.CloseProcessData) { |   if (result.type === WorkerMessageType.CloseProcessData) { | ||||||
|  |     console.log(LogTag, "关闭过程数据") | ||||||
|     CloseProcessData() |     CloseProcessData() | ||||||
|   } |   } | ||||||
| } | } | ||||||
| @ -113,10 +114,12 @@ async function processQueue() { | |||||||
| 
 | 
 | ||||||
| // 关闭过程数据 | // 关闭过程数据 | ||||||
| function CloseProcessData() { | function CloseProcessData() { | ||||||
|  |   if (fileFdArr.length > 0) { | ||||||
|  |     console.log(LogTag, "有文件需要 关闭过程数据") | ||||||
|     fileFdArr.forEach((item: number) => { |     fileFdArr.forEach((item: number) => { | ||||||
|       fs.closeSync(item) |       fs.closeSync(item) | ||||||
|     }) |     }) | ||||||
|   console.log(LogTag, "关闭过程数据") |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| workerPort.onmessageerror = (e: MessageEvents) => { | workerPort.onmessageerror = (e: MessageEvents) => { | ||||||
|  | |||||||
| @ -1,18 +1,20 @@ | |||||||
| { | { | ||||||
|   "lockfileVersion": 1, |   "lockfileVersion": 2, | ||||||
|   "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", |   "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", | ||||||
|   "specifiers": { |   "specifiers": { | ||||||
|     "@ohos/crypto-js@2.0.3": "@ohos/crypto-js@2.0.3", |     "@ohos/hypium@1.0.19": "@ohos/hypium@1.0.19", | ||||||
|     "@ohos/hypium@1.0.19": "@ohos/hypium@1.0.19" |     "@ohos/crypto-js@2.0.3": "@ohos/crypto-js@2.0.3" | ||||||
|   }, |   }, | ||||||
|   "packages": { |   "packages": { | ||||||
|     "@ohos/crypto-js@2.0.3": { |  | ||||||
|       "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/crypto-js/-/crypto-js-2.0.3.har", |  | ||||||
|       "integrity": "sha512-LuHaR1kD5PxnOXnuR1fWvPwGtbed9Q/QGzk6JOh8y5Wdzvi8brPesODZiaWf9scOVRHsbTPOtZw91vWB35p1vQ==" |  | ||||||
|     }, |  | ||||||
|     "@ohos/hypium@1.0.19": { |     "@ohos/hypium@1.0.19": { | ||||||
|       "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.19.har", |       "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.19.har", | ||||||
|       "integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==" |       "integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==", | ||||||
|  |       "registryType": "ohpm" | ||||||
|  |     }, | ||||||
|  |     "@ohos/crypto-js@2.0.3": { | ||||||
|  |       "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/crypto-js/-/crypto-js-2.0.3.har", | ||||||
|  |       "integrity": "sha512-LuHaR1kD5PxnOXnuR1fWvPwGtbed9Q/QGzk6JOh8y5Wdzvi8brPesODZiaWf9scOVRHsbTPOtZw91vWB35p1vQ==", | ||||||
|  |       "registryType": "ohpm" | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user