1
0
forked from dyf/dyf-vue-ui

修复类型字典问题

This commit is contained in:
微微一笑
2025-08-20 13:47:12 +08:00
parent d96b28a0b9
commit 1cfb5581c8
10 changed files with 104 additions and 48 deletions

View File

@ -5,14 +5,7 @@
:style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"
>
<transition :enter-active-class="proxy?.animate.logoAnimate.enter" mode="out-in">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">
{{ title }}
</h1>
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<router-link class="sidebar-logo-link" to="/">
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">
{{ title }}
</h1>
@ -23,8 +16,8 @@
<script setup lang="ts">
import variables from '@/assets/styles/variables.module.scss';
import logo from '@/assets/logo/logo.png';
import { useSettingsStore } from '@/store/modules/settings';
import { useUserStore } from '@/store/modules/user';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
defineProps({
@ -34,8 +27,14 @@ defineProps({
}
});
const title = ref('星汉研创科技');
const userStore = useUserStore();
const settingsStore = useSettingsStore();
// 使用计算属性动态获取标题
const title = computed(() => {
return userStore.tenantName || import.meta.env.VITE_APP_TITLE || '云平台管理系统';
});
const sideTheme = computed(() => settingsStore.sideTheme);
</script>
@ -62,33 +61,25 @@ const sideTheme = computed(() => settingsStore.sideTheme);
height: 100%;
width: 100%;
& .sidebar-logo {
width: 32px;
height: 32px;
vertical-align: middle;
margin-right: 12px;
}
& .sidebar-title {
display: inline-block;
display: block;
margin: 0;
padding: 0 15px; // 增加左右内边距
color: #fff;
font-weight: 600;
line-height: 50px;
font-size: 16px; // 匹配设计UI的字体大小
font-size: 16px; // 恢复正常字体大小
font-family:
Avenir,
Helvetica Neue,
Arial,
Helvetica,
sans-serif;
vertical-align: middle;
}
}
&.collapse {
.sidebar-logo {
margin-right: 0px;
width: 100%; // 使用全宽
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: center; // 居中显示
}
}
}