student-dashboard.blade.php 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  1. <div class="min-h-screen bg-gray-50 p-8">
  2. {{-- 页面标题区域 --}}
  3. <div class="mb-8">
  4. <div class="bg-white rounded-xl shadow-sm p-6 border border-gray-200">
  5. <div class="flex items-center justify-between mb-6">
  6. <div>
  7. <h1 class="text-3xl font-bold text-gray-900 flex items-center">
  8. <svg class="w-8 h-8 mr-3 text-indigo-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  9. <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>
  10. </svg>
  11. 学生仪表板
  12. </h1>
  13. <p class="mt-2 text-sm text-gray-600 ml-11">
  14. 全面展示学生的学习分析数据,包括掌握度、技能熟练度、提分预测和学习路径
  15. </p>
  16. </div>
  17. </div>
  18. {{-- 选择器区域 --}}
  19. <div class="bg-gray-50 rounded-lg p-4 border border-gray-200">
  20. <div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
  21. <div>
  22. <label for="teacher" class="block text-sm font-medium text-gray-700 mb-2">选择老师</label>
  23. <div class="dropdown w-full">
  24. <label tabindex="0" class="btn btn-bordered w-full justify-between">
  25. @if(!empty($teacherId))
  26. @php
  27. $selectedTeacher = collect($this->teachers)->firstWhere('teacher_id', $teacherId);
  28. @endphp
  29. {{ $selectedTeacher ? trim($selectedTeacher->name ?? $selectedTeacher->teacher_id) . ($selectedTeacher->subject ? " ({$selectedTeacher->subject})" : '') : '请选择老师...' }}
  30. @else
  31. 请选择老师...
  32. @endif
  33. <svg class="w-4 h-4 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  34. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
  35. </svg>
  36. </label>
  37. <ul tabindex="0" class="dropdown-content menu p-2 shadow bg-base-100 rounded-box w-full max-h-64 overflow-y-auto">
  38. <li>
  39. <a wire:click="$set('teacherId', '')" class="{{ empty($teacherId) ? 'active' : '' }}">
  40. 请选择老师...
  41. </a>
  42. </li>
  43. @foreach($this->teachers as $teacher)
  44. <li>
  45. <a wire:click="$set('teacherId', '{{ $teacher->teacher_id }}')" class="{{ $teacherId === $teacher->teacher_id ? 'active' : '' }}">
  46. {{ trim($teacher->name ?? $teacher->teacher_id) . ($teacher->subject ? " ({$teacher->subject})" : '') }}
  47. </a>
  48. </li>
  49. @endforeach
  50. </ul>
  51. </div>
  52. <p class="mt-1 text-xs text-gray-500">选择要查看的老师</p>
  53. </div>
  54. <div>
  55. <label for="student" class="block text-sm font-medium text-gray-700 mb-2">选择学生</label>
  56. <div class="dropdown w-full">
  57. <label tabindex="0" class="btn btn-bordered w-full justify-between {{ empty($teacherId) ? 'btn-disabled' : '' }}">
  58. @if(empty($teacherId))
  59. 请先选择老师
  60. @elseif(!empty($studentId))
  61. @php
  62. $selectedStudent = collect($this->students)->firstWhere('student_id', $studentId);
  63. @endphp
  64. {{ $selectedStudent ? trim($selectedStudent->name ?? $selectedStudent->student_id) . " ({$selectedStudent->grade} - {$selectedStudent->class_name})" : '请选择学生...' }}
  65. @else
  66. 请选择学生...
  67. @endif
  68. <svg class="w-4 h-4 ml-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  69. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
  70. </svg>
  71. </label>
  72. @if(!empty($teacherId))
  73. <ul tabindex="0" class="dropdown-content menu p-2 shadow bg-base-100 rounded-box w-full max-h-64 overflow-y-auto">
  74. <li>
  75. <a wire:click="$set('studentId', '')" class="{{ empty($studentId) ? 'active' : '' }}">
  76. 请选择学生...
  77. </a>
  78. </li>
  79. @foreach($this->students as $student)
  80. <li>
  81. <a wire:click="$set('studentId', '{{ $student->student_id }}')" class="{{ $studentId === $student->student_id ? 'active' : '' }}">
  82. {{ trim($student->name ?? $student->student_id) . " ({$student->grade} - {$student->class_name})" }}
  83. </a>
  84. </li>
  85. @endforeach
  86. </ul>
  87. @endif
  88. </div>
  89. <p class="mt-1 text-xs text-gray-500">选择要查看的学生</p>
  90. </div>
  91. </div>
  92. <div class="mt-4 pb-0.5 flex space-x-2">
  93. <button
  94. wire:click="loadDashboardData"
  95. wire:loading.attr="disabled"
  96. class="inline-flex items-center px-6 py-2.5 border border-transparent text-sm font-medium rounded-lg shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors duration-200"
  97. >
  98. <svg wire:loading class="animate-spin -ml-1 mr-2 h-4 w-4 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
  99. <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
  100. <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
  101. </svg>
  102. 刷新数据
  103. </button>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. {{-- 错误提示 --}}
  109. @if ($errorMessage)
  110. <div class="mb-8">
  111. <div class="bg-red-50 border border-red-200 rounded-xl p-4">
  112. <div class="flex items-start">
  113. <div class="flex-shrink-0">
  114. <svg class="h-5 w-5 text-red-400" viewBox="0 0 20 20" fill="currentColor">
  115. <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" />
  116. </svg>
  117. </div>
  118. <div class="ml-3">
  119. <h3 class="text-sm font-medium text-red-800">加载错误</h3>
  120. <div class="mt-2 text-sm text-red-700">
  121. <p>{{ $errorMessage }}</p>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. @endif
  128. {{-- 加载状态 --}}
  129. @if ($isLoading)
  130. <div class="mb-8">
  131. <div class="bg-white rounded-xl shadow-sm p-12 border border-gray-200">
  132. <div class="flex flex-col items-center justify-center">
  133. <svg class="animate-spin h-12 w-12 text-indigo-600" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
  134. <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
  135. <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
  136. </svg>
  137. <p class="mt-4 text-sm text-gray-600">正在加载数据,请稍候...</p>
  138. </div>
  139. </div>
  140. </div>
  141. @else
  142. {{-- 加载完成后显示内容 --}}
  143. {{-- 快速概览卡片 --}}
  144. {{-- 快速概览卡片 --}}
  145. <div class="mb-8">
  146. <div class="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-4">
  147. {{-- 掌握度概览 --}}
  148. @if (isset($dashboardData['mastery']['overview']))
  149. <div class="bg-white overflow-hidden shadow-sm rounded-xl border border-gray-200 hover:shadow-md transition-shadow duration-200">
  150. <div class="p-6">
  151. <div class="flex items-center justify-between">
  152. <div class="flex items-center">
  153. <div class="flex-shrink-0">
  154. <div class="w-12 h-12 bg-gradient-to-br from-indigo-500 to-indigo-600 rounded-xl flex items-center justify-center shadow-lg">
  155. <svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  156. <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>
  157. </svg>
  158. </div>
  159. </div>
  160. <div class="ml-4">
  161. <p class="text-sm font-medium text-gray-600">平均掌握度</p>
  162. <p class="text-2xl font-bold text-gray-900 mt-1">
  163. {{ number_format($dashboardData['mastery']['overview']['average_mastery_level'] * 100, 1) }}%
  164. </p>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. <div class="bg-gray-50 px-6 py-4 border-t border-gray-100">
  170. <div class="flex justify-between text-xs">
  171. <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
  172. 已掌握: {{ $dashboardData['mastery']['overview']['mastered_knowledge_points'] }}
  173. </span>
  174. <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800">
  175. 薄弱: {{ $dashboardData['mastery']['overview']['weak_knowledge_points'] }}
  176. </span>
  177. </div>
  178. </div>
  179. </div>
  180. @endif
  181. {{-- 技能熟练度概览 --}}
  182. @if (isset($dashboardData['skill']['summary']))
  183. <div class="bg-white overflow-hidden shadow-sm rounded-xl border border-gray-200 hover:shadow-md transition-shadow duration-200">
  184. <div class="p-6">
  185. <div class="flex items-center justify-between">
  186. <div class="flex items-center">
  187. <div class="flex-shrink-0">
  188. <div class="w-12 h-12 bg-gradient-to-br from-green-500 to-green-600 rounded-xl flex items-center justify-center shadow-lg">
  189. <svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  190. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
  191. </svg>
  192. </div>
  193. </div>
  194. <div class="ml-4">
  195. <p class="text-sm font-medium text-gray-600">技能熟练度</p>
  196. <p class="text-2xl font-bold text-gray-900 mt-1">
  197. {{ number_format($dashboardData['skill']['summary']['average_proficiency_level'] * 100, 1) }}%
  198. </p>
  199. </div>
  200. </div>
  201. </div>
  202. </div>
  203. <div class="bg-gray-50 px-6 py-4 border-t border-gray-100">
  204. <div class="flex justify-between text-xs">
  205. <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
  206. 技能: {{ $dashboardData['skill']['summary']['total_skills'] }}
  207. </span>
  208. <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-purple-100 text-purple-800">
  209. 练习: {{ $dashboardData['skill']['summary']['total_questions_attempted'] }}
  210. </span>
  211. </div>
  212. </div>
  213. </div>
  214. @endif
  215. {{-- 提分潜力 --}}
  216. @if (isset($dashboardData['prediction']['quick']))
  217. <div class="bg-white overflow-hidden shadow-sm rounded-xl border border-gray-200 hover:shadow-md transition-shadow duration-200">
  218. <div class="p-6">
  219. <div class="flex items-center justify-between">
  220. <div class="flex items-center">
  221. <div class="flex-shrink-0">
  222. <div class="w-12 h-12 bg-gradient-to-br from-yellow-500 to-orange-500 rounded-xl flex items-center justify-center shadow-lg">
  223. <svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  224. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"></path>
  225. </svg>
  226. </div>
  227. </div>
  228. <div class="ml-4">
  229. <p class="text-sm font-medium text-gray-600">预期提分</p>
  230. <p class="text-2xl font-bold text-gray-900 mt-1">
  231. +{{ $dashboardData['prediction']['quick']['quick_prediction']['improvement_potential'] ?? 0 }}
  232. <span class="text-lg text-gray-500">分</span>
  233. </p>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. <div class="bg-gray-50 px-6 py-4 border-t border-gray-100">
  239. <div class="flex justify-between text-xs">
  240. <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-orange-100 text-orange-800">
  241. 学习: {{ $dashboardData['prediction']['quick']['quick_prediction']['estimated_study_hours'] ?? 0 }}小时
  242. </span>
  243. <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800">
  244. 置信度: {{ number_format(($dashboardData['prediction']['quick']['quick_prediction']['confidence_level'] ?? 0) * 100, 0) }}%
  245. </span>
  246. </div>
  247. </div>
  248. </div>
  249. @endif
  250. {{-- 学习路径 --}}
  251. @if (isset($dashboardData['learning_path']['analytics']))
  252. <div class="bg-white overflow-hidden shadow-sm rounded-xl border border-gray-200 hover:shadow-md transition-shadow duration-200">
  253. <div class="p-6">
  254. <div class="flex items-center justify-between">
  255. <div class="flex items-center">
  256. <div class="flex-shrink-0">
  257. <div class="w-12 h-12 bg-gradient-to-br from-purple-500 to-purple-600 rounded-xl flex items-center justify-center shadow-lg">
  258. <svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  259. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7"></path>
  260. </svg>
  261. </div>
  262. </div>
  263. <div class="ml-4">
  264. <p class="text-sm font-medium text-gray-600">活跃路径</p>
  265. <p class="text-2xl font-bold text-gray-900 mt-1">
  266. {{ $dashboardData['learning_path']['analytics']['active_paths'] ?? 0 }}
  267. </p>
  268. </div>
  269. </div>
  270. </div>
  271. </div>
  272. <div class="bg-gray-50 px-6 py-4 border-t border-gray-100">
  273. <div class="flex justify-between text-xs">
  274. <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
  275. 已完成: {{ $dashboardData['learning_path']['analytics']['completed_paths'] ?? 0 }}
  276. </span>
  277. <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-800">
  278. 效率: {{ number_format(($dashboardData['learning_path']['analytics']['average_efficiency_score'] ?? 0) * 100, 0) }}%
  279. </span>
  280. </div>
  281. </div>
  282. </div>
  283. @endif
  284. </div>
  285. </div>
  286. {{-- 主要内容区域 --}}
  287. <div class="mb-8">
  288. <div class="grid grid-cols-1 gap-6 lg:grid-cols-2">
  289. {{-- 掌握度分析 --}}
  290. <div class="bg-white shadow-sm rounded-xl border border-gray-200">
  291. <div class="px-6 py-5 border-b border-gray-100 flex items-center justify-between">
  292. <h3 class="text-lg font-semibold text-gray-900 flex items-center">
  293. <svg class="w-5 h-5 mr-2 text-indigo-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  294. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
  295. </svg>
  296. 知识点掌握度
  297. </h3>
  298. <button
  299. wire:click="batchUpdateSkills"
  300. class="inline-flex items-center px-3 py-1.5 border border-transparent text-xs font-medium rounded-lg text-indigo-700 bg-indigo-100 hover:bg-indigo-200 transition-colors duration-150"
  301. >
  302. <svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  303. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
  304. </svg>
  305. 刷新
  306. </button>
  307. </div>
  308. <div class="p-6">
  309. @if (isset($dashboardData['mastery']['overview']['total_knowledge_points']))
  310. <div class="space-y-4">
  311. <div class="flex items-center justify-between text-sm">
  312. <span class="text-gray-600">总知识点数</span>
  313. <span class="font-medium text-gray-900">{{ $dashboardData['mastery']['overview']['total_knowledge_points'] }}</span>
  314. </div>
  315. <div class="w-full bg-gray-200 rounded-full h-2">
  316. <div class="bg-indigo-600 h-2 rounded-full" style="width: {{ $dashboardData['mastery']['overview']['average_mastery_level'] * 100 }}%"></div>
  317. </div>
  318. <div class="grid grid-cols-3 gap-4 mt-4">
  319. <div class="text-center">
  320. <div class="text-2xl font-semibold text-green-600">{{ $dashboardData['mastery']['overview']['mastered_knowledge_points'] }}</div>
  321. <div class="text-xs text-gray-500">已掌握 (≥85%)</div>
  322. </div>
  323. <div class="text-center">
  324. <div class="text-2xl font-semibold text-blue-600">{{ $dashboardData['mastery']['overview']['good_knowledge_points'] }}</div>
  325. <div class="text-xs text-gray-500">良好 (70-85%)</div>
  326. </div>
  327. <div class="text-center">
  328. <div class="text-2xl font-semibold text-red-600">{{ $dashboardData['mastery']['overview']['weak_knowledge_points'] }}</div>
  329. <div class="text-xs text-gray-500">薄弱 (<50%)</div>
  330. </div>
  331. </div>
  332. @if (!empty($dashboardData['mastery']['overview']['weak_knowledge_points_list']))
  333. <div class="mt-6">
  334. <h4 class="text-sm font-medium text-gray-900 mb-3">薄弱知识点</h4>
  335. <div class="space-y-2">
  336. @foreach (array_slice($dashboardData['mastery']['overview']['weak_knowledge_points_list'], 0, 5) as $weak)
  337. <div class="flex items-center justify-between p-3 bg-red-50 rounded-lg">
  338. <div class="flex items-center">
  339. <div class="w-2 h-2 bg-red-500 rounded-full mr-3"></div>
  340. <span class="text-sm font-medium text-gray-900">{{ $weak['kp_code'] ?? $weak['knowledge_point_code'] ?? 'N/A' }}</span>
  341. </div>
  342. <div class="flex items-center space-x-3">
  343. <span class="text-sm text-gray-600">{{ number_format(($weak['mastery_level'] ?? $weak['mastery'] ?? 0) * 100, 1) }}%</span>
  344. <button
  345. wire:click="recalculateMastery('{{ $weak['kp_code'] ?? $weak['knowledge_point_code'] ?? '' }}')"
  346. class="text-xs text-indigo-600 hover:text-indigo-800"
  347. >
  348. 重新计算
  349. </button>
  350. </div>
  351. </div>
  352. @endforeach
  353. </div>
  354. </div>
  355. @endif
  356. </div>
  357. @else
  358. <div class="text-center py-8 text-gray-500">
  359. 暂无掌握度数据
  360. </div>
  361. @endif
  362. </div>
  363. </div>
  364. {{-- 技能熟练度 --}}
  365. <div class="bg-white shadow-sm rounded-xl border border-gray-200">
  366. <div class="px-6 py-5 border-b border-gray-100 flex items-center justify-between">
  367. <h3 class="text-lg font-semibold text-gray-900 flex items-center">
  368. <svg class="w-5 h-5 mr-2 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  369. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
  370. </svg>
  371. 技能熟练度
  372. </h3>
  373. <button
  374. wire:click="batchUpdateSkills"
  375. class="inline-flex items-center px-3 py-1.5 border border-transparent text-xs font-medium rounded-lg text-green-700 bg-green-100 hover:bg-green-200 transition-colors duration-150"
  376. >
  377. <svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  378. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
  379. </svg>
  380. 批量更新
  381. </button>
  382. </div>
  383. <div class="p-6">
  384. @php
  385. $skillData = $dashboardData['skill']['proficiency']['data'] ?? [];
  386. if (!is_array($skillData)) {
  387. $skillData = [];
  388. }
  389. @endphp
  390. @if (!empty($skillData))
  391. <div class="space-y-4">
  392. @foreach (array_slice($skillData, 0, 5) as $skill)
  393. <div class="flex items-center justify-between">
  394. <div class="flex items-center flex-1">
  395. <div class="w-2 h-2 bg-green-500 rounded-full mr-3"></div>
  396. <div class="flex-1">
  397. <div class="text-sm font-medium text-gray-900">{{ $skill['skill_name'] ?? 'N/A' }}</div>
  398. <div class="w-full bg-gray-200 rounded-full h-1.5 mt-1">
  399. <div class="bg-green-500 h-1.5 rounded-full" style="width: {{ (($skill['proficiency_level'] ?? 0) * 100) }}%"></div>
  400. </div>
  401. </div>
  402. </div>
  403. <div class="ml-4 text-right">
  404. <div class="text-sm font-semibold text-gray-900">{{ number_format(($skill['proficiency_level'] ?? 0) * 100, 1) }}%</div>
  405. <div class="text-xs text-gray-500">{{ $skill['total_questions_attempted'] ?? 0 }}题</div>
  406. </div>
  407. </div>
  408. @endforeach
  409. </div>
  410. @else
  411. <div class="text-center py-8 text-gray-500">
  412. 暂无技能数据
  413. </div>
  414. @endif
  415. </div>
  416. </div>
  417. </div>
  418. {{-- 技能熟练度雷达图 - 已隐藏(功能已实现但暂时隐藏以简化界面) --}}
  419. {{-- <div class="mb-8">
  420. <div class="bg-white shadow-sm rounded-xl border border-gray-200">
  421. <div class="px-6 py-5 border-b border-gray-100">
  422. <h3 class="text-lg font-semibold text-gray-900 flex items-center">
  423. <svg class="w-5 h-5 mr-2 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  424. <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>
  425. </svg>
  426. 技能熟练度雷达图
  427. </h3>
  428. </div>
  429. <div class="p-6">
  430. <livewire:skill-proficiency-radar :student-id="$studentId" />
  431. </div>
  432. </div>
  433. </div> --}}
  434. {{-- 提分预测和学习路径 - 已实现 --}}
  435. <div class="mb-8">
  436. <div class="grid grid-cols-1 gap-6 lg:grid-cols-2">
  437. {{-- 提分预测 --}}
  438. <div class="bg-white shadow-sm rounded-xl border border-gray-200">
  439. <div class="px-6 py-5 border-b border-gray-100 flex items-center justify-between">
  440. <h3 class="text-lg font-semibold text-gray-900 flex items-center">
  441. <svg class="w-5 h-5 mr-2 text-yellow-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  442. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"></path>
  443. </svg>
  444. 提分预测
  445. </h3>
  446. <button
  447. wire:click="generateQuickPrediction"
  448. class="inline-flex items-center px-3 py-1.5 border border-transparent text-xs font-medium rounded-lg text-yellow-700 bg-yellow-100 hover:bg-yellow-200 transition-colors duration-150"
  449. >
  450. <svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  451. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
  452. </svg>
  453. 快速预测
  454. </button>
  455. </div>
  456. <div class="p-6">
  457. {{-- 快速预测结果 --}}
  458. @if (isset($dashboardData['prediction']['quick']) && !empty($dashboardData['prediction']['quick']['quick_prediction']))
  459. @php
  460. $quickPrediction = $dashboardData['prediction']['quick']['quick_prediction'];
  461. @endphp
  462. {{-- 主要预测信息卡片 --}}
  463. <div class="bg-gradient-to-r from-blue-50 to-indigo-50 rounded-lg p-6 mb-6 border border-blue-200">
  464. <div class="flex items-center justify-between mb-4">
  465. <div>
  466. <h4 class="text-lg font-semibold text-gray-900">智能提分预测</h4>
  467. <p class="text-sm text-gray-600 mt-1">基于当前学习数据的AI分析</p>
  468. </div>
  469. <div class="text-right">
  470. <div class="text-2xl font-bold text-green-600">
  471. +{{ number_format($quickPrediction['improvement_potential'] ?? 0, 1) }}分
  472. </div>
  473. <div class="text-sm text-gray-500">预期提分</div>
  474. </div>
  475. </div>
  476. <div class="grid grid-cols-3 gap-4 mb-4">
  477. <div class="text-center">
  478. <div class="text-lg font-semibold text-gray-900">
  479. {{ $quickPrediction['current_score'] ?? 0 }}分
  480. </div>
  481. <div class="text-xs text-gray-500">当前分数</div>
  482. </div>
  483. <div class="text-center">
  484. <div class="text-lg font-semibold text-blue-600">
  485. {{ $quickPrediction['predicted_score'] ?? 0 }}分
  486. </div>
  487. <div class="text-xs text-gray-500">预测分数</div>
  488. </div>
  489. <div class="text-center">
  490. <div class="text-lg font-semibold text-purple-600">
  491. {{ $quickPrediction['estimated_study_hours'] ?? 0 }}h
  492. </div>
  493. <div class="text-xs text-gray-500">建议学习时间</div>
  494. </div>
  495. </div>
  496. <div class="flex items-center justify-between">
  497. <div class="flex items-center space-x-2">
  498. <span class="text-sm text-gray-600">置信度:</span>
  499. <div class="flex items-center">
  500. <div class="w-20 bg-gray-200 rounded-full h-2 mr-2">
  501. <div class="bg-blue-600 h-2 rounded-full" style="width: {{ ($quickPrediction['confidence_level'] ?? 0) * 100 }}%"></div>
  502. </div>
  503. <span class="text-sm font-medium text-gray-900">{{ number_format(($quickPrediction['confidence_level'] ?? 0) * 100, 0) }}%</span>
  504. </div>
  505. </div>
  506. <div class="text-xs text-gray-500">
  507. {{ $quickPrediction['weak_knowledge_points_count'] ?? 0 }}个薄弱知识点
  508. </div>
  509. </div>
  510. </div>
  511. {{-- 优先学习主题 --}}
  512. @if (!empty($quickPrediction['priority_topics']))
  513. <div class="mb-6">
  514. <h5 class="text-sm font-medium text-gray-900 mb-3 flex items-center">
  515. <svg class="w-4 h-4 mr-2 text-yellow-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  516. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
  517. </svg>
  518. 优先学习主题 (前5个)
  519. </h5>
  520. <div class="space-y-2">
  521. @foreach (array_slice($quickPrediction['priority_topics'], 0, 5) as $topic)
  522. <div class="flex items-center justify-between p-3 bg-yellow-50 rounded-lg border border-yellow-200">
  523. <div class="flex items-center space-x-3">
  524. <div class="w-8 h-8 bg-yellow-100 rounded-full flex items-center justify-center">
  525. <span class="text-xs font-medium text-yellow-800">{{ substr($topic['kp_code'] ?? '', -2) }}</span>
  526. </div>
  527. <div>
  528. <div class="text-sm font-medium text-gray-900">{{ $topic['kp_code'] ?? 'N/A' }}</div>
  529. <div class="text-xs text-gray-500">掌握度: {{ number_format(($topic['mastery_level'] ?? 0) * 100, 1) }}%</div>
  530. </div>
  531. </div>
  532. <div class="text-right">
  533. <div class="text-sm font-medium text-gray-900">优先级</div>
  534. <div class="text-xs text-gray-500">{{ number_format($topic['priority_score'] ?? 0, 2) }}</div>
  535. </div>
  536. </div>
  537. @endforeach
  538. </div>
  539. </div>
  540. @endif
  541. {{-- 学习建议 --}}
  542. @if (!empty($quickPrediction['recommended_actions']))
  543. <div>
  544. <h5 class="text-sm font-medium text-gray-900 mb-3 flex items-center">
  545. <svg class="w-4 h-4 mr-2 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  546. <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>
  547. </svg>
  548. 个性化学习建议
  549. </h5>
  550. <div class="space-y-3">
  551. @foreach (array_slice($quickPrediction['recommended_actions'], 0, 3) as $recommendation)
  552. <div class="p-3 bg-blue-50 rounded-lg border border-blue-200">
  553. <div class="flex items-center justify-between mb-2">
  554. <span class="text-sm font-medium text-gray-900">{{ $recommendation['kp_code'] ?? 'N/A' }}</span>
  555. <span class="text-xs text-gray-500">
  556. {{ number_format(($recommendation['current_mastery'] ?? 0) * 100, 0) }}% → {{ number_format(($recommendation['target_mastery'] ?? 0) * 100, 0) }}%
  557. </span>
  558. </div>
  559. <div class="flex flex-wrap gap-1">
  560. @foreach (($recommendation['actions'] ?? []) as $action)
  561. <span class="inline-flex items-center px-2 py-1 rounded-full text-xs bg-blue-100 text-blue-800">
  562. {{ $action }}
  563. </span>
  564. @endforeach
  565. </div>
  566. </div>
  567. @endforeach
  568. </div>
  569. </div>
  570. @endif
  571. {{-- 历史预测记录 --}}
  572. @elseif (!empty($dashboardData['prediction']['list']['predictions']))
  573. @php
  574. $historicalPredictions = $dashboardData['prediction']['list']['predictions'];
  575. @endphp
  576. <div class="space-y-4">
  577. <h5 class="text-sm font-medium text-gray-900 mb-3">历史预测记录</h5>
  578. @foreach (array_slice($historicalPredictions, 0, 3) as $prediction)
  579. <div class="p-4 border border-gray-200 rounded-lg">
  580. <div class="flex items-center justify-between mb-2">
  581. <div class="text-sm font-medium text-gray-900">{{ $prediction['target_entity'] ?? 'N/A' }}</div>
  582. <span class="text-xs text-gray-500">{{ $prediction['prediction_date'] ?? date('m-d') }}</span>
  583. </div>
  584. <div class="flex items-center justify-between">
  585. <div class="text-sm text-gray-600">
  586. 当前: {{ $prediction['current_score'] ?? 0 }}分 →
  587. <span class="font-semibold text-gray-900">{{ $prediction['predicted_score'] ?? 0 }}分</span>
  588. </div>
  589. <div class="text-sm font-semibold text-green-600">
  590. +{{ number_format(($prediction['predicted_score'] ?? 0) - ($prediction['current_score'] ?? 0), 1) }}分
  591. </div>
  592. </div>
  593. </div>
  594. @endforeach
  595. </div>
  596. @else
  597. <div class="text-center py-8 text-gray-500">
  598. <div class="mb-4">
  599. <svg class="w-12 h-12 mx-auto text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  600. <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>
  601. </svg>
  602. </div>
  603. <p class="text-sm font-medium text-gray-900 mb-1">暂无预测数据</p>
  604. <p class="text-xs text-gray-500 mb-4">点击"快速预测"按钮生成AI预测分析</p>
  605. <button
  606. wire:click="generateQuickPrediction"
  607. class="inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-lg text-white bg-blue-600 hover:bg-blue-700 transition-colors duration-200"
  608. >
  609. <svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  610. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
  611. </svg>
  612. 生成快速预测
  613. </button>
  614. </div>
  615. @endif
  616. </div>
  617. </div>
  618. </div>
  619. {{-- 掌握度热力图 - 已隐藏(功能已实现但暂时隐藏以简化界面) --}}
  620. {{-- <div class="mb-8">
  621. <div class="bg-white shadow-sm rounded-xl border border-gray-200">
  622. <div class="px-6 py-5 border-b border-gray-100">
  623. <h3 class="text-lg font-semibold text-gray-900 flex items-center">
  624. <svg class="w-5 h-5 mr-2 text-red-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  625. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"></path>
  626. </svg>
  627. 知识点掌握度热力图
  628. </h3>
  629. </div>
  630. <div class="p-6">
  631. <livewire:mastery-heatmap :student-id="$studentId" />
  632. </div>
  633. </div>
  634. </div> --}}
  635. {{-- 知识点依赖关系图 - 已隐藏(功能已实现但暂时隐藏以简化界面) --}}
  636. {{-- <div class="mb-8">
  637. <div class="bg-white shadow-sm rounded-xl border border-gray-200">
  638. <div class="px-6 py-5 border-b border-gray-100">
  639. <h3 class="text-lg font-semibold text-gray-900 flex items-center">
  640. <svg class="w-5 h-5 mr-2 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  641. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path>
  642. </svg>
  643. 知识点依赖关系图
  644. </h3>
  645. </div>
  646. <div class="p-6">
  647. <livewire:knowledge-dependency-graph :student-id="$studentId" />
  648. </div>
  649. </div>
  650. </div> --}}
  651. {{-- 推荐学习路径 - 已隐藏(功能已实现但暂时隐藏以简化界面) --}}
  652. {{-- @if (isset($dashboardData['learning_path']['recommendations']['recommendations']))
  653. <div class="mb-8">
  654. <div class="bg-white shadow-sm rounded-xl border border-gray-200">
  655. <div class="px-6 py-5 border-b border-gray-100">
  656. <h3 class="text-lg font-semibold text-gray-900 flex items-center">
  657. <svg class="w-5 h-5 mr-2 text-indigo-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  658. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"></path>
  659. </svg>
  660. 推荐学习路径
  661. </h3>
  662. </div>
  663. <div class="p-6">
  664. <div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
  665. @foreach ($dashboardData['learning_path']['recommendations']['recommendations'] as $recommendation)
  666. <div class="p-4 border border-gray-200 rounded-lg hover:border-indigo-300 transition-colors">
  667. <div class="flex items-center mb-3">
  668. <div class="w-8 h-8 bg-indigo-100 rounded-full flex items-center justify-center mr-3">
  669. <svg class="w-4 h-4 text-indigo-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  670. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
  671. </svg>
  672. </div>
  673. <div class="flex-1">
  674. <div class="text-sm font-medium text-gray-900">{{ $recommendation['target_kp_name'] }}</div>
  675. <div class="text-xs text-gray-500">{{ $recommendation['target_kp_code'] }}</div>
  676. </div>
  677. </div>
  678. <div class="mb-3">
  679. <div class="flex items-center justify-between text-xs text-gray-600 mb-1">
  680. <span>当前掌握度</span>
  681. <span class="font-medium">{{ number_format($recommendation['current_mastery'] * 100, 1) }}%</span>
  682. </div>
  683. <div class="w-full bg-gray-200 rounded-full h-1.5">
  684. <div class="bg-indigo-500 h-1.5 rounded-full" style="width: {{ $recommendation['current_mastery'] * 100 }}%"></div>
  685. </div>
  686. </div>
  687. <p class="text-xs text-gray-600 mb-3">{{ $recommendation['reason'] }}</p>
  688. <button class="w-full text-xs bg-indigo-600 text-white py-2 px-3 rounded-md hover:bg-indigo-700 transition-colors">
  689. 生成学习路径
  690. </button>
  691. </div>
  692. @endforeach
  693. </div>
  694. </div>
  695. </div>
  696. @endif --}}
  697. </div>
  698. </div>
  699. @endif
  700. {{-- 通知脚本 --}}
  701. <script>
  702. document.addEventListener('notify', (event) => {
  703. const message = event.detail.message;
  704. const type = event.detail.type || 'info';
  705. alert(message);
  706. });
  707. </script>