index.pug 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // app/pages/Admin/Clients/index.pug
  2. div
  3. .flex.justify-between.items-center.mb-6
  4. h1(class="text-2xl font-bold text-gray-900 dark:text-white") Управление клиентами
  5. .flex.space-x-4
  6. input(
  7. v-model="clientSearch"
  8. type="text"
  9. placeholder="Поиск клиентов..."
  10. class="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary-500 dark:bg-gray-700 dark:border-gray-600"
  11. )
  12. .overflow-x-auto
  13. table(class="min-w-full divide-y divide-gray-200 dark:divide-gray-700")
  14. thead(class="bg-gray-50 dark:bg-gray-700")
  15. tr
  16. th(class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider") Имя
  17. th(class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider") Email
  18. th(class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider") Телефон
  19. th(class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider") Заказов
  20. th(class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider") Дата регистрации
  21. th(class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider") Действия
  22. tbody(class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700")
  23. tr(v-for="user in filteredUsers" :key="user._id")
  24. td(class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-white")
  25. | {{ user.profile?.firstName }} {{ user.profile?.lastName }}
  26. td(class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300") {{ user.email }}
  27. td(class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300") {{ user.profile?.phone || '-' }}
  28. td(class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300") {{ user.orders?.length || 0 }}
  29. td(class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300") {{ formatDate(user.createdAt) }}
  30. td(class="px-6 py-4 whitespace-nowrap text-sm font-medium")
  31. button(
  32. @click="viewUser(user)"
  33. class="text-blue-600 hover:text-blue-900 mr-3"
  34. ) Просмотр
  35. button(
  36. @click="editUser(user)"
  37. class="text-green-600 hover:text-green-900"
  38. ) Редактировать