knowledge-graph-integration.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <x-filament-panels::page>
  2. <div class="space-y-6">
  3. {{-- 页面标题 --}}
  4. <div class="flex items-center justify-between">
  5. <div>
  6. <h2 class="text-2xl font-bold tracking-tight text-gray-900 dark:text-gray-100">
  7. 知识图谱整合视图
  8. </h2>
  9. <p class="mt-1 text-sm text-gray-500 dark:text-gray-400">
  10. 以知识图谱为核心,整合知识点、题库和关联关系的完整视图
  11. </p>
  12. </div>
  13. <div class="flex items-center gap-2">
  14. <button
  15. wire:click="toggleSidebar"
  16. class="inline-flex items-center gap-2 px-3 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 dark:text-gray-300 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700"
  17. >
  18. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  19. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
  20. </svg>
  21. {{ $showSidebar ? '隐藏' : '显示' }}侧边栏
  22. </button>
  23. <button
  24. wire:click="clearSelection"
  25. class="inline-flex items-center gap-2 px-3 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 dark:text-gray-300 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700"
  26. >
  27. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  28. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
  29. </svg>
  30. 清空选择
  31. </button>
  32. </div>
  33. </div>
  34. {{-- 标签页导航 --}}
  35. <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-2">
  36. <nav class="flex space-x-2" aria-label="Tabs">
  37. @foreach($this->tabs as $tabId => $tab)
  38. <button
  39. wire:click="setActiveTab('{{ $tabId }}')"
  40. class="{{ $activeTab === $tabId ? 'bg-indigo-100 text-indigo-700 dark:bg-indigo-900 dark:text-indigo-300' : 'text-gray-500 hover:text-gray-700 hover:bg-gray-50 dark:text-gray-400 dark:hover:text-gray-300 dark:hover:bg-gray-700' }} group inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg transition-colors"
  41. >
  42. @svg($tab['icon'], 'w-5 h-5')
  43. {{ $tab['label'] }}
  44. </button>
  45. @endforeach
  46. </nav>
  47. </div>
  48. {{-- 主要内容区域 --}}
  49. <div class="grid gap-6 {{ $showSidebar ? 'lg:grid-cols-4' : 'lg:grid-cols-1' }}">
  50. {{-- 主内容区 --}}
  51. <div class="lg:col-span-{{ $showSidebar ? '3' : '1' }}">
  52. <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden">
  53. @if($activeTab === 'graph')
  54. <div class="p-6">
  55. <livewire:integrations.knowledge-graph-component :selectedKpCode="$selectedKpCode" />
  56. </div>
  57. @elseif($activeTab === 'list')
  58. <div class="p-6">
  59. <livewire:integrations.knowledge-points-list-component />
  60. </div>
  61. @elseif($activeTab === 'stats')
  62. <div class="p-6">
  63. <livewire:integrations.knowledge-point-stats-component :selectedKpCode="$selectedKpCode" />
  64. </div>
  65. @elseif($activeTab === 'network')
  66. <div class="p-6">
  67. <livewire:integrations.knowledge-network-component :selectedKpCode="$selectedKpCode" />
  68. </div>
  69. @endif
  70. </div>
  71. </div>
  72. {{-- 侧边栏 --}}
  73. @if($showSidebar)
  74. <div class="lg:col-span-1 space-y-4">
  75. {{-- 当前选中知识点 --}}
  76. <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4">
  77. <h3 class="text-sm font-medium text-gray-900 dark:text-gray-100 mb-3">当前选中</h3>
  78. @if($selectedKpCode)
  79. <div class="flex items-center justify-between p-3 bg-indigo-50 dark:bg-indigo-900/20 rounded-lg">
  80. <div class="flex-1">
  81. <p class="text-sm font-medium text-indigo-900 dark:text-indigo-300">{{ $selectedKpCode }}</p>
  82. </div>
  83. <button
  84. wire:click="$set('selectedKpCode', null)"
  85. class="text-indigo-600 hover:text-indigo-800 dark:text-indigo-400 dark:hover:text-indigo-200"
  86. >
  87. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  88. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
  89. </svg>
  90. </button>
  91. </div>
  92. @else
  93. <p class="text-sm text-gray-500 dark:text-gray-400">未选中知识点</p>
  94. @endif
  95. </div>
  96. {{-- 快速导航 --}}
  97. <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4">
  98. <h3 class="text-sm font-medium text-gray-900 dark:text-gray-100 mb-3">快速导航</h3>
  99. <nav class="space-y-1">
  100. <a
  101. href="{{ url('admin/knowledge-points') }}"
  102. class="flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 dark:text-gray-300 dark:hover:bg-gray-700 rounded-lg"
  103. >
  104. @svg('heroicon-o-map', 'w-4 h-4')
  105. 知识点总览
  106. </a>
  107. <a
  108. href="{{ url('admin/knowledge-mindmap') }}"
  109. class="flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 dark:text-gray-300 dark:hover:bg-gray-700 rounded-lg"
  110. >
  111. @svg('heroicon-o-share', 'w-4 h-4')
  112. 知识图谱脑图
  113. </a>
  114. <a
  115. href="{{ url('admin/knowledge-point-stats') }}"
  116. class="flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 dark:text-gray-300 dark:hover:bg-gray-700 rounded-lg"
  117. >
  118. @svg('heroicon-o-chart-bar', 'w-4 h-4')
  119. 知识点统计
  120. </a>
  121. <a
  122. href="{{ url('admin/student-knowledge-graph-page') }}"
  123. class="flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 dark:text-gray-300 dark:hover:bg-gray-700 rounded-lg"
  124. >
  125. @svg('heroicon-o-user-group', 'w-4 h-4')
  126. 学生知识图谱
  127. </a>
  128. </nav>
  129. </div>
  130. {{-- 统计摘要 --}}
  131. <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4">
  132. <h3 class="text-sm font-medium text-gray-900 dark:text-gray-100 mb-3">统计摘要</h3>
  133. <div class="space-y-2 text-sm">
  134. <div class="flex justify-between">
  135. <span class="text-gray-600 dark:text-gray-400">当前标签页:</span>
  136. <span class="font-medium text-gray-900 dark:text-gray-100">{{ $this->tabs[$activeTab]['label'] }}</span>
  137. </div>
  138. <div class="flex justify-between">
  139. <span class="text-gray-600 dark:text-gray-400">视图模式:</span>
  140. <span class="font-medium text-gray-900 dark:text-gray-100">{{ $showSidebar ? '侧边栏模式' : '全屏模式' }}</span>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. @endif
  146. </div>
  147. {{-- 底部说明 --}}
  148. <div class="bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 p-4">
  149. <div class="flex items-start gap-3">
  150. <svg class="w-5 h-5 text-indigo-600 dark:text-indigo-400 flex-shrink-0 mt-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  151. <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>
  152. </svg>
  153. <div>
  154. <h4 class="text-sm font-medium text-gray-900 dark:text-gray-100">使用说明</h4>
  155. <div class="mt-2 text-sm text-gray-600 dark:text-gray-400">
  156. <p>• <strong>知识图谱</strong>:可视化展示知识点之间的关联关系</p>
  157. <p>• <strong>知识点列表</strong>:浏览和管理所有知识点,支持搜索和筛选</p>
  158. <p>• <strong>题库统计</strong>:查看每个知识点的题目数量分布</p>
  159. <p>• <strong>关联网络</strong>:展示知识点、题库和技能点之间的关联网络</p>
  160. </div>
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. </x-filament-panels::page>
  166. @push('scripts')
  167. <script>
  168. document.addEventListener('livewire:initialized', () => {
  169. // 监听组件事件
  170. Livewire.on('kpSelected', (event) => {
  171. console.log('Knowledge point selected:', event);
  172. });
  173. Livewire.on('clearAllSelections', () => {
  174. console.log('All selections cleared');
  175. });
  176. Livewire.on('tabChanged', (event) => {
  177. console.log('Tab changed to:', event.tab);
  178. });
  179. });
  180. </script>
  181. @endpush