| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- <x-filament-panels::page>
- <div class="space-y-6">
- <!-- 页面头部 -->
- <div class="flex items-center justify-between">
- <div>
- <h2 class="text-2xl font-bold text-gray-900 dark:text-white">
- 学生管理
- </h2>
- <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
- 管理所有学生信息、查看学习进度和登录状态
- </p>
- </div>
- <div class="flex gap-2">
- <a href="{{ route('filament.admin.resources.students.create') }}"
- 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">
- <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path>
- </svg>
- 添加新学生
- </a>
- <a href="{{ route('filament.admin.pages.student-dashboard') }}"
- 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">
- <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 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>
- </svg>
- 学生仪表板
- </a>
- </div>
- </div>
- <!-- 当前筛选提示 -->
- @if($selectedTeacherName)
- <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">
- <div>
- 当前正在查看 <span class="font-semibold">{{ $selectedTeacherName }}</span> 的学生列表
- </div>
- <button
- wire:click="resetTeacherFilter"
- class="inline-flex items-center gap-1 text-xs font-semibold uppercase tracking-wider"
- >
- 清除筛选
- </button>
- </div>
- @endif
- <!-- 统计概览 -->
- <x-filament-widgets::widgets
- :widgets="$this->getHeaderWidgets()"
- :columns="[
- 'md' => 2,
- 'xl' => 3,
- ]"
- />
- <!-- 老师概览 -->
- <div class="space-y-4">
- <div class="flex flex-wrap items-center justify-between gap-3">
- <div>
- <h3 class="text-lg font-semibold text-gray-900 dark:text-white">老师概览</h3>
- <p class="text-sm text-gray-500 dark:text-gray-400">以老师为核心查看所带学生与近期动态</p>
- </div>
- <div class="flex gap-2">
- <button
- wire:click="resetTeacherFilter"
- 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"
- >
- 查看全部老师
- </button>
- </div>
- </div>
- <div class="grid gap-4 md:grid-cols-2 xl:grid-cols-3">
- @forelse($this->teacherOverview as $teacher)
- <div class="rounded-2xl border border-gray-200 bg-white p-5 shadow-sm dark:border-gray-700 dark:bg-gray-900/70">
- <div class="flex items-start justify-between gap-3">
- <div>
- <p class="text-lg font-semibold text-gray-900 dark:text-gray-100">
- {{ $teacher['teacher_name'] ?? '未命名老师' }}
- </p>
- <p class="text-xs text-gray-500 dark:text-gray-400">
- {{ $teacher['teacher_email'] ?? '未配置邮箱' }}
- </p>
- <p class="mt-2 text-sm text-gray-600 dark:text-gray-300">
- 负责学生:
- <span class="font-semibold text-gray-900 dark:text-white">
- {{ $teacher['students_count'] ?? 0 }}
- </span>
- </p>
- <p class="text-xs text-gray-400 dark:text-gray-500">
- 最近动态:
- {{ $teacher['latest_student_activity']
- ? \Illuminate\Support\Carbon::parse($teacher['latest_student_activity'])->diffForHumans()
- : '暂无' }}
- </p>
- </div>
- <button
- wire:click="filterByTeacher('{{ $teacher['teacher_id'] }}')"
- 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"
- >
- 查看学生
- <svg class="h-3.5 w-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
- </svg>
- </button>
- </div>
- <div class="mt-4">
- <p class="text-xs font-semibold uppercase tracking-wider text-gray-400 dark:text-gray-500">所带学生</p>
- <div class="mt-2 space-y-2">
- @forelse($teacher['students'] as $student)
- <div class="flex items-center justify-between rounded-lg border border-gray-100 px-3 py-2 text-sm dark:border-gray-700">
- <div>
- <p class="font-medium text-gray-900 dark:text-gray-100">{{ $student['name'] ?? '未命名学生' }}</p>
- <p class="text-xs text-gray-500 dark:text-gray-400">
- {{ $student['grade'] ?? '未知年级' }} · {{ $student['class_name'] ?? '未知班级' }}
- </p>
- </div>
- <a
- href="{{ route('filament.admin.resources.students.view', $student['student_id']) }}"
- target="_blank"
- class="text-xs font-semibold text-primary-600 hover:text-primary-700 dark:text-primary-400"
- >
- 详情
- </a>
- </div>
- @empty
- <p class="text-xs text-gray-500 dark:text-gray-400">尚无学生</p>
- @endforelse
- </div>
- </div>
- </div>
- @empty
- <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">
- 暂无老师数据
- </div>
- @endforelse
- </div>
- </div>
- <!-- 快速操作 -->
- <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
- <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4">
- <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">
- 快速导入
- </h3>
- <p class="text-sm text-gray-600 dark:text-gray-400 mb-4">
- 通过Excel文件批量导入学生信息
- </p>
- <button class="inline-flex items-center gap-2 text-sm text-primary-600 hover:text-primary-700">
- <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <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>
- </svg>
- 批量导入
- </button>
- </div>
- <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4">
- <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">
- 学习报告
- </h3>
- <p class="text-sm text-gray-600 dark:text-gray-400 mb-4">
- 查看学生的学习进度和成绩分析
- </p>
- <button class="inline-flex items-center gap-2 text-sm text-primary-600 hover:text-primary-700">
- <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <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>
- </svg>
- 生成报告
- </button>
- </div>
- <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4">
- <h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-2">
- 批量通知
- </h3>
- <p class="text-sm text-gray-600 dark:text-gray-400 mb-4">
- 向所有学生发送重要通知或作业
- </p>
- <button class="inline-flex items-center gap-2 text-sm text-primary-600 hover:text-primary-700">
- <svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <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>
- </svg>
- 发送通知
- </button>
- </div>
- </div>
- <!-- 数据表格 -->
- <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700">
- {{ $this->table }}
- </div>
- <!-- 页面说明 -->
- <div class="bg-blue-50 dark:bg-blue-900/20 rounded-lg border border-blue-200 dark:border-blue-800 p-4">
- <div class="flex items-start gap-3">
- <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">
- <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>
- </svg>
- <div class="text-sm text-blue-800 dark:text-blue-200">
- <p class="font-medium mb-1">使用说明</p>
- <ul class="list-disc list-inside space-y-1 text-blue-700 dark:text-blue-300">
- <li>点击学生姓名可以查看详细信息</li>
- <li>可以按年级、班级、指导老师进行筛选</li>
- <li>支持批量重置学生密码(默认密码:student123)</li>
- <li>表格会自动刷新显示最新数据</li>
- </ul>
- </div>
- </div>
- </div>
- </div>
- </x-filament-panels::page>
|