Files
syops/frontend/src/features/admin/views/AdminLayout.vue
T
hugoandCursor 323928626b feat(shipping-process-gates): 落地全门禁中断恢复并消除双真相
纳入 Execution/Gate/Attempt 模型与迁移、Worker/API/前端恢复卡片与 Admin 诊断,
Gate 阻断时清零旧 action_buttons,异常摘要统一脱敏,并为运维筛选与 Attempt Diff 补齐入口。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-01 13:08:32 +08:00

56 lines
2.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* features/admin/views/AdminLayout.vue
* 管理后台壳层:顶栏 + 左侧导航 + 子路由出口。
* 依赖:AdminNav、vue-router、admin-nav.store。
* 逻辑:AdminNav 统一承担模块和二级目录导航;lg 起侧栏与内容并排,
* 小于 lg(含 768px)上下堆叠,避免运维诊断页主区被侧栏挤窄。
*/
<script setup lang="ts">
import { onMounted } from 'vue';
import { ArrowLeft } from 'lucide-vue-next';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import AppHeaderTools from '@/shared/layouts/AppHeaderTools.vue';
import AdminNav from '../components/AdminNav.vue';
import { useAdminNavStore } from '../stores/admin-nav.store';
const { t } = useI18n();
const router = useRouter();
const navStore = useAdminNavStore();
// 进入 /admin 时拉一次角标;切换子路由不重复挂载 Layout,故不会重复请求
onMounted(() => {
void navStore.ensureBadges();
});
</script>
<template>
<div class="page-shell min-h-screen font-sans flex flex-col">
<header class="app-header px-6">
<div class="flex items-center gap-4">
<button type="button" class="btn-icon-ds lg:block hidden" @click="navStore.toggleSidebar()">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/></svg>
</button>
<button type="button" class="btn-icon-ds" @click="router.push('/workspace')">
<ArrowLeft class="w-6 h-6" />
</button>
<div class="flex flex-col">
<h1 class="text-xl md:text-2xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-brand-600 to-indigo-600 tracking-tight">
{{ t('admin.title') }}
</h1>
<span class="text-xs text-muted font-medium tracking-wide">{{ t('admin.subtitle') }}</span>
</div>
</div>
<AppHeaderTools />
</header>
<!-- lg 起才并排侧栏;768px 平板保持上下堆叠,避免诊断等运维页主内容被挤窄 -->
<main class="flex-1 w-full mx-auto px-4 md:px-8 py-6 md:py-8 flex flex-col lg:flex-row gap-6 lg:gap-8 items-start">
<AdminNav />
<section class="flex-1 min-w-0 w-full space-y-8">
<router-view />
</section>
</main>
</div>
</template>