2025-06-26 15:29:07 +08:00
|
|
|
<template>
|
|
|
|
<el-config-provider :locale="appStore.locale" :size="appStore.size">
|
|
|
|
<router-view />
|
|
|
|
</el-config-provider>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { useSettingsStore } from '@/store/modules/settings';
|
|
|
|
import { handleThemeStyle } from '@/utils/theme';
|
|
|
|
import { useAppStore } from '@/store/modules/app';
|
2025-08-20 13:47:12 +08:00
|
|
|
import { useUserStore } from '@/store/modules/user';
|
2025-06-26 15:29:07 +08:00
|
|
|
|
|
|
|
const appStore = useAppStore();
|
2025-08-20 13:47:12 +08:00
|
|
|
const userStore = useUserStore();
|
2025-06-26 15:29:07 +08:00
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
nextTick(() => {
|
|
|
|
// 初始化主题样式
|
|
|
|
handleThemeStyle(useSettingsStore().theme);
|
|
|
|
});
|
|
|
|
});
|
2025-08-20 13:47:12 +08:00
|
|
|
|
|
|
|
// 监听租户名称变化,动态更新页面标题
|
|
|
|
watch(
|
|
|
|
() => userStore.tenantName,
|
|
|
|
(value) => {
|
|
|
|
if (value) {
|
|
|
|
document.title = userStore.tenantName;
|
|
|
|
} else {
|
|
|
|
document.title = import.meta.env.VITE_APP_TITLE;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
immediate: true,
|
|
|
|
}
|
|
|
|
);
|
2025-06-26 15:29:07 +08:00
|
|
|
</script>
|