| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace App\Filament\Pages;
- use App\Services\KnowledgePointQuestionStatsService;
- use BackedEnum;
- use Filament\Pages\Page;
- use Filament\Support\Enums\Width;
- use Livewire\Attributes\Computed;
- use UnitEnum;
- class KnowledgePointQuestionStats extends Page
- {
- protected static ?string $title = '知识点题量统计';
- protected static string|BackedEnum|null $navigationIcon = 'heroicon-o-table-cells';
- protected static ?string $navigationLabel = '知识点题量统计';
- protected static string|UnitEnum|null $navigationGroup = '题库管理';
- protected static ?int $navigationSort = 6;
- protected Width|string|null $maxContentWidth = Width::Full;
- protected string $view = 'filament.pages.knowledge-point-question-stats';
- /** @return list<array{kp_code: string, kp_name: string, questions_count: int, tem_non_duplicate_count: int, sort_order: int}> */
- #[Computed(cache: false)]
- public function statRows(): array
- {
- return app(KnowledgePointQuestionStatsService::class)->buildRows();
- }
- #[Computed(cache: false)]
- public function markdownExport(): string
- {
- return app(KnowledgePointQuestionStatsService::class)->toMarkdownTable($this->statRows);
- }
- }
|