题库编辑弹窗时限改为分钟录入,默认0不限时

This commit is contained in:
2026-09-09 19:38:15 +08:00
parent f186524476
commit 62a8760292
3 files changed
+11 -11

No files matched your search

+2 -2
View File
@@ -943,13 +943,13 @@
"delete_msg": "Deleting \"{name}\" will also delete all its questions. Continue?",
"err_name_required": "Please enter the bank name",
"draw_count_hint": "Random draw count per type; draws all of that type if fewer are available",
"duration_seconds_hint": "Seconds, 0 = no time limit",
"back": "Back to banks",
"manage_questions": "Manage Questions",
"single_short": "S",
"multiple_short": "M",
"judge_short": "J",
"blank_short": "B",
"manage": "Manage"
"manage": "Manage",
"duration_minutes_hint": "In minutes, 0 = no time limit"
}
}
+2 -2
View File
@@ -944,13 +944,13 @@
"delete_msg": "删除题库\"{name}\"将同时删除其下所有题目,确认继续?",
"err_name_required": "请填写题库名称",
"draw_count_hint": "每种题型随机抽取数量,题目不足则该题型全部抽取",
"duration_seconds_hint": "单位秒,0 表示不限时",
"back": "返回题库列表",
"manage_questions": "管理题目",
"single_short": "单",
"multiple_short": "多",
"judge_short": "判",
"blank_short": "填",
"manage": "题库管理"
"manage": "题库管理",
"duration_minutes_hint": "单位分钟,0 表示不限时"
}
}
@@ -149,7 +149,7 @@ const form = reactive({
countMultiple: 10,
countJudge: 20,
countBlank: 10,
durationSec: 300,
durationMin: 0,
})
function openAdd() {
@@ -160,7 +160,7 @@ function openAdd() {
form.countMultiple = 10
form.countJudge = 20
form.countBlank = 10
form.durationSec = 300
form.durationMin = 0
showModal.value = true
}
@@ -173,7 +173,7 @@ function openEdit(row, event) {
form.countMultiple = row.countMultiple || 10
form.countJudge = row.countJudge || 20
form.countBlank = row.countBlank || 10
form.durationSec = row.durationSec
form.durationMin = Math.round((row.durationSec || 0) / 60)
showModal.value = true
}
@@ -192,7 +192,7 @@ async function handleSave() {
countMultiple: form.countMultiple,
countJudge: form.countJudge,
countBlank: form.countBlank,
durationSec: form.durationSec,
durationSec: (form.durationMin || 0) * 60,
}
const { errCode } = editingId.value
? await quizApi.updateBank({ id: editingId.value, ...payload })
@@ -478,13 +478,13 @@ onMounted(fetchBanks)
<div class="flex items-center gap-3">
<label class="w-24 shrink-0 text-sm font-medium text-gray-700 dark:text-gray-300">{{ t('quiz.time_limit') }}</label>
<input
v-model.number="form.durationSec"
v-model.number="form.durationMin"
type="number"
min="0"
max="7200"
max="120"
class="w-24 rounded-lg border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-900 outline-none transition-colors focus:border-blue-500 dark:border-dk-muted dark:bg-dk-base dark:text-white"
/>
<span class="text-xs text-gray-400 dark:text-gray-500">{{ t('banks.duration_seconds_hint') }}</span>
<span class="text-xs text-gray-400 dark:text-gray-500">{{ t('banks.duration_minutes_hint') }}</span>
</div>
</div>