update
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
2025-10-24 11:04:01 +08:00
parent df24bf7f54
commit d766433068
5 changed files with 40 additions and 44 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
public/badge-6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -28,14 +28,15 @@ const newBadgeConditionType = ref<"all_problems" | "problem_count" | "score">(
) )
const newBadgeConditionValue = ref(1) const newBadgeConditionValue = ref(1)
// 预设奖章图标选项 const BADGE_LEN = 6
const badgeIconOptions = [ const badgeIconOptions = []
{ label: "奖章1", value: "/badge-1.png", icon: "/badge-1.png" }, for (let i = 1; i <= BADGE_LEN; i++) {
{ label: "奖章2", value: "/badge-2.png", icon: "/badge-2.png" }, badgeIconOptions.push({
{ label: "奖章3", value: "/badge-3.png", icon: "/badge-3.png" }, label: `奖章${i}`,
{ label: "奖章4", value: "/badge-4.png", icon: "/badge-4.png" }, value: `/badge-${i}.png`,
{ label: "奖章5", value: "/badge-5.png", icon: "/badge-5.png" }, icon: `/badge-${i}.png`,
] })
}
const conditionTypeOptions = [ const conditionTypeOptions = [
{ label: "完成所有题目", value: "all_problems" }, { label: "完成所有题目", value: "all_problems" },

View File

@@ -32,13 +32,15 @@ const editBadgeConditionType = ref<"all_problems" | "problem_count" | "score">(
const editBadgeConditionValue = ref(1) const editBadgeConditionValue = ref(1)
// 预设奖章图标选项 // 预设奖章图标选项
const badgeIconOptions = [ const BADGE_LEN = 6
{ label: "奖章1", value: "/badge-1.png", icon: "/badge-1.png" }, const badgeIconOptions = []
{ label: "奖章2", value: "/badge-2.png", icon: "/badge-2.png" }, for (let i = 1; i <= BADGE_LEN; i++) {
{ label: "奖章3", value: "/badge-3.png", icon: "/badge-3.png" }, badgeIconOptions.push({
{ label: "奖章4", value: "/badge-4.png", icon: "/badge-4.png" }, label: `奖章${i}`,
{ label: "奖章5", value: "/badge-5.png", icon: "/badge-5.png" }, value: `/badge-${i}.png`,
] icon: `/badge-${i}.png`,
})
}
const conditionTypeOptions = [ const conditionTypeOptions = [
{ label: "完成所有题目", value: "all_problems" }, { label: "完成所有题目", value: "all_problems" },

View File

@@ -11,17 +11,14 @@ defineProps<Props>()
<template> <template>
<n-card title="题单信息" style="margin-bottom: 16px"> <n-card title="题单信息" style="margin-bottom: 16px">
<n-flex vertical gap="medium"> <n-descriptions :column="4" bordered>
<n-flex> <n-descriptions-item label="描述">
<span style="width: 100px; font-weight: bold">描述</span> {{ problemSet.description }}
<span>{{ problemSet.description }}</span> </n-descriptions-item>
</n-flex> <n-descriptions-item label="创建者">
<n-flex> {{ problemSet.created_by.username }}
<span style="width: 100px; font-weight: bold">创建者</span> </n-descriptions-item>
<span>{{ problemSet.created_by.username }}</span> <n-descriptions-item label="难度">
</n-flex>
<n-flex>
<span style="width: 100px; font-weight: bold">难度</span>
<n-tag <n-tag
:type=" :type="
problemSet.difficulty === 'Easy' problemSet.difficulty === 'Easy'
@@ -39,9 +36,8 @@ defineProps<Props>()
: "困难" : "困难"
}} }}
</n-tag> </n-tag>
</n-flex> </n-descriptions-item>
<n-flex> <n-descriptions-item label="状态">
<span style="width: 100px; font-weight: bold">状态</span>
<n-tag <n-tag
:type=" :type="
problemSet.status === 'active' problemSet.status === 'active'
@@ -59,21 +55,18 @@ defineProps<Props>()
: "草稿" : "草稿"
}} }}
</n-tag> </n-tag>
</n-flex> </n-descriptions-item>
<n-flex> <n-descriptions-item label="可见">
<span style="width: 100px; font-weight: bold">可见</span> {{ problemSet.visible ? "是" : "否" }}
<span>{{ problemSet.visible ? "是" : "否" }}</span> </n-descriptions-item>
</n-flex> <n-descriptions-item label="题目数量">
<n-flex> {{ problemSet.problems_count }}
<span style="width: 100px; font-weight: bold">题目数量</span> </n-descriptions-item>
<span>{{ problemSet.problems_count }}</span> <n-descriptions-item label="创建时间">
</n-flex> {{
<n-flex>
<span style="width: 100px; font-weight: bold">创建时间</span>
<span>{{
parseTime(problemSet.create_time, "YYYY-MM-DD HH:mm:ss") parseTime(problemSet.create_time, "YYYY-MM-DD HH:mm:ss")
}}</span> }}
</n-flex> </n-descriptions-item>
</n-flex> </n-descriptions>
</n-card> </n-card>
</template> </template>