style: 重新调整结构

This commit is contained in:
2025-07-11 17:31:49 +08:00
parent b4bb563782
commit eedec80927
8 changed files with 55 additions and 25 deletions

View File

@@ -0,0 +1,70 @@
<template>
<div class="h-full flex flex-col">
<div class="tabs tabs-box flex-shrink-0">
<label class="tab">
<input
type="radio"
name="function-bar"
id="1"
checked
@change="handleTabChange"
/>
<TerminalIcon class="icon" />
日志终端
</label>
<label class="tab">
<input
type="radio"
name="function-bar"
id="2"
@change="handleTabChange"
/>
<VideoIcon class="icon" />
HTTP视频流
</label>
<label class="tab">
<input
type="radio"
name="function-bar"
id="3"
@change="handleTabChange"
/>
<SquareActivityIcon class="icon" />
示波器
</label>
</div>
<div class="flex-1 overflow-hidden">
<div v-if="checkID === 1" class="h-full overflow-y-auto"></div>
<div v-else-if="checkID === 2" class="h-full overflow-y-auto">
<VideoStreamView />
</div>
<div v-else-if="checkID === 3" class="h-full overflow-y-auto">
<OscilloscopeView />
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { VideoIcon, SquareActivityIcon, TerminalIcon } from "lucide-vue-next";
import VideoStreamView from "@/views/Project/VideoStream.vue";
import OscilloscopeView from "@/views/Project/Oscilloscope.vue";
import { isNull, toNumber } from "lodash";
import { ref } from "vue";
const checkID = ref(1);
function handleTabChange(event: Event) {
const target = event.currentTarget as HTMLInputElement;
if (isNull(target)) return;
checkID.value = toNumber(target.id);
}
</script>
<style scoped>
@import "../assets/main.css";
.icon {
@apply h-4 w-4 opacity-70 mr-1.5;
}
</style>

View File

@@ -94,7 +94,7 @@ import DiagramCanvas from "@/components/LabCanvas/DiagramCanvas.vue";
import ComponentSelector from "@/components/LabCanvas/ComponentSelector.vue";
import PropertyPanel from "@/components/PropertyPanel.vue";
import MarkdownRenderer from "@/components/MarkdownRenderer.vue";
import FunctionBar from "@/components/FunctionBar.vue";
import FunctionBar from "@/views/Project/BottomBar.vue";
import { useProvideComponentManager } from "@/components/LabCanvas";
import type { DiagramData } from "@/components/LabCanvas";
import { useAlertStore } from "@/components/Alert";

44
src/views/User/Index.vue Normal file
View File

@@ -0,0 +1,44 @@
<template>
<div class="min-h-screen bg-base-100 container mx-auto p-6 space-y-6 flex flex-row">
<ul class="menu bg-base-200 w-56 gap-2 rounded-2xl p-5">
<li id="1" @click="setActivePage">
<a :class="{ 'menu-active': activePage === 1 }">用户信息</a>
</li>
<li id="2" @click="setActivePage">
<a :class="{ 'menu-active': activePage === 2 }">Item 2</a>
</li>
</ul>
<div class="divider divider-horizontal h-full"></div>
<div class="card bg-base-200 w-300"></div>
</div>
</template>
<script setup lang="ts">
import { toNumber } from "lodash";
import { ref } from "vue";
const activePage = ref(1);
function setActivePage(event: Event) {
const target = event.currentTarget as HTMLLinkElement;
activePage.value = toNumber(target.id);
}
</script>
<style scoped>
.menu-active {
position: relative;
}
.menu-active::before {
content: "";
position: absolute;
left: -12px;
top: 50%;
transform: translateY(-50%);
width: 4px;
height: 80%;
background-color: var(--color-primary);
border-radius: 2px;
}
</style>

View File

@@ -1,13 +0,0 @@
<template>
<div class="min-h-screen bg-base-100 container mx-auto p-6 space-y-6">
<ul class="menu bg-base-200 w-56 gap-2 rounded-2xl">
<li><a>Item 1</a></li>
<li><a>Item 2</a></li>
<li><a>Item 3</a></li>
</ul>
</div>
</template>
<script setup lang="ts"></script>
<style scoped></style>