From c6d8ea02ade42a78e9f4a2304e8e1c5f67853d91 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期四, 06 三月 2025 16:17:06 +0800 Subject: [PATCH] 创建工单 --- src/layout/component/main.vue | 57 ++++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 38 insertions(+), 19 deletions(-) diff --git a/src/layout/component/main.vue b/src/layout/component/main.vue index 6f1a255..c0bcfa2 100644 --- a/src/layout/component/main.vue +++ b/src/layout/component/main.vue @@ -5,36 +5,49 @@ > <el-scrollbar ref="layoutMainScrollbarRef" - class="layout-main-scroll layout-backtop-header-fixed" + class="layout-main-scroll layout-backtop-header-fixed" wrap-class="layout-main-scroll flex" - view-class="layout-main-scroll bg-[#1c1e1d] flex h100 w-full" + view-class="layout-main-scroll bg-[var(--color-bg-side)] flex h100 w-full" > - <SideBar /> - <div class="flex-auto flex-col flex right-container"> - <waterHeader class="flex-0"/> + <SideBar v-if="!isSharePage && sidebarIsShow" :isShow="sidebarIsShow" @toggleSidebar="toggleSidebar" /> + <SidebarOther v-if="!isSharePage && !sidebarIsShow" :isShow="!sidebarIsShow" @toggleSidebar="toggleSidebar" /> + <div + class="flex-auto flex-col flex right-container" + :class="{ + // 'm-[6px]': !isSharePage, + // 'rounded-[10px]': !isSharePage, + 'bg-[var(--color-bg-side)]': !isSharePage, + 'bg-[#f7f8fa]': isSharePage, + }" + > + <Header v-if="!isSharePage" class="flex-0" :sidebarIsShow="sidebarIsShow" /> + <ShareHeader v-else class="flex-0"></ShareHeader> <LayoutParentView class="flex-auto" /> </div> - <!-- <LayoutFooter v-if="isFooter" /> --> + <Login v-show="isShowLogin" /> </el-scrollbar> <el-backtop :target="setBacktopClass" /> </el-main> </template> <script setup lang="ts" name="layoutMain"> -import { defineAsyncComponent, onMounted, computed, ref } from 'vue'; -import { useRoute } from 'vue-router'; import { storeToRefs } from 'pinia'; +import { computed, defineAsyncComponent, onMounted, ref } from 'vue'; +import { useRoute } from 'vue-router'; +import Header from './header/Header.vue'; +import ShareHeader from './header/ShareHeader.vue'; + +import Login from './login/Login.vue'; +import SideBar from './sidebar/Sidebar.vue'; +import SidebarOther from './sidebar/SidebarOther.vue'; +import { isSharePage, isShowLogin } from '/@/stores/chatRoom'; import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes'; import { useThemeConfig } from '/@/stores/themeConfig'; import { NextLoading } from '/@/utils/loading'; -import SideBar from './SideBar.vue'; -import WIHeader from './WIHeader.vue'; -import waterHeader from '/@/views/project/ch/home/component/waterRight/header.vue'; - +import { Local } from '/@/utils/storage'; // 寮曞叆缁勪欢 const LayoutParentView = defineAsyncComponent(() => import('/@/layout/routerView/parent.vue')); const LayoutFooter = defineAsyncComponent(() => import('/@/layout/footer/index.vue')); - // 瀹氫箟鍙橀噺鍐呭 const layoutMainScrollbarRef = ref(); const route = useRoute(); @@ -42,7 +55,6 @@ const storesThemeConfig = useThemeConfig(); const { themeConfig } = storeToRefs(storesThemeConfig); const { isTagsViewCurrenFull } = storeToRefs(storesTagsViewRoutes); - // 璁剧疆 footer 鏄剧ず/闅愯棌 const isFooter = computed(() => { return themeConfig.value.isFooter && !route.meta.isIframe; @@ -72,20 +84,27 @@ defineExpose({ layoutMainScrollbarRef, }); + +//#region ====================== 渚ц竟鏍忔樉绀洪殣钘� ====================== +const sidebarIsShow = ref(Local.get('sidebarIsShow') ?? true); +const toggleSidebar = (val) => { + sidebarIsShow.value = val; + Local.set('sidebarIsShow', val); +}; +//#endregion </script> <style scoped lang="scss"> -.right-container{ +.right-container { width: 100vw; // margin: 0; padding: 0; overflow: hidden; -webkit-box-sizing: border-box; box-sizing: border-box; - background-color: #1c1e1d; + // background-color: #1c1e1d; font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; - margin: 6px; - border-radius: 10px; - + // margin: 6px; + // border-radius: 10px; } </style> -- Gitblit v1.9.3