student-management.blade.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <x-filament-panels::page>
  2. <div class="space-y-6">
  3. <!-- 页面头部 -->
  4. <div class="flex items-center justify-between">
  5. <div>
  6. <h2 class="text-2xl font-bold text-gray-900 dark:text-white">
  7. 学生管理
  8. </h2>
  9. <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
  10. 管理所有学生信息、查看学习进度和登录状态
  11. </p>
  12. </div>
  13. <div class="flex gap-2">
  14. <a href="{{ route('filament.admin.resources.students.create') }}"
  15. class="filament-button inline-flex items-center justify-center gap-2 rounded-md border border-transparent bg-primary-600 px-4 py-2 text-sm font-medium text-white shadow-sm transition-colors hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2">
  16. <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  17. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path>
  18. </svg>
  19. 添加新学生
  20. </a>
  21. <a href="{{ route('filament.admin.pages.student-dashboard') }}"
  22. class="filament-button inline-flex items-center justify-center gap-2 rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm transition-colors hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700">
  23. <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  24. <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>
  25. </svg>
  26. 学生仪表板
  27. </a>
  28. </div>
  29. </div>
  30. <!-- 当前筛选提示 -->
  31. @if($selectedTeacherName)
  32. <div class="rounded-lg border border-primary-100 bg-primary-50 px-4 py-3 flex items-center justify-between text-sm text-primary-800 dark:border-primary-500/40 dark:bg-primary-500/10 dark:text-primary-100">
  33. <div>
  34. 当前正在查看 <span class="font-semibold">{{ $selectedTeacherName }}</span> 的学生列表
  35. </div>
  36. <button
  37. wire:click="resetTeacherFilter"
  38. class="inline-flex items-center gap-1 text-xs font-semibold uppercase tracking-wider"
  39. >
  40. 清除筛选
  41. </button>
  42. </div>
  43. @endif
  44. <!-- 统计概览 -->
  45. <x-filament-widgets::widgets
  46. :widgets="$this->getHeaderWidgets()"
  47. :columns="[
  48. 'md' => 2,
  49. 'xl' => 3,
  50. ]"
  51. />
  52. <!-- 老师概览 -->
  53. <div class="space-y-4">
  54. <div class="flex flex-wrap items-center justify-between gap-3">
  55. <div>
  56. <h3 class="text-lg font-semibold text-gray-900 dark:text-white">老师概览</h3>
  57. <p class="text-sm text-gray-500 dark:text-gray-400">以老师为核心查看所带学生与近期动态</p>
  58. </div>
  59. <div class="flex gap-2">
  60. <button
  61. wire:click="resetTeacherFilter"
  62. 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"
  63. >
  64. 查看全部老师
  65. </button>
  66. </div>
  67. </div>
  68. <div class="grid gap-4 md:grid-cols-2 xl:grid-cols-3">
  69. @forelse($this->teacherOverview as $teacher)
  70. <div class="rounded-2xl border border-gray-200 bg-white p-5 shadow-sm dark:border-gray-700 dark:bg-gray-900/70">
  71. <div class="flex items-start justify-between gap-3">
  72. <div>
  73. <p class="text-lg font-semibold text-gray-900 dark:text-gray-100">
  74. {{ $teacher['teacher_name'] ?? '未命名老师' }}
  75. </p>
  76. <p class="text-xs text-gray-500 dark:text-gray-400">
  77. {{ $teacher['teacher_email'] ?? '未配置邮箱' }}
  78. </p>
  79. <p class="mt-2 text-sm text-gray-600 dark:text-gray-300">
  80. 负责学生:
  81. <span class="font-semibold text-gray-900 dark:text-white">
  82. {{ $teacher['students_count'] ?? 0 }}
  83. </span>
  84. </p>
  85. <p class="text-xs text-gray-400 dark:text-gray-500">
  86. 最近动态:
  87. {{ $teacher['latest_student_activity']
  88. ? \Illuminate\Support\Carbon::parse($teacher['latest_student_activity'])->diffForHumans()
  89. : '暂无' }}
  90. </p>
  91. </div>
  92. <button
  93. wire:click="filterByTeacher('{{ $teacher['teacher_id'] }}')"
  94. 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"
  95. >
  96. 查看学生
  97. <svg class="h-3.5 w-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  98. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
  99. </svg>
  100. </button>
  101. </div>
  102. <div class="mt-4">
  103. <p class="text-xs font-semibold uppercase tracking-wider text-gray-400 dark:text-gray-500">所带学生</p>
  104. <div class="mt-2 space-y-2">
  105. @forelse($teacher['students'] as $student)
  106. <div class="flex items-center justify-between rounded-lg border border-gray-100 px-3 py-2 text-sm dark:border-gray-700">
  107. <div>
  108. <p class="font-medium text-gray-900 dark:text-gray-100">{{ $student['name'] ?? '未命名学生' }}</p>
  109. <p class="text-xs text-gray-500 dark:text-gray-400">
  110. {{ $student['grade'] ?? '未知年级' }} · {{ $student['class_name'] ?? '未知班级' }}
  111. </p>
  112. </div>
  113. <a
  114. href="{{ route('filament.admin.resources.students.view', $student['student_id']) }}"
  115. target="_blank"
  116. class="text-xs font-semibold text-primary-600 hover:text-primary-700 dark:text-primary-400"
  117. >
  118. 详情
  119. </a>
  120. </div>
  121. @empty
  122. <p class="text-xs text-gray-500 dark:text-gray-400">尚无学生</p>
  123. @endforelse
  124. </div>
  125. </div>
  126. </div>
  127. @empty
  128. <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">
  129. 暂无老师数据
  130. </div>
  131. @endforelse
  132. </div>
  133. </div>
  134. <!-- 快速操作 -->
  135. <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
  136. <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4">
  137. <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">
  138. 快速导入
  139. </h3>
  140. <p class="text-sm text-gray-600 dark:text-gray-400 mb-4">
  141. 通过Excel文件批量导入学生信息
  142. </p>
  143. <button class="inline-flex items-center gap-2 text-sm text-primary-600 hover:text-primary-700">
  144. <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  145. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"></path>
  146. </svg>
  147. 批量导入
  148. </button>
  149. </div>
  150. <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4">
  151. <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">
  152. 学习报告
  153. </h3>
  154. <p class="text-sm text-gray-600 dark:text-gray-400 mb-4">
  155. 查看学生的学习进度和成绩分析
  156. </p>
  157. <button class="inline-flex items-center gap-2 text-sm text-primary-600 hover:text-primary-700">
  158. <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  159. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 17v1a3 3 0 003 3h0a3 3 0 003-3v-1m3-10V4a3 3 0 00-3-3H9a3 3 0 00-3 3v6h12z"></path>
  160. </svg>
  161. 生成报告
  162. </button>
  163. </div>
  164. <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4">
  165. <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">
  166. 批量通知
  167. </h3>
  168. <p class="text-sm text-gray-600 dark:text-gray-400 mb-4">
  169. 向所有学生发送重要通知或作业
  170. </p>
  171. <button class="inline-flex items-center gap-2 text-sm text-primary-600 hover:text-primary-700">
  172. <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  173. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path>
  174. </svg>
  175. 发送通知
  176. </button>
  177. </div>
  178. </div>
  179. <!-- 数据表格 -->
  180. <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700">
  181. {{ $this->table }}
  182. </div>
  183. <!-- 页面说明 -->
  184. <div class="bg-blue-50 dark:bg-blue-900/20 rounded-lg border border-blue-200 dark:border-blue-800 p-4">
  185. <div class="flex items-start gap-3">
  186. <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">
  187. <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>
  188. </svg>
  189. <div class="text-sm text-blue-800 dark:text-blue-200">
  190. <p class="font-medium mb-1">使用说明</p>
  191. <ul class="list-disc list-inside space-y-1 text-blue-700 dark:text-blue-300">
  192. <li>点击学生姓名可以查看详细信息</li>
  193. <li>可以按年级、班级、指导老师进行筛选</li>
  194. <li>支持批量重置学生密码(默认密码:student123)</li>
  195. <li>表格会自动刷新显示最新数据</li>
  196. </ul>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. </x-filament-panels::page>