From 446e503a51c904c9330fbd60043468e02a2e6b57 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期四, 03 四月 2025 16:27:34 +0800 Subject: [PATCH] sidebarIsShow --- src/layout/component/main.vue | 50 +++++++++++++++++++++++++++++++++++++------------- 1 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/layout/component/main.vue b/src/layout/component/main.vue index ae57df5..3f70a1a 100644 --- a/src/layout/component/main.vue +++ b/src/layout/component/main.vue @@ -7,22 +7,29 @@ ref="layoutMainScrollbarRef" 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 v-if="!isSharePage && sidebarIsShow" :isShow="sidebarIsShow" @toggleSidebar="toggleSidebar"/> + <!-- <WorkSpaceMenu v-show="isWorkSpace" /> --> + <div v-show="isAskAnswer || isHome"> + <SideBar v-if="!isSharePage " :isShow="sidebarIsShow" @toggleSidebar="toggleSidebar" /> + <!-- <SidebarOther v-if="!isSharePage && !sidebarIsShow" :isShow="!sidebarIsShow" @toggleSidebar="toggleSidebar" /> --> + </div> + <GisMenu v-show="isGis" /> + <div class="flex-auto flex-col flex right-container" :class="{ // 'm-[6px]': !isSharePage, // 'rounded-[10px]': !isSharePage, - 'bg-[#1c1e1d]': !isSharePage, + 'bg-[var(--color-bg-side)]': !isSharePage, 'bg-[#f7f8fa]': isSharePage, }" > - <Header v-if="!isSharePage" class="flex-0" @toggleSidebar="toggleSidebar" :sidebarIsShow="sidebarIsShow"/> + <Header v-if="!isSharePage" class="flex-0" :sidebarIsShow="sidebarIsShow" /> <ShareHeader v-else class="flex-0"></ShareHeader> <LayoutParentView class="flex-auto" /> </div> + <Login v-show="isShowLogin" /> </el-scrollbar> <el-backtop :target="setBacktopClass" /> </el-main> @@ -34,17 +41,35 @@ import { useRoute } from 'vue-router'; import Header from './header/Header.vue'; import ShareHeader from './header/ShareHeader.vue'; - +import { selectFirstRoom, sidebarIsShow, toggleSidebar } from '/@/stores/chatRoom'; +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 { isSharePage } from '/@/stores/chatRoom'; import { Local } from '/@/utils/storage'; - +import WorkSpaceMenu from './sidebar/WorkSpaceMenu.vue'; +import GisMenu from './sidebar/GisMenu.vue'; +import router from '/@/router/index'; // 寮曞叆缁勪欢 const LayoutParentView = defineAsyncComponent(() => import('/@/layout/routerView/parent.vue')); const LayoutFooter = defineAsyncComponent(() => import('/@/layout/footer/index.vue')); + +const isWorkSpace = computed(() => { + return router.currentRoute.value.path.startsWith('/workspace'); +}); +const isAskAnswer = computed(() => { + return router.currentRoute.value.path.startsWith('/ask_answer'); +}); +const isHome = computed(() => { + return router.currentRoute.value.path.startsWith('/home'); +}); +const isGis = computed(() => { + return router.currentRoute.value.path.startsWith('/gis'); +}); + // 瀹氫箟鍙橀噺鍐呭 const layoutMainScrollbarRef = ref(); const route = useRoute(); @@ -52,7 +77,6 @@ const storesThemeConfig = useThemeConfig(); const { themeConfig } = storeToRefs(storesThemeConfig); const { isTagsViewCurrenFull } = storeToRefs(storesTagsViewRoutes); - // 璁剧疆 footer 鏄剧ず/闅愯棌 const isFooter = computed(() => { return themeConfig.value.isFooter && !route.meta.isIframe; @@ -76,6 +100,7 @@ // 椤甸潰鍔犺浇鍓� onMounted(() => { NextLoading.done(600); + selectFirstRoom(); }); // 鏆撮湶鍙橀噺 @@ -84,11 +109,10 @@ }); //#region ====================== 渚ц竟鏍忔樉绀洪殣钘� ====================== -const sidebarIsShow = ref(!!Local.get('sidebarIsShow')); -const toggleSidebar = (val) => { - sidebarIsShow.value = val; - Local.set('sidebarIsShow',val) -}; +// const sidebarIsShow = ref( true); +// const toggleSidebar = (val) => { +// sidebarIsShow.value = val; +// }; //#endregion </script> -- Gitblit v1.9.3