| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320 |
- <div>
- <div class="space-y-6">
- {{-- 页面标题和筛选 --}}
- <div class="flex items-center justify-between">
- <div>
- <h2 class="text-xl font-semibold tracking-tight">知识点题目数量统计</h2>
- <p class="text-sm text-gray-500 mt-1">通过知识点筛选,汇总当前知识点和各个技能点的题目数量</p>
- </div>
- </div>
- {{-- 知识点筛选器 --}}
- <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
- <div class="flex items-center gap-4">
- <div class="flex-1">
- <label for="kp-select" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
- 选择知识点
- </label>
- <select
- id="kp-select"
- wire:model.live="selectedKpCode"
- class="w-full rounded-lg border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500"
- >
- <option value="">-- 选择知识点 --</option>
- @foreach($this->knowledgePointOptions as $code => $name)
- <option value="{{ $code }}">{{ $name }} ({{ $code }})</option>
- @endforeach
- </select>
- </div>
- <div class="flex items-end">
- <button
- type="button"
- wire:click="toggleDetails"
- class="px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
- >
- {{ $showDetails ? '隐藏详情' : '显示详情' }}
- </button>
- </div>
- </div>
- </div>
- {{-- 统计概览 --}}
- @if(!empty($this->knowledgePointStatistics))
- <div class="grid grid-cols-1 md:grid-cols-4 gap-4">
- {{-- 总题目数 --}}
- <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
- <div class="flex items-center justify-between">
- <div>
- <p class="text-sm font-medium text-gray-600 dark:text-gray-400">总题目数</p>
- <p class="text-3xl font-bold text-gray-900 dark:text-gray-100 mt-2">
- {{ array_sum(array_map([$this, 'getTotalQuestions'], $this->knowledgePointStatistics)) }}
- </p>
- </div>
- <div class="p-3 bg-blue-100 dark:bg-blue-900 rounded-full">
- <svg class="w-8 h-8 text-blue-600 dark:text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path>
- </svg>
- </div>
- </div>
- </div>
- {{-- 直接题目数 --}}
- <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
- <div class="flex items-center justify-between">
- <div>
- <p class="text-sm font-medium text-gray-600 dark:text-gray-400">直接题目数</p>
- <p class="text-3xl font-bold text-gray-900 dark:text-gray-100 mt-2">
- {{ array_sum(array_map([$this, 'getDirectQuestions'], $this->knowledgePointStatistics)) }}
- </p>
- </div>
- <div class="p-3 bg-green-100 dark:bg-green-900 rounded-full">
- <svg class="w-8 h-8 text-green-600 dark:text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
- </svg>
- </div>
- </div>
- </div>
- {{-- 子知识点题目数 --}}
- <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
- <div class="flex items-center justify-between">
- <div>
- <p class="text-sm font-medium text-gray-600 dark:text-gray-400">子知识点题目数</p>
- <p class="text-3xl font-bold text-gray-900 dark:text-gray-100 mt-2">
- {{ array_sum(array_map([$this, 'getChildrenQuestions'], $this->knowledgePointStatistics)) }}
- </p>
- </div>
- <div class="p-3 bg-yellow-100 dark:bg-yellow-900 rounded-full">
- <svg class="w-8 h-8 text-yellow-600 dark:text-yellow-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"></path>
- </svg>
- </div>
- </div>
- </div>
- {{-- 技能点题目数 --}}
- <div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
- <div class="flex items-center justify-between">
- <div>
- <p class="text-sm font-medium text-gray-600 dark:text-gray-400">技能点题目数</p>
- <p class="text-3xl font-bold text-gray-900 dark:text-gray-100 mt-2">
- {{ array_sum(array_map([$this, 'getSkillQuestions'], $this->knowledgePointStatistics)) }}
- </p>
- </div>
- <div class="p-3 bg-purple-100 dark:bg-purple-900 rounded-full">
- <svg class="w-8 h-8 text-purple-600 dark:text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path>
- </svg>
- </div>
- </div>
- </div>
- </div>
- @endif
- {{-- 知识点统计列表 --}}
- <div class="bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden">
- <div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700">
- <h3 class="text-lg font-medium text-gray-900 dark:text-gray-100">
- {{ $selectedKpCode ? '知识点详情' : '所有知识点统计' }}
- </h3>
- </div>
- <div class="overflow-x-auto">
- <table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
- <thead class="bg-gray-50 dark:bg-gray-900">
- <tr>
- <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
- 知识点
- </th>
- <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
- 总题目数
- </th>
- <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
- 直接题目
- </th>
- <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
- 子知识点题目
- </th>
- <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
- 技能点数
- </th>
- <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
- 技能点题目
- </th>
- </tr>
- </thead>
- <tbody class="bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700">
- @forelse($this->knowledgePointStatistics as $stat)
- <tr class="hover:bg-gray-50 dark:hover:bg-gray-700">
- <td class="px-6 py-4 whitespace-nowrap">
- <div>
- <div class="text-sm font-medium text-gray-900 dark:text-gray-100">
- {{ $stat['cn_name'] ?? $stat['kp_code'] }}
- </div>
- <div class="text-sm text-gray-500 dark:text-gray-400">
- {{ $stat['kp_code'] }}
- </div>
- </div>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200">
- {{ $stat['total_questions'] ?? 0 }}
- </span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200">
- {{ $stat['direct_questions'] ?? 0 }}
- </span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200">
- {{ $stat['children_questions'] ?? 0 }}
- </span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200">
- {{ $stat['skills_count'] ?? 0 }}
- </span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200">
- {{ $stat['skills_total_questions'] ?? 0 }}
- </span>
- </td>
- </tr>
- @if($showDetails && !empty($stat['children']))
- @foreach($stat['children'] as $child)
- <tr class="hover:bg-gray-50 dark:hover:bg-gray-700 bg-gray-50 dark:bg-gray-900">
- <td class="px-6 py-4 whitespace-nowrap pl-12">
- <div class="flex items-center">
- <svg class="w-4 h-4 text-gray-400 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
- </svg>
- <div>
- <div class="text-sm font-medium text-gray-900 dark:text-gray-100">
- {{ $child['cn_name'] ?? $child['kp_code'] }}
- </div>
- <div class="text-sm text-gray-500 dark:text-gray-400">
- {{ $child['kp_code'] }}
- </div>
- </div>
- </div>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm font-medium text-blue-600 dark:text-blue-400">
- {{ $child['total_questions'] ?? 0 }}
- </span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm font-medium text-green-600 dark:text-green-400">
- {{ $child['direct_questions'] ?? 0 }}
- </span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm font-medium text-yellow-600 dark:text-yellow-400">
- {{ $child['children_questions'] ?? 0 }}
- </span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm font-medium text-purple-600 dark:text-purple-400">
- {{ $child['skills_count'] ?? 0 }}
- </span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm font-medium text-indigo-600 dark:text-indigo-400">
- {{ $child['skills_total_questions'] ?? 0 }}
- </span>
- </td>
- </tr>
- @if($showDetails && !empty($child['skills']))
- @foreach($child['skills'] as $skill)
- <tr class="hover:bg-gray-50 dark:hover:bg-gray-700 bg-gray-100 dark:bg-gray-800">
- <td class="px-6 py-4 whitespace-nowrap pl-16">
- <div class="flex items-center">
- <svg class="w-3 h-3 text-gray-500 mr-2" fill="currentColor" viewBox="0 0 20 20">
- <circle cx="10" cy="10" r="3"></circle>
- </svg>
- <div>
- <div class="text-sm text-gray-900 dark:text-gray-100">
- {{ $skill['skill_code'] }}
- </div>
- </div>
- </div>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-gray-400">
- {{ $skill['question_count'] ?? 0 }}
- </span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-gray-400">-</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-gray-400">-</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-gray-400">1</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-gray-400">
- {{ $skill['question_count'] ?? 0 }}
- </span>
- </td>
- </tr>
- @endforeach
- @endif
- @endforeach
- @endif
- @if($showDetails && !empty($stat['skills']))
- @foreach($stat['skills'] as $skill)
- <tr class="hover:bg-gray-50 dark:hover:bg-gray-700 bg-gray-100 dark:bg-gray-800">
- <td class="px-6 py-4 whitespace-nowrap pl-12">
- <div class="flex items-center">
- <svg class="w-3 h-3 text-gray-500 mr-2" fill="currentColor" viewBox="0 0 20 20">
- <circle cx="10" cy="10" r="3"></circle>
- </svg>
- <div>
- <div class="text-sm text-gray-900 dark:text-gray-100">
- {{ $skill['skill_code'] }}
- </div>
- </div>
- </div>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-gray-400">
- {{ $skill['question_count'] ?? 0 }}
- </span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-gray-400">-</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-gray-400">-</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-gray-400">1</span>
- </td>
- <td class="px-6 py-4 whitespace-nowrap">
- <span class="text-sm text-gray-600 dark:text-gray-400">
- {{ $skill['question_count'] ?? 0 }}
- </span>
- </td>
- </tr>
- @endforeach
- @endif
- @empty
- <tr>
- <td colspan="6" class="px-6 py-12 text-center text-gray-500 dark:text-gray-400">
- 暂无统计数据
- </td>
- </tr>
- @endforelse
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
|