2026-01-08 11:46:34 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<header class="app-header">
|
2026-01-10 17:31:22 +08:00
|
|
|
<button class="menu-toggle" @click="toggleSidebar" v-if="isMobile">
|
|
|
|
|
<span class="menu-icon"></span>
|
|
|
|
|
</button>
|
2026-01-08 11:46:34 +08:00
|
|
|
<h1>BLS Project Console</h1>
|
|
|
|
|
</header>
|
2026-01-10 17:31:22 +08:00
|
|
|
<div class="app-content">
|
|
|
|
|
<!-- 左侧选择区域 -->
|
|
|
|
|
<aside class="sidebar" :class="{ 'sidebar-closed': !sidebarOpen && isMobile }">
|
|
|
|
|
<router-view name="sidebar" />
|
|
|
|
|
</aside>
|
|
|
|
|
|
|
|
|
|
<!-- 右侧调试区域 -->
|
|
|
|
|
<main class="main-content">
|
|
|
|
|
<router-view name="main" />
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
2026-01-08 11:46:34 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2026-01-10 17:31:22 +08:00
|
|
|
<script setup>
|
|
|
|
|
import { ref, onMounted, onUnmounted } from 'vue';
|
|
|
|
|
|
|
|
|
|
const sidebarOpen = ref(true);
|
|
|
|
|
const isMobile = ref(false);
|
|
|
|
|
|
|
|
|
|
// 检测窗口大小变化
|
|
|
|
|
const checkMobile = () => {
|
|
|
|
|
isMobile.value = window.innerWidth < 768;
|
|
|
|
|
if (isMobile.value) {
|
|
|
|
|
sidebarOpen.value = false;
|
|
|
|
|
} else {
|
|
|
|
|
sidebarOpen.value = true;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 切换侧边栏
|
|
|
|
|
const toggleSidebar = () => {
|
|
|
|
|
sidebarOpen.value = !sidebarOpen.value;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 监听窗口大小变化
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
checkMobile();
|
|
|
|
|
window.addEventListener('resize', checkMobile);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
window.removeEventListener('resize', checkMobile);
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
2026-01-08 11:46:34 +08:00
|
|
|
<style>
|
|
|
|
|
* {
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
body {
|
|
|
|
|
font-family: Arial, sans-serif;
|
2026-01-10 17:31:22 +08:00
|
|
|
background-color: #121212;
|
|
|
|
|
color: #e0e0e0;
|
|
|
|
|
overflow: hidden;
|
2026-01-08 11:46:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.app-container {
|
|
|
|
|
min-height: 100vh;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
2026-01-10 17:31:22 +08:00
|
|
|
background-color: #1e1e1e;
|
2026-01-08 11:46:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.app-header {
|
2026-01-10 17:31:22 +08:00
|
|
|
background-color: #008C8C;
|
2026-01-08 11:46:34 +08:00
|
|
|
color: white;
|
2026-01-10 17:31:22 +08:00
|
|
|
padding: 0.6rem 1rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2026-01-08 11:46:34 +08:00
|
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
2026-01-10 17:31:22 +08:00
|
|
|
z-index: 100;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-toggle {
|
|
|
|
|
background: none;
|
|
|
|
|
border: none;
|
|
|
|
|
color: white;
|
|
|
|
|
font-size: 1.2rem;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
margin-right: 1rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
width: 32px;
|
|
|
|
|
height: 32px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
transition: background-color 0.2s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-toggle:hover {
|
|
|
|
|
background-color: rgba(255, 255, 255, 0.1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-icon {
|
|
|
|
|
display: block;
|
|
|
|
|
width: 20px;
|
|
|
|
|
height: 2px;
|
|
|
|
|
background-color: white;
|
|
|
|
|
position: relative;
|
|
|
|
|
transition: background-color 0.2s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-icon::before,
|
|
|
|
|
.menu-icon::after {
|
|
|
|
|
content: '';
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 20px;
|
|
|
|
|
height: 2px;
|
|
|
|
|
background-color: white;
|
|
|
|
|
transition: transform 0.2s, top 0.2s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-icon::before {
|
|
|
|
|
top: -6px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-icon::after {
|
|
|
|
|
top: 6px;
|
2026-01-08 11:46:34 +08:00
|
|
|
}
|
|
|
|
|
|
2026-01-10 17:31:22 +08:00
|
|
|
.app-header h1 {
|
|
|
|
|
font-size: 1.5rem;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.app-content {
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 左侧选择区域 */
|
|
|
|
|
.sidebar {
|
|
|
|
|
width: 280px;
|
|
|
|
|
background-color: #252526;
|
|
|
|
|
border-right: 1px solid #3e3e42;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
transition: all 0.3s ease;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
z-index: 50;
|
|
|
|
|
color: #e0e0e0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 移动端侧边栏关闭状态 */
|
|
|
|
|
.sidebar-closed {
|
|
|
|
|
width: 0;
|
|
|
|
|
border-right: none;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 右侧调试区域 */
|
|
|
|
|
.main-content {
|
2026-01-08 11:46:34 +08:00
|
|
|
flex: 1;
|
2026-01-10 17:31:22 +08:00
|
|
|
padding: 0;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
background-color: #1e1e1e;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 响应式设计 */
|
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
.menu-toggle {
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sidebar {
|
|
|
|
|
position: fixed;
|
|
|
|
|
left: 0;
|
|
|
|
|
top: 60px;
|
|
|
|
|
height: calc(100vh - 60px);
|
|
|
|
|
width: 280px;
|
|
|
|
|
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sidebar-closed {
|
|
|
|
|
left: -280px;
|
|
|
|
|
width: 280px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.main-content {
|
|
|
|
|
padding: 0.5rem;
|
|
|
|
|
overflow: auto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (min-width: 769px) {
|
|
|
|
|
.menu-toggle {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sidebar {
|
|
|
|
|
width: 280px;
|
|
|
|
|
}
|
2026-01-08 11:46:34 +08:00
|
|
|
}
|
|
|
|
|
</style>
|