feat(login): 添加租户名称获取功能并优化前端布局
- 在登录控制器中注入租户服务并获取租户名称信息 - 添加租户名称到登录响应结果中 - 更新样式变量定义侧边栏宽度和Logo高度 - 重构公告面板组件统一公告通知显示逻辑 - 简化公告类型图标和样式映射关系 - 更新侧边栏为垂直菜单布局并添加折叠功能 - 优化Logo组件显示租户名称和系统标题 - 调整导航栏布局结构和响应式样式 - 重构主应用容器样式和标签页显示逻辑
This commit is contained in:
@@ -7,36 +7,25 @@
|
||||
sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground,
|
||||
}"
|
||||
>
|
||||
<!-- <el-image
|
||||
:src="sideTheme === 'theme-dark' ? Logo : Logo"
|
||||
class="sidebar-logo"
|
||||
fit="scale-down"
|
||||
/> -->
|
||||
<!-- <transition name="sidebarLogoFade">
|
||||
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
|
||||
<el-image
|
||||
v-if="logo"
|
||||
:src="sideTheme === 'theme-dark' ? logoNew : logoBlack"
|
||||
class="sidebar-logo"
|
||||
fit="scale-down"
|
||||
/>
|
||||
</router-link>
|
||||
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
||||
<el-image
|
||||
v-if="logo"
|
||||
:src="sideTheme === 'theme-dark' ? logoNew : logoBlack"
|
||||
class="sidebar-logo"
|
||||
fit="scale-down"
|
||||
/>
|
||||
</router-link>
|
||||
</transition> -->
|
||||
<router-link class="sidebar-logo-link" to="/index">
|
||||
<el-image
|
||||
:src="logoImage"
|
||||
class="sidebar-logo"
|
||||
fit="contain"
|
||||
/>
|
||||
<div v-if="!collapse" class="logo-text" :style="{ color: textColor }">
|
||||
<h1 class="sidebar-title">{{ title }}</h1>
|
||||
<p v-if="displayName" class="hospital-name">{{ displayName }}</p>
|
||||
</div>
|
||||
</router-link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import variables from '@/assets/styles/variables.module.scss';
|
||||
import useSettingsStore from '@/store/modules/settings';
|
||||
import {computed, ref} from 'vue';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import {computed} from 'vue';
|
||||
|
||||
defineProps({
|
||||
collapse: {
|
||||
@@ -45,64 +34,99 @@ defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const title = import.meta.env.VITE_APP_TITLE;
|
||||
const title = import.meta.env.VITE_APP_TITLE || '医院管理系统';
|
||||
const settingsStore = useSettingsStore();
|
||||
const userStore = useUserStore();
|
||||
const sideTheme = computed(() => settingsStore.sideTheme);
|
||||
const logo = ref(true);
|
||||
const displayName = computed(() => userStore.tenantName || userStore.hospitalName || userStore.orgName || '');
|
||||
|
||||
const textColor = computed(() => {
|
||||
return sideTheme.value === 'theme-dark' ? '#fff' : '#303133';
|
||||
});
|
||||
|
||||
const logoImage = computed(() => {
|
||||
return new URL('@/assets/logo/LOGO.jpg', import.meta.url).href;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.sidebarLogoFade-enter-active {
|
||||
transition: opacity 1.5s;
|
||||
}
|
||||
|
||||
.sidebarLogoFade-enter,
|
||||
.sidebarLogoFade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.sidebar-logo-container {
|
||||
position: relative;
|
||||
width: auto;
|
||||
min-width: 120px;
|
||||
max-width: 160px;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
background: transparent;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
padding: 0 8px;
|
||||
margin-left: 5px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
& .sidebar-logo-link {
|
||||
.sidebar-logo-link {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 8px 12px;
|
||||
gap: 8px;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
|
||||
& .sidebar-logo {
|
||||
width: auto;
|
||||
max-width: 120px;
|
||||
height: 28px;
|
||||
vertical-align: middle;
|
||||
&:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
& .sidebar-title {
|
||||
display: inline-block;
|
||||
.sidebar-logo {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
flex-shrink: 0;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.logo-text {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
gap: 2px;
|
||||
min-width: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.sidebar-logo {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.sidebar-title {
|
||||
margin: 0;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
line-height: 50px;
|
||||
font-size: 14px;
|
||||
font-size: 15px;
|
||||
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.hospital-name {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
line-height: 1.2;
|
||||
opacity: 0.85;
|
||||
}
|
||||
}
|
||||
|
||||
&.collapse {
|
||||
.sidebar-logo {
|
||||
margin-right: 0px;
|
||||
.sidebar-logo-link {
|
||||
padding: 0;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.logo-text {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user