This commit is contained in:
陈红丽 2024-12-19 11:19:01 +08:00
commit 7f4b329943
2 changed files with 22 additions and 8 deletions

View File

@ -41,14 +41,15 @@
import { useProjectSetting } from '@/hooks/setting/useProjectSetting';
import { lighten } from '@/utils';
/**
* 定义参数
*/
const route = useRoute();
const useLockscreen = useLockscreenStore();
const designStore = useDesignSettingStore();
const isLock = computed(() => useLockscreen.isLock);
const lockTime = computed(() => useLockscreen.lockTime);
const proName = import.meta.env.VITE_GLOB_APP_TITLE;
const { getIsWaterMark } = useProjectSetting();
/**
@ -95,6 +96,9 @@
}, 1000);
};
/**
* 钩子函数
*/
onMounted(() => {
// document.addEventListener('mousedown', timekeeping);
});

View File

@ -71,6 +71,7 @@
</n-icon>
</div>
</template>
<!-- 全局WebSocket通讯组件 -->
<global-websocket :uri="'/api/websocket/' + userInfo.id" @rollback="rollback" />
</template>
@ -92,9 +93,11 @@
import { MaybeElement, useFullscreen } from '@vueuse/core';
import { SettingOutlined } from '@vicons/antd';
import { useDesignSettingStore } from '@/store/modules/designSetting';
import { initWebSocket } from '@/components/Websocket/index';
const GlobalWebsocket = defineAsyncComponent(() => import('@/components/Websocket/index.vue'));
/**
* 定义参数
*/
const GlobalWebsocket = defineAsyncComponent(() => import('@/components/Websocket/index.vue'));
const { getDarkTheme } = useDesignSetting();
const notification = useNotification();
const {
@ -105,24 +108,23 @@
getMultiTabsSetting,
getIsProjectSetting,
} = useProjectSetting();
const settingStore = useProjectSettingStore();
const designStore = useDesignSettingStore();
const userStore = useUserStore();
const userInfo: object = userStore.getUserInfo || {};
const navMode = getNavMode;
const drawerSetting = ref();
const collapsed = ref<boolean>(false);
const adminBodyRef = ref<MaybeElement>();
const { isFullscreen, toggle } = useFullscreen(adminBodyRef);
provide('isPageFullScreen', isFullscreen);
provide('collapsed', collapsed);
provide('openSetting', openSetting);
/**
* 侦听器
*/
watch(
() => collapsed.value,
(to) => {
@ -214,6 +216,11 @@
collapsed.value = true;
}
};
/**
* 消息通知回调
* @param msg 消息
*/
const rollback = (msg) => {
notification.info({
title: '通知',
@ -222,6 +229,9 @@
});
};
/**
* 钩子函数
*/
onMounted(() => {
window.addEventListener('resize', watchWidth);
});