1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

Починка админки полностью1д

This commit is contained in:
MoonTestUse1
2025-01-01 22:53:45 +06:00
parent 57cefa8d6c
commit 00a035653f
4 changed files with 220 additions and 37 deletions

View File

@@ -0,0 +1,62 @@
<template>
<div class="min-h-screen bg-gray-100">
<!-- Sidebar -->
<aside class="fixed inset-y-0 left-0 w-64 bg-slate-800 text-white">
<div class="p-4">
<h1 class="text-xl font-bold">Админ-панель</h1>
</div>
<nav class="mt-4">
<router-link
v-for="item in menuItems"
:key="item.path"
:to="item.path"
class="flex items-center px-4 py-2 text-gray-300 hover:bg-slate-700 hover:text-white"
:class="{ 'bg-slate-700 text-white': isCurrentRoute(item.path) }"
>
<component :is="item.icon" class="w-5 h-5 mr-2" />
{{ item.name }}
</router-link>
</nav>
</aside>
<!-- Main content -->
<main class="pl-64">
<div class="p-8">
<router-view></router-view>
</div>
</main>
</div>
</template>
<script setup lang="ts">
import { useRoute } from 'vue-router';
import {
LayoutDashboard,
ClipboardList,
Users
} from 'lucide-vue-next';
const route = useRoute();
const menuItems = [
{
name: 'Дашборд',
path: '/admin/dashboard',
icon: LayoutDashboard
},
{
name: 'Заявки',
path: '/admin/requests',
icon: ClipboardList
},
{
name: 'Сотрудники',
path: '/admin/employees',
icon: Users
}
];
const isCurrentRoute = (path: string) => {
return route.path.startsWith(path);
};
</script>