ایجاد سامانه جدید حضور غیاب

This commit is contained in:
2026-11-04 18:07:34 +03:30
parent 0b4ee6436c
commit a9b551c0a4
11 changed files with 2459 additions and 25 deletions
+47
View File
@@ -0,0 +1,47 @@
<template>
<div class="inline-flex items-center gap-2 bg-white dark:bg-stone-900 border border-stone-200 dark:border-stone-800 rounded-2xl p-1.5 shadow-sm">
<div class="flex items-center gap-2 px-2.5 py-1 text-xs text-stone-500 dark:text-stone-400 font-medium">
<UIcon name="i-lucide-user-check" class="w-4 h-4 text-primary-500" />
<span class="hidden sm:inline">نقش نمایشی:</span>
</div>
<div class="flex items-center gap-1">
<button
v-for="role in roles"
:key="role.key"
type="button"
class="px-3 py-1.5 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5"
:class="currentRole === role.key
? 'bg-primary-500 text-white shadow-md shadow-primary-500/20'
: 'text-stone-600 dark:text-stone-400 hover:bg-stone-100 dark:hover:bg-stone-800'"
@click="setRole(role.key)"
>
<UIcon :name="role.icon" class="w-3.5 h-3.5" />
<span>{{ role.label }}</span>
</button>
</div>
<!-- User Profile Badge -->
<div class="hidden md:flex items-center gap-2 border-r border-stone-200 dark:border-stone-800 pr-3 mr-1 text-xs">
<div class="w-7 h-7 rounded-full bg-primary-100 dark:bg-primary-950 text-primary-600 dark:text-primary-400 flex items-center justify-center font-bold text-xs">
{{ currentUser.name.charAt(0) }}
</div>
<div class="text-start leading-tight">
<div class="font-bold text-stone-900 dark:text-white">{{ currentUser.name }}</div>
<div class="text-[10px] text-stone-400">{{ currentUser.title }}</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { useAuth, type UserRole } from '~/composables/useAuth'
const { currentRole, setRole, currentUser } = useAuth()
const roles: { key: UserRole; label: string; icon: string }[] = [
{ key: 'student', label: 'طلبه', icon: 'i-lucide-graduation-cap' },
{ key: 'teacher', label: 'استاد', icon: 'i-lucide-book-open' },
{ key: 'admin', label: 'آموزش', icon: 'i-lucide-shield-check' }
]
</script>