StudentKnowledgeGraphPage.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace App\Filament\Pages;
  3. use BackedEnum;
  4. use UnitEnum;
  5. use Filament\Pages\Page;
  6. use App\Livewire\StudentKnowledgeGraph;
  7. use Illuminate\Support\Arr;
  8. class StudentKnowledgeGraphPage extends Page
  9. {
  10. protected static BackedEnum | string | null $navigationIcon = 'heroicon-o-chart-bar';
  11. protected static ?string $navigationLabel = '学生知识图谱';
  12. protected static UnitEnum | string | null $navigationGroup = '资源';
  13. protected static ?int $navigationSort = 25;
  14. protected string $view = 'filament.pages.student-knowledge-graph-page';
  15. public bool $showNodeDetails = true;
  16. public string $detailLayout = 'inline';
  17. public function mount(): void
  18. {
  19. // Page 类不需要 authorizeResourceAccess
  20. $this->showNodeDetails = filter_var(
  21. request()->query('show_details', true),
  22. FILTER_VALIDATE_BOOLEAN
  23. );
  24. $layout = request()->query('detail_layout', 'inline');
  25. $this->detailLayout = in_array($layout, ['inline', 'drawer'], true)
  26. ? $layout
  27. : 'inline';
  28. }
  29. public function getBreadcrumbs(): array
  30. {
  31. return [
  32. '学生知识图谱',
  33. ];
  34. }
  35. protected function getHeaderWidgets(): array
  36. {
  37. return [
  38. // 可以在这里添加额外的header widgets
  39. ];
  40. }
  41. protected function getFooterWidgets(): array
  42. {
  43. return [
  44. // 可以在这里添加额外的footer widgets
  45. ];
  46. }
  47. }