v3.3.6 bug fixed: UnlockScreen组件时间动态刷新bug修复

This commit is contained in:
ray_wuhao 2023-06-20 17:44:51 +08:00
parent 2a64d07a42
commit 2845796e38
4 changed files with 21 additions and 2 deletions

View File

@ -47,6 +47,14 @@ const UnlockScreen = defineComponent({
YY_MM_DD: dayjs().format(YY_MM_DD_FORMAT),
DDD: dayjs().format(DDD_FORMAT),
})
const dayInterval = setInterval(() => {
state.HH_MM = dayjs().format(HH_MM_FORMAT)
state.AM_PM = dayjs().format(AM_PM_FORMAT)
}, 6_000)
const yearInterval = setInterval(() => {
state.YY_MM_DD = dayjs().format(YY_MM_DD_FORMAT)
state.DDD = dayjs().format(DDD_FORMAT)
}, 86_400_000)
/** 退出登陆并且回到登陆页 */
const backToSignin = () => {
@ -78,6 +86,11 @@ const UnlockScreen = defineComponent({
autoFouceInput(inputInstRef)
onBeforeUnmount(() => {
clearInterval(dayInterval)
clearInterval(yearInterval)
})
return {
...toRefs(state),
backToSignin,

View File

@ -9,6 +9,12 @@
* @remark
*/
/**
*
* 使 RayTooltipIcon ,
*
*/
import './index.scss'
import { NLayoutHeader, NSpace, NTooltip, NDropdown } from 'naive-ui'

View File

@ -36,7 +36,7 @@ export const useSetting = defineStore(
breadcrumbSwitch: true, // 面包屑开关
localeLanguage: getDefaultLocal(),
lockScreenSwitch: false, // 锁屏开关
lockScreenInputSwitch: false, // 锁屏输入状态开关
lockScreenInputSwitch: false, // 锁屏输入状态开关(预留该字段是为了方便拓展用, 但是舍弃了该字段, 改为使用 useAppLockScreen 方法)
})
/** 修改当前语言 */

View File

@ -6,7 +6,7 @@ import type { VNodeChild } from 'vue'
export global {
declare interface IUnknownObjectKey {
[propName: string]: unknown
[propName: string]: any
}
declare type EventListenerOrEventListenerObject =