wip: 临时提交
This commit is contained in:
@@ -37,16 +37,58 @@ defineProps({
|
|||||||
color: $sidebar-logo-text-color;
|
color: $sidebar-logo-text-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
// 全局样式:针对顶部布局和混合布局的特殊处理
|
||||||
.layout-top,
|
.layout-top,
|
||||||
.layout-mix {
|
.layout-mix {
|
||||||
.logo {
|
.logo {
|
||||||
width: $sidebar-width;
|
// 在顶部和混合布局中,移除背景色,使其透明
|
||||||
|
background-color: transparent !important;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
// 确保标题颜色适配当前主题
|
||||||
|
color: var(--menu-text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 顶部布局的响应式宽度控制
|
||||||
|
.layout-top {
|
||||||
|
.layout__header-left .logo {
|
||||||
|
flex-shrink: 0; // 防止Logo被压缩
|
||||||
|
width: $sidebar-width; // 默认宽度:显示logo+文字
|
||||||
|
margin-right: 20px;
|
||||||
|
|
||||||
|
// 中屏设备优化(800px-1100px):适度缩小但保持显示文字
|
||||||
|
@media (min-width: 768px) and (max-width: 1100px) {
|
||||||
|
width: 180px; // 缩小到180px,为菜单腾出空间
|
||||||
|
margin-right: 16px; // 减少右边距
|
||||||
}
|
}
|
||||||
|
|
||||||
&.hideSidebar {
|
// 小屏设备:只显示logo,使用收缩宽度
|
||||||
.logo {
|
@media (max-width: 767px) {
|
||||||
width: $sidebar-width-collapsed;
|
width: $sidebar-width-collapsed; // 只显示logo:54px
|
||||||
|
margin-right: 12px; // 减少右边距
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 混合布局的响应式宽度控制
|
||||||
|
.layout-mix {
|
||||||
|
.layout__header-logo .logo {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: $sidebar-width; // 默认宽度:显示logo+文字
|
||||||
|
|
||||||
|
// 中屏设备优化(800px-1100px):适度缩小但保持显示文字
|
||||||
|
@media (min-width: 768px) and (max-width: 1100px) {
|
||||||
|
width: 180px; // 缩小到180px,为菜单腾出空间
|
||||||
|
}
|
||||||
|
|
||||||
|
// 小屏设备:只显示logo,使用收缩宽度
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
width: $sidebar-width-collapsed; // 只显示logo:54px
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ const iconComponent = computed(() => props.icon?.replace("el-icon-", ""));
|
|||||||
.el-sub-menu,
|
.el-sub-menu,
|
||||||
.el-menu-item {
|
.el-menu-item {
|
||||||
.el-icon {
|
.el-icon {
|
||||||
margin-left: 20px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[class^="i-svg:"] {
|
[class^="i-svg:"] {
|
||||||
margin-left: 20px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
<div
|
<div
|
||||||
v-if="defaultSettings.showSettings"
|
v-if="defaultSettings.showSettings"
|
||||||
class="navbar-actions__item"
|
class="navbar-actions__item"
|
||||||
@click="settingStore.settingsVisible = true"
|
@click="handleSettingsClick"
|
||||||
>
|
>
|
||||||
<div class="i-svg:setting" />
|
<div class="i-svg:setting" />
|
||||||
</div>
|
</div>
|
||||||
@@ -68,6 +68,13 @@ import { useAppStore, useSettingsStore, useUserStore } from "@/store";
|
|||||||
import { SidebarColor, ThemeMode } from "@/enums/settings/theme.enum";
|
import { SidebarColor, ThemeMode } from "@/enums/settings/theme.enum";
|
||||||
import { LayoutMode } from "@/enums";
|
import { LayoutMode } from "@/enums";
|
||||||
|
|
||||||
|
// 导入子组件
|
||||||
|
import MenuSearch from "@/components/MenuSearch/index.vue";
|
||||||
|
import Fullscreen from "@/components/Fullscreen/index.vue";
|
||||||
|
import SizeSelect from "@/components/SizeSelect/index.vue";
|
||||||
|
import LangSelect from "@/components/LangSelect/index.vue";
|
||||||
|
import Notification from "@/components/Notification/index.vue";
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const settingStore = useSettingsStore();
|
const settingStore = useSettingsStore();
|
||||||
@@ -127,6 +134,13 @@ function logout() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开系统设置页面
|
||||||
|
*/
|
||||||
|
function handleSettingsClick() {
|
||||||
|
settingStore.settingsVisible = true;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -136,45 +150,37 @@ function logout() {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
&__item {
|
&__item {
|
||||||
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
min-width: 36px;
|
min-width: 44px; /* 增加最小点击区域到44px,符合人机交互标准 */
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
min-height: 44px;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
|
|
||||||
// 确保直接子元素也居中
|
// 确保子元素居中
|
||||||
> * {
|
> * {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 确保 el-dropdown 也居中
|
// 确保 Element Plus 组件可以正常工作
|
||||||
:deep(.el-dropdown) {
|
:deep(.el-dropdown),
|
||||||
|
:deep(.el-tooltip) {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修复可能的 SVG 图标容器
|
// 图标样式
|
||||||
:deep(.icon-container),
|
|
||||||
:deep(.action-icon) {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 默认图标样式(明亮模式 + 左侧布局)
|
|
||||||
:deep([class^="i-svg:"]) {
|
:deep([class^="i-svg:"]) {
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
color: var(--el-text-color-regular);
|
color: var(--el-text-color-regular);
|
||||||
|
|||||||
@@ -36,12 +36,9 @@ function toggleSideBar() {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.navbar {
|
.navbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
height: $navbar-height;
|
height: $navbar-height;
|
||||||
padding: 0 20px;
|
|
||||||
background: var(--el-bg-color);
|
|
||||||
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
|
|
||||||
|
|
||||||
&__actions {
|
&__actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -165,17 +165,8 @@ console.log("🎨 MixLayout rendered");
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0 16px;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
@media (min-width: 768px) and (max-width: 1200px) {
|
|
||||||
margin: 0 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 767px) {
|
|
||||||
margin: 0 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.el-menu) {
|
:deep(.el-menu) {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ const isLogoCollapsed = computed(() => width.value < 768);
|
|||||||
overflow: hidden; // 防止溢出
|
overflow: hidden; // 防止溢出
|
||||||
|
|
||||||
// Logo 样式 - 使用SCSS变量管理宽度
|
// Logo 样式 - 使用SCSS变量管理宽度
|
||||||
:deep(.sidebar-logo) {
|
:deep(.logo) {
|
||||||
flex-shrink: 0; // 防止Logo被压缩
|
flex-shrink: 0; // 防止Logo被压缩
|
||||||
width: $sidebar-width; // 默认宽度:显示logo+文字
|
width: $sidebar-width; // 默认宽度:显示logo+文字
|
||||||
height: $navbar-height;
|
height: $navbar-height;
|
||||||
@@ -91,14 +91,9 @@ const isLogoCollapsed = computed(() => width.value < 768);
|
|||||||
margin-right: 12px; // 减少右边距
|
margin-right: 12px; // 减少右边距
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-logo__link {
|
a {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
|
||||||
width: 100%;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user