You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

134 lines
2.2 KiB

<script setup>
import { ref, watch } from 'vue'
import { useRoute } from 'vue-router'
import SideMenu from '@/layout/components/SideMenu.vue'
import TopBar from '@/layout/components/TopBar.vue'
import MapLayer from '@/layout/MapLayer.vue'
const route = useRoute()
const sidebarOpen = ref(false)
watch(
() => route.fullPath,
() => {
sidebarOpen.value = false
}
)
function toggleSidebar() {
sidebarOpen.value = !sidebarOpen.value
}
function closeSidebar() {
sidebarOpen.value = false
}
</script>
<template>
<t-layout :class="s.root">
<t-aside :class="[s.aside, { [s.asideOpen]: sidebarOpen }]">
<SideMenu />
</t-aside>
<div v-if="sidebarOpen" :class="s.mask" @click="closeSidebar" />
<t-layout :class="s.main">
<t-header :class="s.header">
<TopBar @toggle-sidebar="toggleSidebar" />
</t-header>
<t-content :class="s.content">
<MapLayer />
<div :class="s.view">
<router-view />
</div>
</t-content>
</t-layout>
</t-layout>
</template>
<style lang="less" module="s">
.root {
height: 100vh;
overflow: hidden;
background: #eef3f7;
:global {
.t-layout__sider {
width: 208px !important;
min-width: 208px;
flex-shrink: 0;
background: #1a2b36 !important;
border: none !important;
}
.t-layout__header {
height: auto;
padding: 0;
background: transparent;
border: none;
line-height: normal;
}
.t-layout__content {
padding: 0;
}
}
}
.aside {
height: 100vh;
z-index: 30;
}
.main {
min-width: 0;
height: 100vh;
overflow: hidden;
}
.header {
flex-shrink: 0;
z-index: 20;
}
.content {
position: relative;
height: 100%;
overflow: hidden;
background: transparent;
}
.view {
position: absolute;
inset: 0;
z-index: 1;
height: 100%;
min-height: 0;
overflow: hidden;
pointer-events: none;
}
.mask {
display: none;
}
@media (max-width: 1020px) {
.aside {
position: fixed;
left: -208px;
top: 0;
transition: left 0.2s ease;
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.asideOpen {
left: 0;
}
.mask {
display: block;
position: fixed;
inset: 0;
background: rgba(15, 23, 32, 0.36);
z-index: 25;
}
}
</style>