From 997e31e7bee99b7e46e9fb9cee152d58210fef13 Mon Sep 17 00:00:00 2001
From: xiaoxian521 <1923740402@qq.com>
Date: Mon, 18 Oct 2021 16:21:30 +0800
Subject: [PATCH] =?UTF-8?q?style:=20=E4=BF=AE=E5=A4=8D=E6=A0=B7=E5=BC=8F?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/serverConfig.json | 2 +-
src/layout/components/appMain.vue | 75 +++++++++++++------------------
src/layout/index.vue | 13 ------
src/plugins/vxe-table/index.ts | 2 +-
src/style/sidebar.scss | 32 ++++++++++++-
5 files changed, 65 insertions(+), 59 deletions(-)
diff --git a/public/serverConfig.json b/public/serverConfig.json
index 839e7ad..ccb3f8b 100644
--- a/public/serverConfig.json
+++ b/public/serverConfig.json
@@ -1,7 +1,7 @@
{
"Version": "2.1.0",
"Title": "PureAdmin",
- "FixedHeader": false,
+ "FixedHeader": true,
"HiddenSideBar": false,
"KeepAlive": true,
"Locale": "zh",
diff --git a/src/layout/components/appMain.vue b/src/layout/components/appMain.vue
index 49c9d15..26590be 100644
--- a/src/layout/components/appMain.vue
+++ b/src/layout/components/appMain.vue
@@ -15,57 +15,46 @@ const transition = computed(() => {
-
-
-
-
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
diff --git a/src/layout/index.vue b/src/layout/index.vue
index 266fa08..f4c7163 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -234,19 +234,6 @@ onBeforeMount(() => {
z-index: 999;
}
-.fixed-header {
- position: fixed;
- top: 0;
- right: 0;
- z-index: 9;
- width: calc(100% - 210px);
- transition: width 0.28s;
-}
-
-.mobile .fixed-header {
- width: 100%;
-}
-
.re-screen {
margin-top: 12px;
}
diff --git a/src/plugins/vxe-table/index.ts b/src/plugins/vxe-table/index.ts
index 7c94f0c..35d64e9 100644
--- a/src/plugins/vxe-table/index.ts
+++ b/src/plugins/vxe-table/index.ts
@@ -51,7 +51,7 @@ import {
VXETable.setup({
size: "medium",
version: 0,
- zIndex: 100,
+ zIndex: 1002,
table: {
// 自动监听父元素的变化去重新计算表格
autoResize: true,
diff --git a/src/style/sidebar.scss b/src/style/sidebar.scss
index 79fb078..53768a0 100644
--- a/src/style/sidebar.scss
+++ b/src/style/sidebar.scss
@@ -23,6 +23,15 @@
position: relative;
}
+ .fixed-header {
+ position: fixed;
+ top: 0;
+ right: 0;
+ z-index: 9;
+ width: calc(100% - 210px);
+ transition: width 0.28s;
+ }
+
.el-popper.is-light {
border: none !important;
}
@@ -402,6 +411,11 @@
// 手机端
.mobile {
+ .fixed-header {
+ width: 100% !important;
+ transition: width 0.28s;
+ }
+
.main-container {
margin-left: 0 !important;
}
@@ -429,9 +443,14 @@
}
body[data-layout="vertical"] {
+ .fixed-header + .app-main {
+ padding-top: 85px;
+ }
+
.hideSidebar {
.fixed-header {
- width: calc(100% - 54px);
+ width: calc(100% - 54px) !important;
+ transition: width 0.28s;
}
.sidebar-container {
@@ -478,6 +497,17 @@ body[data-layout="vertical"] {
}
}
+body[data-layout="horizontal"] {
+ .fixed-header {
+ width: 100% !important;
+ transition: none !important;
+ }
+
+ .fixed-header + .app-main {
+ padding-top: 98px;
+ }
+}
+
// vertical模式下暗色主题
body[data-layout="vertical"][data-theme="dark"] {
$subMenuActiveText: #f4f4f5;