|
|
@@ -98,6 +98,7 @@
|
|
|
<tr>
|
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">题目编号</th>
|
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">知识点</th>
|
|
|
+ <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">创建时间</th>
|
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">题干</th>
|
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">难度</th>
|
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase">操作</th>
|
|
|
@@ -107,7 +108,19 @@
|
|
|
@forelse($questionsData as $question)
|
|
|
<tr class="hover:bg-gray-50">
|
|
|
<td class="px-6 py-4 whitespace-nowrap">{{ $question['question_code'] ?? 'N/A' }}</td>
|
|
|
- <td class="px-6 py-4 whitespace-nowrap">{{ $question['kp_code'] ?? 'N/A' }}</td>
|
|
|
+ <td class="px-6 py-4 whitespace-nowrap">
|
|
|
+ <div class="text-sm font-medium text-gray-900">{{ $question['kp_name'] ?? $question['kp_code'] ?? 'N/A' }}</div>
|
|
|
+ @if(!empty($question['kp_code']))
|
|
|
+ <div class="text-xs text-gray-500">{{ $question['kp_code'] }}</div>
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+ <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">
|
|
|
+ @if(!empty($question['created_at']))
|
|
|
+ {{ \Carbon\Carbon::parse($question['created_at'])->toDateTimeString() }}
|
|
|
+ @else
|
|
|
+ -
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
<td class="px-6 py-4" style="word-wrap: break-word; white-space: normal; line-height: 1.8; max-width: 400px;">
|
|
|
<span class="text-sm">
|
|
|
@math($question['stem'] ?? 'N/A')
|
|
|
@@ -129,6 +142,7 @@
|
|
|
@endif
|
|
|
</td>
|
|
|
<td class="px-6 py-4 whitespace-nowrap">
|
|
|
+ <button wire:click="viewQuestion('{{ $question['question_code'] }}')" class="text-blue-600 hover:underline mr-3">详情</button>
|
|
|
<button wire:click="deleteQuestion('{{ $question['question_code'] }}')" class="text-red-600 hover:underline">删除</button>
|
|
|
</td>
|
|
|
</tr>
|
|
|
@@ -151,6 +165,71 @@
|
|
|
</div>
|
|
|
@endif
|
|
|
</div>
|
|
|
+
|
|
|
+ {{-- 详情侧边栏 --}}
|
|
|
+ @if($showDetailModal)
|
|
|
+ <div class="fixed inset-0 z-40 flex">
|
|
|
+ <div class="flex-1 bg-black/40" wire:click="$set('showDetailModal', false)"></div>
|
|
|
+ <div class="w-full max-w-3xl bg-white shadow-xl overflow-y-auto">
|
|
|
+ <div class="p-6 border-b flex justify-between items-center">
|
|
|
+ <div>
|
|
|
+ <h3 class="text-lg font-semibold">{{ $editing['question_code'] ?? '题目详情' }}</h3>
|
|
|
+ <p class="text-sm text-gray-500">
|
|
|
+ {{ $editing['kp_name'] ?? ($editing['kp_code'] ?? '') }}
|
|
|
+ @if(!empty($editing['kp_code'])) ({{ $editing['kp_code'] }}) @endif
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ <button class="text-gray-500 hover:text-gray-700" wire:click="$set('showDetailModal', false)">×</button>
|
|
|
+ </div>
|
|
|
+ <div class="p-6 space-y-4">
|
|
|
+ <div>
|
|
|
+ <label class="text-sm font-medium text-gray-700">知识点代码</label>
|
|
|
+ <input type="text" wire:model="editing.kp_code" class="w-full border rounded px-3 py-2 text-sm">
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label class="text-sm font-medium text-gray-700">题干</label>
|
|
|
+ <textarea wire:model="editing.stem" rows="4" class="w-full border rounded px-3 py-2 text-sm"></textarea>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label class="text-sm font-medium text-gray-700">答案</label>
|
|
|
+ <textarea wire:model="editing.answer" rows="3" class="w-full border rounded px-3 py-2 text-sm"></textarea>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label class="text-sm font-medium text-gray-700">解析</label>
|
|
|
+ <textarea wire:model="editing.solution" rows="4" class="w-full border rounded px-3 py-2 text-sm"></textarea>
|
|
|
+ </div>
|
|
|
+ <div class="grid grid-cols-2 gap-4 text-sm">
|
|
|
+ <div>
|
|
|
+ <label class="text-sm font-medium text-gray-700">难度 (0-1)</label>
|
|
|
+ <input type="number" step="0.01" min="0" max="1" wire:model="editing.difficulty" class="w-full border rounded px-3 py-2 text-sm">
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label class="text-sm font-medium text-gray-700">题型</label>
|
|
|
+ <input type="text" wire:model="editing.question_type" class="w-full border rounded px-3 py-2 text-sm" placeholder="choice/fill/answer">
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label class="text-sm font-medium text-gray-700">来源</label>
|
|
|
+ <input type="text" wire:model="editing.source" class="w-full border rounded px-3 py-2 text-sm">
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <label class="text-sm font-medium text-gray-700">标签</label>
|
|
|
+ <input type="text" wire:model="editing.tags" class="w-full border rounded px-3 py-2 text-sm">
|
|
|
+ </div>
|
|
|
+ <div class="col-span-2">
|
|
|
+ <label class="text-sm font-medium text-gray-700">技能(逗号分隔)</label>
|
|
|
+ <input type="text" wire:model="editing.skills_text" class="w-full border rounded px-3 py-2 text-sm">
|
|
|
+ </div>
|
|
|
+ <div><span class="font-medium">创建时间:</span>{{ $editing['created_at'] ?? '-' }}</div>
|
|
|
+ <div><span class="font-medium">更新时间:</span>{{ $editing['updated_at'] ?? '-' }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="p-6 border-t flex justify-end gap-3">
|
|
|
+ <button class="px-4 py-2 border rounded text-sm" wire:click="$set('showDetailModal', false)">取消</button>
|
|
|
+ <button class="px-4 py-2 bg-blue-600 text-white rounded text-sm hover:bg-blue-700" wire:click="saveQuestion">保存</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
</div>
|
|
|
|
|
|
-</x-filament-panels::page>
|
|
|
+</x-filament-panels::page>
|