student-dashboard.blade.php 48 KB

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