|
@@ -1,8 +1,11 @@
|
|
|
<template>
|
|
|
- <el-main class="layout-main"
|
|
|
- :style="isFixedHeader ? `height: calc(100% - ${setMainHeight})` : `minHeight: calc(100% - ${setMainHeight})`">
|
|
|
- <el-scrollbar ref="layoutMainScrollbarRef" class="layout-main-scroll layout-backtop-header-fixed"
|
|
|
- wrap-class="layout-main-scroll" view-class="layout-main-scroll">
|
|
|
+ <el-main class="layout-main" :style="isFixedHeader ? `height: calc(100% - ${setMainHeight})` : `minHeight: calc(100% - ${setMainHeight})`">
|
|
|
+ <el-scrollbar
|
|
|
+ ref="layoutMainScrollbarRef"
|
|
|
+ class="layout-main-scroll layout-backtop-header-fixed"
|
|
|
+ wrap-class="layout-main-scroll"
|
|
|
+ view-class="layout-main-scroll"
|
|
|
+ >
|
|
|
<LayoutParentView />
|
|
|
<LayoutFooter v-if="isFooter" />
|
|
|
</el-scrollbar>
|
|
@@ -20,6 +23,7 @@ import { useUserInfo } from '@/stores/userInfo';
|
|
|
import { NextLoading } from '@/utils/loading';
|
|
|
import mittBus from '@/utils/mitt';
|
|
|
import signalR from '@/utils/signalR';
|
|
|
+import { useFavicon, useDark } from '@vueuse/core';
|
|
|
|
|
|
// 引入组件
|
|
|
const LayoutParentView = defineAsyncComponent(() => import('@/layout/routerView/parent.vue'));
|
|
@@ -43,7 +47,6 @@ const isFixedHeader = computed(() => {
|
|
|
return themeConfig.value.isFixedHeader;
|
|
|
});
|
|
|
|
|
|
-
|
|
|
// 设置主内容区的高度
|
|
|
const setMainHeight = computed(() => {
|
|
|
if (isTagsViewCurrenFull.value) return '0px';
|
|
@@ -56,7 +59,6 @@ const setMainHeight = computed(() => {
|
|
|
} else {
|
|
|
return '51px';
|
|
|
}
|
|
|
-
|
|
|
});
|
|
|
// 设置 BackTop 回到顶部
|
|
|
const setBackTopClass = computed(() => {
|
|
@@ -68,10 +70,15 @@ onMounted(async () => {
|
|
|
NextLoading.done(600);
|
|
|
// 监听页面需要滚动事件
|
|
|
mittBus.on('scrollTopEmit', (res: any) => {
|
|
|
- layoutMainScrollbarRef.value?.scrollTo(res.top ? res.top : 0, res.left ? res.left : 0)// 滚动到一组特定坐标(x,y)
|
|
|
+ layoutMainScrollbarRef.value?.scrollTo(res.top ? res.top : 0, res.left ? res.left : 0); // 滚动到一组特定坐标(x,y)
|
|
|
});
|
|
|
await nextTick();
|
|
|
await signalR.joinGroup('CallCenter'); // 加入分组
|
|
|
+ // 动态修改icon
|
|
|
+ const icon = useFavicon();
|
|
|
+ icon.value = themeConfig.value.faviconImage; // 更改当前左上角角标
|
|
|
+ const isDark = useDark();
|
|
|
+ isDark.value = themeConfig.value.isIsDark; // 更改暗黑模式
|
|
|
});
|
|
|
// 暴露变量
|
|
|
defineExpose({
|