彈框userlist修改
This commit is contained in:
		
							parent
							
								
									fb8e7bc7c5
								
							
						
					
					
						commit
						9a618adeff
					
				| @ -18,15 +18,15 @@ CommonConstants { | |||||||
|   /** |   /** | ||||||
|    * Rdb database config. |    * Rdb database config. | ||||||
|    */ |    */ | ||||||
|   static readonly STORE_CONFIG = { name: 'user.db' }; |   static readonly STORE_CONFIG = { name: 'USER.db' }; | ||||||
| 
 | 
 | ||||||
|   /** |   /** | ||||||
|    * Account table config. |    * Account table config. | ||||||
|    */ |    */ | ||||||
|   static readonly ACCOUNT_TABLE = { |   static readonly ACCOUNT_TABLE = { | ||||||
|     tableName: 'USER', |     tableName: 'USER', | ||||||
|     sqlCreate: 'CREATE TABLE IF NOT EXISTS USER(id TEXT,sfzmhm TEXT,xm CHAR(20), lsh TEXT, kszp TEXT,ksdd TEXT,kssycs TEXT,kslx TEXT,kscx TEXT,ksxl TEXT)', |     sqlCreate: 'CREATE TABLE IF NOT EXISTS USER(id INTEGER PRIMARY KEY AUTOINCREMENT,sfzmhm TEXT,xm CHAR(20), lsh TEXT, kszp TEXT,ksdd TEXT,kssycs TEXT,kslx TEXT,kscx TEXT,ksxl TEXT,ksy1 TEXT)', | ||||||
|     columns: ['id','sfzmhm','xm','lsh','kszp','ksdd','kssycs','kslx','kscx','ksxl'] |     columns: ['id','sfzmhm','xm','lsh','kszp','ksdd','kssycs','kslx','kscx','ksxl','ksy1'] | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   /** |   /** | ||||||
|  | |||||||
| @ -91,6 +91,11 @@ function sqlInsertCommonFn(tableName, resultArr, context?, delFlag = true) { | |||||||
| 
 | 
 | ||||||
|         // console.log('表长度',result.length,tableName)
 |         // console.log('表长度',result.length,tableName)
 | ||||||
|         if (result.length == 0) { |         if (result.length == 0) { | ||||||
|  |           console.log('sqlsqlinsert',resultArr.length) | ||||||
|  |           if(resultArr.length==0){ | ||||||
|  |             resolve(false) | ||||||
|  |             return | ||||||
|  |           } | ||||||
|           let INSERT_SQL = "INSERT INTO " + tableName |           let INSERT_SQL = "INSERT INTO " + tableName | ||||||
|             + " (" + map[tableName].ACCOUNT_TABLE.columns.toString() + ") VALUES " |             + " (" + map[tableName].ACCOUNT_TABLE.columns.toString() + ") VALUES " | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -75,7 +75,10 @@ export default async function request(req: any) { | |||||||
|             if(res.head.resultCode === '0'){ |             if(res.head.resultCode === '0'){ | ||||||
|                 return res |                 return res | ||||||
|             }else{ |             }else{ | ||||||
|  |                 globalThis.type='1' | ||||||
|                 const resultMessage = res?.body?.resultMessage || res?.head?.resultMessage |                 const resultMessage = res?.body?.resultMessage || res?.head?.resultMessage | ||||||
|  |                 AppStorage.SetOrCreate('errorMsg', 1); | ||||||
|  |                 globalThis.title=decodeURIComponent(resultMessage) | ||||||
|                 prompt.showToast({ |                 prompt.showToast({ | ||||||
|                     message: decodeURIComponent(resultMessage), |                     message: decodeURIComponent(resultMessage), | ||||||
|                     duration: 3000 |                     duration: 3000 | ||||||
| @ -90,6 +93,9 @@ export default async function request(req: any) { | |||||||
|         if(resObj.resultCode === '0') { |         if(resObj.resultCode === '0') { | ||||||
|             return res |             return res | ||||||
|         }else { |         }else { | ||||||
|  |             globalThis.type='1' | ||||||
|  |             AppStorage.SetOrCreate('errorMsg', 1); | ||||||
|  |             globalThis.title=decodeURIComponent(resObj.resultMessage) | ||||||
|             prompt.showToast({ |             prompt.showToast({ | ||||||
|                 message: decodeURIComponent(resObj.resultMessage), |                 message: decodeURIComponent(resObj.resultMessage), | ||||||
|                 duration: 3000 |                 duration: 3000 | ||||||
| @ -102,7 +108,6 @@ export default async function request(req: any) { | |||||||
|             return false |             return false | ||||||
|         } |         } | ||||||
|         const code = e?.code; |         const code = e?.code; | ||||||
| 
 |  | ||||||
|         prompt.showToast({ |         prompt.showToast({ | ||||||
|             message: e?.message, |             message: e?.message, | ||||||
|             duration: 5000 |             duration: 5000 | ||||||
|  | |||||||
| @ -93,10 +93,10 @@ export default struct Index { | |||||||
|                     console.log('res?.examinerLoginRsp?.head?.resultCode',res?.examinerLoginRsp?.head?.resultCode,JSON.stringify(res)) |                     console.log('res?.examinerLoginRsp?.head?.resultCode',res?.examinerLoginRsp?.head?.resultCode,JSON.stringify(res)) | ||||||
|                     this.errorDialog.close() |                     this.errorDialog.close() | ||||||
|                     if(res?.examinerLoginRsp?.head?.resultCode=='1'){ |                     if(res?.examinerLoginRsp?.head?.resultCode=='1'){ | ||||||
|                       this.type='1' |                       // this.type='1' | ||||||
|                       this.title=decodeURIComponent(res.examinerLoginRsp.head.resultMessage) |                       // this.title=decodeURIComponent(res.examinerLoginRsp.head.resultMessage) | ||||||
|                       console.log('this.titlt',this.title) |                       // console.log('this.titlt',this.title) | ||||||
|                       this.errorDialog.open() |                       // this.errorDialog.open() | ||||||
|                       return |                       return | ||||||
|                     } |                     } | ||||||
|                     router.pushUrl({ |                     router.pushUrl({ | ||||||
|  | |||||||
| @ -42,19 +42,19 @@ struct Index { | |||||||
|   private context = getContext(this) as common.UIAbilityContext; |   private context = getContext(this) as common.UIAbilityContext; | ||||||
|   private title = '' |   private title = '' | ||||||
|   private type = '2' |   private type = '2' | ||||||
|   // dialogControllerTwo: CustomDialogController = new CustomDialogController({ |   errorDialog: CustomDialogController = new CustomDialogController({ | ||||||
|   //   builder: errorMsgDialog({ |     builder: errorMsgDialog({ | ||||||
|   //     title: this.title, |       title: globalThis.title, | ||||||
|   //     type: this.type, |       type: globalThis.type, | ||||||
|   //     cancel: () => { |       cancel: () => { | ||||||
|   //     }, |       }, | ||||||
|   //     confirm: () => { |       confirm: () => { | ||||||
|   //     } |       } | ||||||
|   //   }), |     }), | ||||||
|   //   customStyle: true, |     customStyle: true, | ||||||
|   //   alignment: DialogAlignment.Center, |     alignment: DialogAlignment.Center, | ||||||
|   // }, |   }, | ||||||
|   // ) |   ) | ||||||
| 
 | 
 | ||||||
|   @Styles |   @Styles | ||||||
|   commStyle(){ |   commStyle(){ | ||||||
| @ -445,6 +445,11 @@ struct Index { | |||||||
|       if (this.num >= 3) { |       if (this.num >= 3) { | ||||||
|         this.heartMsg() |         this.heartMsg() | ||||||
|       } |       } | ||||||
|  |       const data=AppStorage.Get('errorMsg'); // returns 47 | ||||||
|  |       console.log('1123',data) | ||||||
|  |       if(data==1){ | ||||||
|  |         this.errorDialog.open() | ||||||
|  |       } | ||||||
|     }, 1000) |     }, 1000) | ||||||
|     //下载模型 |     //下载模型 | ||||||
|     // await this.getModel() |     // await this.getModel() | ||||||
|  | |||||||
| @ -132,6 +132,9 @@ struct UserInfo { | |||||||
|     this.list =await getSyncData('USERLIST') |     this.list =await getSyncData('USERLIST') | ||||||
|     // @ts-ignore |     // @ts-ignore | ||||||
|     const data=await getSyncData('USER') |     const data=await getSyncData('USER') | ||||||
|  |     console.log('datadata',JSON.stringify(data)); | ||||||
|  |     console.log('datadata2',JSON.stringify(this.list)) | ||||||
|  | 
 | ||||||
|     const user=data[0] |     const user=data[0] | ||||||
|     if(user&&Number(user.kssycs)){ |     if(user&&Number(user.kssycs)){ | ||||||
|       this.list.forEach(res=>{ |       this.list.forEach(res=>{ | ||||||
| @ -140,15 +143,24 @@ struct UserInfo { | |||||||
|           this.getCurrentStudent(res.sfzmhm) |           this.getCurrentStudent(res.sfzmhm) | ||||||
|         } |         } | ||||||
|       }) |       }) | ||||||
|     }else if(user&&!Number(user.kssycs)){ | 
 | ||||||
|  |     }else if(user&&(user.kssycs=='0'||user.kssycs=='')){ | ||||||
|  |       console.log('datadatadatadata') | ||||||
|       this.list=this.list.filter(res=>{ |       this.list=this.list.filter(res=>{ | ||||||
|         return res.sfzmhm!=user.sfzmhm |         return res.sfzmhm!=user.sfzmhm | ||||||
|       }) |       }) | ||||||
|  |       this.pageIndex=0 | ||||||
|  |       this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) | ||||||
|  |       if(this.dataList.length){ | ||||||
|  |         this.currentUser=this.dataList[0] | ||||||
|  |       }else{ | ||||||
|  |         this.currentUser=EmptyCandidateObject | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|     this.list.forEach((res,index)=>{ |     this.list.forEach((res,index)=>{ | ||||||
|       res.id=index.toString() |       res.id=index.toString() | ||||||
|     }) |     }) | ||||||
|     await upDateTableByArray('USERLIST', this.list) |     await upDateTableByArray('USERLIST', this.list||[]) | ||||||
| 
 | 
 | ||||||
|     // 如果是单机模式则模拟假数据 |     // 如果是单机模式则模拟假数据 | ||||||
|     //获取sysset表数据 |     //获取sysset表数据 | ||||||
| @ -444,20 +456,14 @@ struct UserInfo { | |||||||
|     this.errorDialog.open() |     this.errorDialog.open() | ||||||
|     const param = `<getExaminationStudentInfoReq><head><checkCode>${Md5.Instance.get_md5(globalThis.carInfo.carId + globalThis.carInfo.examinationRoomId + globalThis.username)}</checkCode></head><body><carId>${globalThis.carInfo.carId}</carId><examinationRoomId>${globalThis.carInfo.examinationRoomId}</examinationRoomId><examinerName>${globalThis.username}</examinerName></body></getExaminationStudentInfoReq>` |     const param = `<getExaminationStudentInfoReq><head><checkCode>${Md5.Instance.get_md5(globalThis.carInfo.carId + globalThis.carInfo.examinationRoomId + globalThis.username)}</checkCode></head><body><carId>${globalThis.carInfo.carId}</carId><examinationRoomId>${globalThis.carInfo.examinationRoomId}</examinationRoomId><examinerName>${globalThis.username}</examinerName></body></getExaminationStudentInfoReq>` | ||||||
|     getExaminationStudentInfo(param).then(async (res) => { |     getExaminationStudentInfo(param).then(async (res) => { | ||||||
|  |       this.errorDialog.close() | ||||||
|       setTimeout(() => { |       setTimeout(() => { | ||||||
|         this.updateTimeLimit = true |         this.updateTimeLimit = true | ||||||
|       }, 30000) |       }, 30000) | ||||||
|       this.updateTimeLimit = false |       this.updateTimeLimit = false | ||||||
|       if (!res||res?.examinerLoginRsp?.head?.resultCode=='1') { |       if (!res||res?.getExaminationStudentInfoRsp?.head?.resultCode=='1') { | ||||||
|         this.dataList = [] |  | ||||||
|         this.currentUser = EmptyCandidateObject |  | ||||||
|         this.errorMsg = decodeURI(res.getExaminationStudentInfoRsp.head.resultMessage) |  | ||||||
|         this.type='1' |  | ||||||
|         this.title=res.getExaminationStudentInfoRsp.head.resultMessage |  | ||||||
|         return |         return | ||||||
|       } |       } | ||||||
|       this.errorDialog.close() |  | ||||||
| 
 |  | ||||||
|       let dataList = [] |       let dataList = [] | ||||||
|       this.list = [] |       this.list = [] | ||||||
| 
 | 
 | ||||||
| @ -474,13 +480,15 @@ struct UserInfo { | |||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       this.list = JSON.parse(JSON.stringify(dataList)) |       this.list = JSON.parse(JSON.stringify(dataList)) | ||||||
|       this.list.forEach(listData => { |       this.list.forEach((listData,index) => { | ||||||
|  |         listData.id=index.toString() | ||||||
|         for (let i in listData) { |         for (let i in listData) { | ||||||
|           listData[i] = decodeURI(listData[i]) |           listData[i] = decodeURI(listData[i]) | ||||||
|         } |         } | ||||||
|         listData.kszp = this.photo + listData.kszp |         listData.kszp = this.photo + listData.kszp | ||||||
|         listData.ksmjzp = this.photo + listData.ksmjzp |         listData.ksmjzp = this.photo + listData.ksmjzp | ||||||
|       }) |       }) | ||||||
|  |       await upDateTableByArray('USERLIST', this.list||[]) | ||||||
|       dataList = this.list.length > 4 ? this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) : this.list; |       dataList = this.list.length > 4 ? this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) : this.list; | ||||||
| 
 | 
 | ||||||
|       this.dataList = dataList |       this.dataList = dataList | ||||||
|  | |||||||
| @ -929,7 +929,7 @@ export default class Judge { | |||||||
|       } |       } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     const USER = getSyncData('USER'); |     const USER =await getSyncData('USER'); | ||||||
|     await upDateTableByArray('USER', [{...USER[0],kssycs:kssycs == 2 ? 1 : 0}]) |     await upDateTableByArray('USER', [{...USER[0],kssycs:kssycs == 2 ? 1 : 0}]) | ||||||
| 
 | 
 | ||||||
|     console.info(judgeTag, `考试成绩:${totalScore}`) |     console.info(judgeTag, `考试成绩:${totalScore}`) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user