mirror of
				https://gitee.com/dromara/mayfly-go
				synced 2025-11-04 08:20:25 +08:00 
			
		
		
		
	refactor: 消息模块调整 & 样式优化
This commit is contained in:
		@@ -2,38 +2,34 @@
 | 
			
		||||
    <el-config-provider :size="getGlobalComponentSize" :locale="getGlobalI18n">
 | 
			
		||||
        <div class="h-full">
 | 
			
		||||
            <el-watermark
 | 
			
		||||
                :zIndex="10000000"
 | 
			
		||||
                :zIndex="100000"
 | 
			
		||||
                :width="210"
 | 
			
		||||
                v-if="themeConfig.isWatermark"
 | 
			
		||||
                :font="{ color: 'rgba(180, 180, 180, 0.3)' }"
 | 
			
		||||
                :content="themeConfig.watermarkText"
 | 
			
		||||
                class="!h-full"
 | 
			
		||||
            >
 | 
			
		||||
                <router-view v-show="themeConfig.lockScreenTime !== 0" />
 | 
			
		||||
                <router-view />
 | 
			
		||||
            </el-watermark>
 | 
			
		||||
            <router-view v-if="!themeConfig.isWatermark" v-show="themeConfig.lockScreenTime !== 0" />
 | 
			
		||||
            <router-view v-if="!themeConfig.isWatermark" />
 | 
			
		||||
 | 
			
		||||
            <LockScreen v-if="themeConfig.isLockScreen" />
 | 
			
		||||
            <Setings ref="setingsRef" v-show="themeConfig.lockScreenTime !== 0" />
 | 
			
		||||
            <Setings />
 | 
			
		||||
        </div>
 | 
			
		||||
    </el-config-provider>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts" name="app">
 | 
			
		||||
import { ref, onMounted, onUnmounted, nextTick, watch, computed } from 'vue';
 | 
			
		||||
import { onMounted, nextTick, watch, computed } from 'vue';
 | 
			
		||||
import { useRoute } from 'vue-router';
 | 
			
		||||
import { storeToRefs } from 'pinia';
 | 
			
		||||
import { useThemeConfig } from '@/store/themeConfig';
 | 
			
		||||
import LockScreen from '@/layout/lockScreen/index.vue';
 | 
			
		||||
import Setings from '@/layout/navBars/breadcrumb/setings.vue';
 | 
			
		||||
import mittBus from '@/common/utils/mitt';
 | 
			
		||||
import { useIntervalFn } from '@vueuse/core';
 | 
			
		||||
import { useI18n } from 'vue-i18n';
 | 
			
		||||
import EnumValue from './common/Enum';
 | 
			
		||||
import { I18nEnum } from './common/commonEnum';
 | 
			
		||||
import { saveThemeConfig } from './common/utils/storage';
 | 
			
		||||
 | 
			
		||||
const setingsRef = ref();
 | 
			
		||||
const route = useRoute();
 | 
			
		||||
 | 
			
		||||
const themeConfigStores = useThemeConfig();
 | 
			
		||||
@@ -42,19 +38,9 @@ const { themeConfig } = storeToRefs(themeConfigStores);
 | 
			
		||||
// 定义变量内容
 | 
			
		||||
const { locale, t } = useI18n();
 | 
			
		||||
 | 
			
		||||
// 布局配置弹窗打开
 | 
			
		||||
const openSetingsDrawer = () => {
 | 
			
		||||
    setingsRef.value.openDrawer();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// 页面加载时
 | 
			
		||||
onMounted(() => {
 | 
			
		||||
    nextTick(() => {
 | 
			
		||||
        // 监听布局配置弹窗点击打开
 | 
			
		||||
        mittBus.on('openSetingsDrawer', () => {
 | 
			
		||||
            openSetingsDrawer();
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        // 初始化系统主题
 | 
			
		||||
        themeConfigStores.initThemeConfig();
 | 
			
		||||
    });
 | 
			
		||||
@@ -120,11 +106,6 @@ const refreshWatermarkTime = () => {
 | 
			
		||||
    themeConfigStores.setWatermarkNowTime();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// 页面销毁时,关闭监听布局配置
 | 
			
		||||
onUnmounted(() => {
 | 
			
		||||
    mittBus.off('openSetingsDrawer', () => {});
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// 监听路由的变化,设置网站标题
 | 
			
		||||
watch(
 | 
			
		||||
    () => route.path,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user