Browse Source

Merge branch 'zhangrenyuan/feature-20250917161935-重构工作台' into zhangrenyuan/feature-20250917134308-现金管理

lihui/feature-20250915101448-现金管理
zhangrenyuan 2 weeks ago
parent
commit
2119ac35f0
  1. 156
      src/views/home.vue

156
src/views/home.vue

@ -94,8 +94,10 @@ function logout() {
<template> <template>
<div class="main-container"> <div class="main-container">
<div class="glass-container">
<el-container>
<!-- 背景毛玻璃层作为内容容器 -->
<div class="background-glass">
<!-- 侧边栏 -->
<div class="sidebar-container">
<el-aside> <el-aside>
<div class="logo"> <div class="logo">
<img src="../assets/新logo.png" alt="logo" style="width: 9vh; height: 9vh" /> <img src="../assets/新logo.png" alt="logo" style="width: 9vh; height: 9vh" />
@ -143,12 +145,16 @@ function logout() {
</template> </template>
</el-menu> </el-menu>
</el-aside> </el-aside>
<el-container style="margin-left: 15vw;">
</div>
<!-- 右侧内容区域 -->
<div class="content-container">
<!-- 头部 -->
<el-header class="header"> <el-header class="header">
<el-menu class="el-menu-demo" mode="horizontal" :ellipsis="false"> <el-menu class="el-menu-demo" mode="horizontal" :ellipsis="false">
<el-sub-menu index="1"> <el-sub-menu index="1">
<template #title> <template #title>
<el-image :src="imgrule1" style="width: 50px; height: 50px" />
<el-image :src="imgrule1" style="width: 53px; height: 53px" />
<span style="margin-left: 10px">{{ adminData.name }}</span> <span style="margin-left: 10px">{{ adminData.name }}</span>
</template> </template>
<el-menu-item @click="message()">查看个人信息</el-menu-item> <el-menu-item @click="message()">查看个人信息</el-menu-item>
@ -157,11 +163,15 @@ function logout() {
</el-sub-menu> </el-sub-menu>
</el-menu> </el-menu>
</el-header> </el-header>
<el-main style="margin-top: 6vh;height: auto;">
<!-- 主内容区域 -->
<div class="main-area">
<el-main>
<router-view></router-view> <router-view></router-view>
</el-main> </el-main>
</el-container>
</el-container>
</div>
</div>
</div>
<!-- 查看个人信息 --> <!-- 查看个人信息 -->
<el-dialog v-model="messageVisible" title="查看个人信息" width="500px"> <el-dialog v-model="messageVisible" title="查看个人信息" width="500px">
@ -191,7 +201,6 @@ function logout() {
<ChangePassword ref="pwdRef" @confirm="showPasswordDialog = false" /> <ChangePassword ref="pwdRef" @confirm="showPasswordDialog = false" />
</el-dialog> </el-dialog>
</div> </div>
</div>
</template> </template>
<style scoped> <style scoped>
@ -202,51 +211,85 @@ function logout() {
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
background-image: url('@/assets/background.jpg'); /* 请将图片放在assets目录下并修改路径 */
background-image: url('@/assets/background.jpg');
background-size: cover; background-size: cover;
background-position: center center; /* 背景图居中 */
background-position: center center;
background-repeat: no-repeat; background-repeat: no-repeat;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden; overflow: hidden;
} }
/* 统一的毛玻璃容器 */
.glass-container {
position: relative;
width: 95%;
height: 95vh;
background: rgba(255, 255, 255, 0.8); /* 半透明白色背景 */
backdrop-filter: blur(5px); /* 统一的毛玻璃效果 */
/* 背景毛玻璃层(作为内容容器) */
.background-glass {
position: absolute;
top: 1vh;
left: 1vh;
right: 1vh;
bottom: 1vh;
background: rgba(255, 255, 255, 0.3); /* 更透明的背景 */
backdrop-filter: blur(10px); /* 毛玻璃效果 */
z-index: 1;
display: flex;
flex-direction: row;
padding: 20px;
border-radius: 12px; border-radius: 12px;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
/* 侧边栏容器 */
.sidebar-container {
flex-shrink: 0;
}
.el-aside {
width: 15vw;
height: 100%;
background: rgba(255, 255, 255, 0.85); /* 半透明白色背景 */
backdrop-filter: blur(5px); /* 毛玻璃效果 */
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); /* 添加阴影增强层次感 */
border-radius: 12px;
overflow-y: auto;
/* 应用自定义滚动条 */
}
/* 内容区域容器 */
.content-container {
flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-left: 5px;
gap: 5px;
height: 100%;
overflow: hidden;
} }
/* 头部样式 */
.header { .header {
position: fixed;
right: 2.5vw;
top: 2.5vh;
z-index: 80;
background: rgba(255, 255, 255, 0.9); /* 半透明白色背景 */
backdrop-filter: blur(5px); /* 毛玻璃效果 */
height: 8vh; height: 8vh;
width: calc(80vw - 5vh);
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); /* 添加阴影增强层次感 */
z-index: 80;
} }
.message-font {
font-size: 16px;
font-weight: bold;
/* 主内容区域容器 */
.main-area {
flex: 1;
background: rgba(255, 255, 255, 0.9); /* 半透明白色背景 */
backdrop-filter: blur(5px); /* 毛玻璃效果 */
border-radius: 12px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); /* 添加阴影增强层次感 */
overflow: hidden;
display: flex;
flex-direction: column;
} }
.el-aside {
width: 15vw;
position: fixed;
z-index: 100;
height: 90vh;
top: 2.5vh;
left: 2.5vw;
/* 主内容区域样式 */
.el-main {
height: 100%;
padding: 20px;
background: transparent;
overflow-y: auto;
/* 应用自定义滚动条 */
} }
.logo { .logo {
@ -260,16 +303,7 @@ function logout() {
border: none; border: none;
padding: 0; padding: 0;
float: right; float: right;
background: transparent !important;
}
/* 主内容区域样式 */
.el-main {
margin-top: 16vh;
height: auto;
padding: 20px;
margin-left: 20px;
margin-right: 20px;
background: transparent !important; /* 最高优先级的透明 */
} }
/* 侧边栏菜单样式优化 */ /* 侧边栏菜单样式优化 */
@ -277,20 +311,30 @@ function logout() {
background: transparent !important; background: transparent !important;
} }
/* 弹窗背景设置为半透明 */
:deep(.el-dialog__wrapper .el-dialog) {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
::v-deep(.el-sub-menu__title:hover) {
background: transparent !important;
}
.message-font { /* 个人信息字体样式 */
font-size: 16px;
font-weight: bold;
} }
/* 确保el-container适应毛玻璃容器 */
:deep(.el-container) {
/* 确保全局el-container适应容器 */
:deep(.el-container) { /* vue3的深度选择器,用于覆盖element-plus的默认样式 */
min-height: 100%; min-height: 100%;
width: 100%; width: 100%;
background: transparent;
} }
:deep(.el-container .el-container) {
background: transparent;
position: relative;
/* 为侧边栏和主内容区域添加滚动条样式 */
.el-aside,
.el-main {
scrollbar-width: thin; /* Firefox */
scrollbar-color: rgba(0, 0, 0, 0.3) rgba(255, 255, 255, 0.2); /* Firefox滑块和轨道颜色 */
} }
</style> </style>
Loading…
Cancel
Save