student-dashboard.blade.php 50 KB

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