Files
syops/frontend/src/features/admin/views/AdminLayout.vue
T
hugo bf3154033b refactor(admin): 管理端组件库迁移 Element Plus
- App/ChatView 接入 ElConfigProvider 多语言(zh-CN/zh-TW/en),AdminLayout 间距壳层统一持有
- OrderProfile 全家 22 文件迁移:页头/按钮/徽标/自绘弹窗/表单控件统一 element-trial 范式
- schema/审计中心/字段资产/身份规则/库存源/连接器/调拨类型页面同步迁移,新增 __tests__ 回归
- 迁移遵循「业务脚本零改动」:事件内联适配保持原 handler 契约,焦点陷阱与关闭语义不变
- i18n admin/common 四语言补充组件文案,架构文档记录迁移范式
2026-10-16 19:44:16 +08:00

54 lines
2.4 KiB
Vue

/**
* features/admin/views/AdminLayout.vue
* 管理后台壳层:顶栏 + AdminNav + 子路由出口。
* 依赖:AdminNav、admin-nav.store、AppHeaderTools。
* 逻辑:桌面端导航与业务内容为独立纵向滚动区,任一侧滚动不带动另一侧。
* 【间距所有权】布局间距统一由本壳层持有:导航↔内容 gap 16px(gap-4)、
* 内容区左内边距 20px(md:pl-5,与外层 8px 栅格对齐),各业务页面根容器
* 不得自带水平 padding / max-w 居中,页面只负责内部块间距与内容样式。
*/
<script setup lang="ts">
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();
</script>
<template>
<div class="page-shell flex h-dvh min-h-screen flex-col overflow-hidden font-sans">
<header class="app-header shrink-0 px-6">
<div class="flex items-center gap-4">
<button type="button" class="btn-icon-ds md: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>
<main class="flex min-h-0 flex-1 w-full flex-col gap-4 overflow-hidden px-4 py-6 md:flex-row md:items-stretch md:px-8 md:py-8">
<aside class="min-h-0 shrink-0 overflow-y-auto md:pr-1">
<AdminNav />
</aside>
<section class="min-h-0 w-full flex-1 space-y-8 overflow-y-auto md:pl-5 md:pr-1">
<router-view />
</section>
</main>
</div>
</template>