From c1d2051abc8ca88cd07f0d7c56c0dbf8165d5c33 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期四, 18 九月 2025 17:02:22 +0800 Subject: [PATCH] 2025.9.18 数据产品(待完成) --- src/components/core/BaseContentLayout.vue | 26 ++++++++++++++++---------- 1 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/components/core/BaseContentLayout.vue b/src/components/core/BaseContentLayout.vue index ce92424..dfd48a8 100644 --- a/src/components/core/BaseContentLayout.vue +++ b/src/components/core/BaseContentLayout.vue @@ -4,12 +4,12 @@ <slot name="header"></slot> </el-header> <el-container> - <el-aside class="el-aside" :style="'height: ' + mainHeight"> - <el-scrollbar> + <el-aside class="el-aside" :style="{ height: mainHeight + 'px' }"> + <el-scrollbar :noresize="false"> <slot name="aside"></slot> </el-scrollbar> </el-aside> - <el-main class="el-main" :style="'height: ' + mainHeight"> + <el-main class="el-main" :style="{ height: mainHeight + 'px' }"> <slot name="main"></slot> </el-main> </el-container> @@ -18,10 +18,11 @@ <script> export default { + inject: ['contentMaxHeight'], // 鍙充晶鎿嶄綔鐣岄潰鍩虹甯冨眬 data() { return { - mainHeight: 'calc(100vh - 60px * 2 - var(--el-main-padding) * 2)' + mainHeight: this.contentMaxHeight.value }; }, methods: { @@ -30,14 +31,17 @@ if (this.$refs.headerRef) { const h1 = this.$refs.headerRef.$el.offsetHeight; const h = h1; - return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2)`; + return this.contentMaxHeight.value - h; + // return `calc(100vh - ${h}px - 60px - var(--el-main-padding) * 2 + 6px)`; } else { - return `calc(100vh - 60px * 2 - var(--el-main-padding) * 2)`; + return this.contentMaxHeight.value; } } }, mounted() { - this.mainHeight = this.calHeight(); + setTimeout(() => { + this.mainHeight = this.calHeight(); + }, 150); } }; </script> @@ -45,19 +49,21 @@ <style scoped> .el-aside { /* width: initial; */ + /* overflow-x: auto; */ position: relative; /* height: calc(100vh - 60px * 2 - 20px * 2); */ /* background-color: aqua; */ /* overflow-y: auto; */ border-right: 1px solid var(--el-color-info-light-7); + /* box-shadow: -10px 0px 4px rgba(0, 0, 0, 0.12) inset; */ } .el-header { height: initial; - padding: 0 0 0px 0; + padding: 0 0 4px 0; /* background-color: rgb(216, 201, 201); */ /* border-bottom: 1px solid var(--el-color-info-light-7); */ - margin-bottom: 4px; + /* margin-bottom: 4px; */ } .el-main { @@ -65,7 +71,7 @@ /* background-color: whitesmoke; */ /* height: calc(100vh - 60px * 2 - 20px * 2); */ padding: initial; - padding-left: 20px; + padding-left: 10px; /* overflow: hidden; */ } </style> -- Gitblit v1.9.3