student-management.blade.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <x-filament-panels::page>
  2. <div class="space-y-6">
  3. <!-- 快速操作按钮 -->
  4. <div class="flex justify-end gap-2">
  5. <a href="{{ route('filament.admin.resources.students.create') }}"
  6. class="btn btn-primary">
  7. <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  8. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path>
  9. </svg>
  10. 添加新学生
  11. </a>
  12. <a href="{{ route('filament.admin.resources.teachers.create') }}"
  13. class="btn btn-success">
  14. <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  15. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path>
  16. </svg>
  17. 添加新老师
  18. </a>
  19. <a href="{{ route('filament.admin.pages.student-dashboard') }}"
  20. class="btn btn-ghost">
  21. <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  22. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"></path>
  23. </svg>
  24. 学生仪表板
  25. </a>
  26. </div>
  27. <!-- 老师概览 -->
  28. <div class="space-y-4">
  29. <div class="flex flex-wrap items-center justify-between gap-3">
  30. <div>
  31. <h3 class="text-lg font-semibold text-gray-900 dark:text-white">老师概览</h3>
  32. <p class="text-sm text-gray-500 dark:text-gray-400">以老师为核心查看所带学生与近期动态</p>
  33. </div>
  34. <div class="flex gap-2">
  35. <a href="{{ route('filament.admin.resources.teachers.index') }}"
  36. class="inline-flex items-center gap-2 rounded-lg border border-gray-200 px-3 py-1.5 text-xs font-medium text-gray-600 hover:bg-gray-50 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-gray-800"
  37. >
  38. 查看全部老师
  39. </a>
  40. </div>
  41. </div>
  42. <div class="grid gap-4 md:grid-cols-2 xl:grid-cols-3">
  43. @forelse($this->teacherOverview as $teacher)
  44. <div class="rounded-2xl border border-gray-200 bg-white p-5 shadow-sm dark:border-gray-700 dark:bg-gray-900/70">
  45. <div class="flex items-start justify-between gap-3">
  46. <div>
  47. <p class="text-lg font-semibold text-gray-900 dark:text-gray-100">
  48. {{ $teacher['teacher_name'] ?? '未命名老师' }}
  49. </p>
  50. <p class="text-xs text-gray-500 dark:text-gray-400">
  51. {{ $teacher['teacher_email'] ?? '未配置邮箱' }}
  52. </p>
  53. <p class="mt-2 text-sm text-gray-600 dark:text-gray-300">
  54. 负责学生:
  55. <span class="font-semibold text-gray-900 dark:text-white">
  56. {{ $teacher['students_count'] ?? 0 }}
  57. </span>
  58. </p>
  59. <p class="text-xs text-gray-400 dark:text-gray-500">
  60. 最近动态:
  61. {{ $teacher['latest_student_activity']
  62. ? \Illuminate\Support\Carbon::parse($teacher['latest_student_activity'])->diffForHumans()
  63. : '暂无' }}
  64. </p>
  65. </div>
  66. <button
  67. wire:click="filterByTeacher('{{ $teacher['teacher_id'] }}')"
  68. class="inline-flex items-center gap-1 rounded-lg border border-primary-200 bg-primary-50 px-3 py-1 text-xs font-semibold text-primary-700 transition hover:bg-primary-100 dark:border-primary-500/40 dark:bg-primary-500/10 dark:text-primary-300"
  69. >
  70. 查看学生
  71. <svg class="h-3.5 w-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  72. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
  73. </svg>
  74. </button>
  75. </div>
  76. <div class="mt-4">
  77. <p class="text-xs font-semibold uppercase tracking-wider text-gray-400 dark:text-gray-500">所带学生</p>
  78. <div class="mt-2 space-y-2">
  79. @forelse($teacher['students'] as $student)
  80. <div class="flex items-center justify-between rounded-lg border border-gray-100 px-3 py-2 text-sm dark:border-gray-700">
  81. <div>
  82. <p class="font-medium text-gray-900 dark:text-gray-100">{{ $student['name'] ?? '未命名学生' }}</p>
  83. <p class="text-xs text-gray-500 dark:text-gray-400">
  84. {{ $student['grade'] ?? '未知年级' }} · {{ $student['class_name'] ?? '未知班级' }}
  85. </p>
  86. </div>
  87. <a
  88. href="{{ route('filament.admin.resources.students.view', $student['student_id']) }}"
  89. target="_blank"
  90. class="text-xs font-semibold text-primary-600 hover:text-primary-700 dark:text-primary-400"
  91. >
  92. 详情
  93. </a>
  94. </div>
  95. @empty
  96. <p class="text-xs text-gray-500 dark:text-gray-400">尚无学生</p>
  97. @endforelse
  98. </div>
  99. </div>
  100. </div>
  101. @empty
  102. <div class="rounded-xl border border-dashed border-gray-300 px-4 py-6 text-center text-sm text-gray-500 dark:border-gray-700 dark:text-gray-400">
  103. 暂无老师数据
  104. </div>
  105. @endforelse
  106. </div>
  107. </div>
  108. <!-- 数据表格 -->
  109. <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700">
  110. {{ $this->table }}
  111. </div>
  112. <!-- 页面说明 -->
  113. <div class="bg-blue-50 dark:bg-blue-900/20 rounded-lg border border-blue-200 dark:border-blue-800 p-4">
  114. <div class="flex items-start gap-3">
  115. <svg class="h-5 w-5 text-blue-600 dark:text-blue-400 mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  116. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path>
  117. </svg>
  118. <div class="text-sm text-blue-800 dark:text-blue-200">
  119. <p class="font-medium mb-1">使用说明</p>
  120. <ul class="list-disc list-inside space-y-1 text-blue-700 dark:text-blue-300">
  121. <li>可以点击按钮添加新学生或新老师</li>
  122. <li>查看老师概览了解各老师所带学生情况</li>
  123. <li>支持按年级、班级、指导老师筛选学生数据</li>
  124. <li>表格会自动刷新显示最新数据</li>
  125. </ul>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. </x-filament-panels::page>