2025-12-18 13:50:39 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="min-h-screen bg-gray-50 dark:bg-dark-950">
|
|
|
|
|
<!-- Background Decoration -->
|
2025-12-25 08:40:12 -08:00
|
|
|
<div class="pointer-events-none fixed inset-0 bg-mesh-gradient"></div>
|
2025-12-18 13:50:39 +08:00
|
|
|
|
|
|
|
|
<!-- Sidebar -->
|
|
|
|
|
<AppSidebar />
|
|
|
|
|
|
|
|
|
|
<!-- Main Content Area -->
|
|
|
|
|
<div
|
|
|
|
|
class="relative min-h-screen transition-all duration-300"
|
2025-12-25 08:40:12 -08:00
|
|
|
:class="[sidebarCollapsed ? 'lg:ml-[72px]' : 'lg:ml-64']"
|
2025-12-18 13:50:39 +08:00
|
|
|
>
|
|
|
|
|
<!-- Header -->
|
|
|
|
|
<AppHeader />
|
|
|
|
|
|
|
|
|
|
<!-- Main Content -->
|
|
|
|
|
<main class="p-4 md:p-6 lg:p-8">
|
|
|
|
|
<slot />
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2025-12-29 15:21:05 +08:00
|
|
|
import '@/styles/onboarding.css'
|
|
|
|
|
import { computed, onMounted } from 'vue'
|
2025-12-25 08:40:12 -08:00
|
|
|
import { useAppStore } from '@/stores'
|
2025-12-29 15:21:05 +08:00
|
|
|
import { useAuthStore } from '@/stores/auth'
|
|
|
|
|
import { useOnboardingTour } from '@/composables/useOnboardingTour'
|
|
|
|
|
import { useOnboardingStore } from '@/stores/onboarding'
|
2025-12-25 08:40:12 -08:00
|
|
|
import AppSidebar from './AppSidebar.vue'
|
|
|
|
|
import AppHeader from './AppHeader.vue'
|
2025-12-18 13:50:39 +08:00
|
|
|
|
2025-12-25 08:40:12 -08:00
|
|
|
const appStore = useAppStore()
|
2025-12-29 15:21:05 +08:00
|
|
|
const authStore = useAuthStore()
|
2025-12-25 08:40:12 -08:00
|
|
|
const sidebarCollapsed = computed(() => appStore.sidebarCollapsed)
|
2025-12-29 15:21:05 +08:00
|
|
|
const isAdmin = computed(() => authStore.user?.role === 'admin')
|
|
|
|
|
|
|
|
|
|
const { replayTour } = useOnboardingTour({
|
|
|
|
|
storageKey: isAdmin.value ? 'admin_guide' : 'user_guide',
|
|
|
|
|
autoStart: true
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const onboardingStore = useOnboardingStore()
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
onboardingStore.setReplayCallback(replayTour)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
defineExpose({ replayTour })
|
2025-12-18 13:50:39 +08:00
|
|
|
</script>
|