feat: 后端添加获取空闲实验板,继续修改前端界面使其更加合理

This commit is contained in:
2025-07-12 14:59:28 +08:00
parent 44e357b887
commit 0fb0c4e395
11 changed files with 222 additions and 117 deletions

View File

@@ -72,7 +72,7 @@
:min-size="15"
class="w-full overflow-hidden"
>
<FunctionBar class="mx-4 mt-1" />
<BottomBar class="mx-4 mt-1" />
</SplitterPanel>
</SplitterGroup>
</div>
@@ -89,18 +89,21 @@
<script setup lang="ts">
import { ref, onMounted, watch } from "vue";
import { useRouter } from "vue-router";
import { SplitterGroup, SplitterPanel, SplitterResizeHandle } from "reka-ui";
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 "@/views/Project/BottomBar.vue";
import BottomBar from "@/views/Project/BottomBar.vue";
import { useProvideComponentManager } from "@/components/LabCanvas";
import type { DiagramData } from "@/components/LabCanvas";
import { useAlertStore } from "@/components/Alert";
import { AuthManager } from "@/utils/AuthManager";
import { useRoute } from "vue-router";
const route = useRoute();
const router = useRouter();
// 提供组件管理服务
const componentManager = useProvideComponentManager();
@@ -207,6 +210,20 @@ function updateComponentDirectProp(
// --- 生命周期钩子 ---
onMounted(async () => {
// 验证用户身份
try {
const isAuthenticated = await AuthManager.isAuthenticated();
if (!isAuthenticated) {
// 验证失败,跳转到登录页面
router.push('/login');
return;
}
} catch (error) {
console.error('身份验证失败:', error);
router.push('/login');
return;
}
// 检查是否有例程参数,如果有则自动打开文档面板
if (route.query.tutorial) {
showDocPanel.value = true;

View File

@@ -1,6 +1,6 @@
<template>
<div
class="min-h-screen bg-base-100 flex flex-col mx-auto p-6 space-y-6 container"
class="min-h-screen bg-base-100 flex flex-col p-6 space-y-6 "
>
<!-- 设置 -->
<div class="card bg-base-200 shadow-xl">

View File

@@ -1,6 +1,6 @@
<template>
<div class="min-h-screen bg-base-100">
<div class="container mx-auto p-6 space-y-6">
<div class="p-6">
<!-- 控制面板 -->
<div class="card bg-base-200 shadow-xl">
<div class="card-body">