update 添加websocket功能推送员工报警信息
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import * as dayjs from 'dayjs';
|
||||
|
||||
export function getZero(num: any) {
|
||||
if (num < 10) {
|
||||
return '0' + num;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
export function useTopTime() {
|
||||
const timeLeft = dayjs().format('YYYY年MM月DD日 HH时mm分ss秒');
|
||||
const timeRight =
|
||||
dayjs().diff(dayjs('2018-10-01'), 'day') +
|
||||
'天' +
|
||||
getZero(dayjs().diff(dayjs(dayjs().format('YYYY-MM-DD') + ' 00:00:00'), 'hours')) +
|
||||
'时' +
|
||||
getZero(dayjs().diff(dayjs(dayjs().format('YYYY-MM-DD HH') + ':00:00'), 'minutes')) +
|
||||
'分' +
|
||||
getZero(dayjs().diff(dayjs(dayjs().format('YYYY-MM-DD HH:mm') + ':00'), 'seconds')) +
|
||||
'秒';
|
||||
return {
|
||||
timeLeft,
|
||||
timeRight,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user