fix: 完善Date工具函数 对毫秒的支持,以及完善judge工具函数的完善
This commit is contained in:
		
							parent
							
								
									11e738bb47
								
							
						
					
					
						commit
						d21cd896c9
					
				| @ -18,7 +18,6 @@ import BottomMessageComponent from './Index/BottomMessage'; | ||||
| import LoadingComponent from './Index/Loading'; | ||||
| import Prompt from '@system.prompt'; | ||||
| import { DifferentialAndSignal } from '../utils/business/DifferentialAndSignalWorker'; | ||||
| import dayTs from '../utils/Date'; | ||||
| 
 | ||||
| 
 | ||||
| @Entry | ||||
| @ -61,11 +60,6 @@ struct Index { | ||||
|   } | ||||
| 
 | ||||
|   async aboutToAppear() { | ||||
|     console.log("首页 aboutToAppear") | ||||
|     const date = new Date() | ||||
|     const getMilliseconds = date.getMilliseconds() | ||||
|     const timeStr = dayTs().format('YYYYMMDDHHmmss.SS') | ||||
|     console.log(getMilliseconds.toString(), "时间测试", timeStr) | ||||
|     await UseAuth(this.context) | ||||
|     this.ratio = AppStorage.get<BaseInfoType>('baseInfo')?.ratio || 1.4 | ||||
|     this.angle = 0 | ||||
|  | ||||
| @ -682,18 +682,6 @@ export const senorToWXDataStr = async (tempData: PLCType) => { | ||||
|   // console.log('wuXiData',wuXiData.join(',')); | ||||
| } | ||||
| 
 | ||||
| export const getTimeStr = async () => { | ||||
|   const date = await systemTime.getDate() | ||||
|   const timeStr = ''; | ||||
|   const Y = date.getFullYear(); | ||||
|   const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1); | ||||
|   const D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()); | ||||
|   const h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()); | ||||
|   const m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()); | ||||
|   const s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); | ||||
|   const ss = (date.getMilliseconds() + '').slice(0, 2); | ||||
|   return timeStr + Y + M + D + h + m + s + '.' + ss | ||||
| } | ||||
| 
 | ||||
| //蓝灯 | ||||
| export function sendBlue() { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user