feat(ui): UI 骨架与请求集成(sider、tabs、接口面板 sk-key 走 store、手动查询)

t-tabs 用官方 list prop 数据驱动(受控 value + 动态增删语义干净);请求纯手动触发,enabled 门控 + refetch,staleTime Infinity 切 tab 不重发,queryKey ['endpoint', path, skKey] 换 key 即新查询;endpoint-panel 的 sk-key computed 读写 store,切 tab 输入保留。
This commit is contained in:
2026-09-08 00:49:37 +08:00
parent 3f95335651
commit 60ba5b6306
10 changed files with 746 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
/**
* 应用外壳:双栏布局(左 sider 接口列表 + 右 tabs 详情区)
* 暗色默认(设计文档 §2 定案);组件拆分见实施计划阶段四
*/
<script setup lang="ts">
import { storeToRefs } from 'pinia';
import RequestTabs from '@/components/request-tabs.vue';
import SideNav from '@/components/side-nav.vue';
import { useBenchStore } from '@/stores/bench-store';
const benchStore = useBenchStore();
const { activeTab } = storeToRefs(benchStore);
</script>
<template>
<div class="app-shell">
<SideNav />
<main class="main-area">
<RequestTabs v-if="activeTab" />
<div v-else class="empty-state">
<p>从左侧选择一个接口开始调试</p>
<p class="empty-hint">sk-key 仅存于当前页面会话,刷新即重置</p>
</div>
</main>
</div>
</template>
<style scoped>
.app-shell {
display: flex;
height: 100vh;
overflow: hidden;
}
.main-area {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
.empty-state {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 8px;
color: var(--td-text-color-placeholder);
}
.empty-hint {
font-size: 12px;
opacity: 0.6;
}
</style>