@@ -44,10 +44,6 @@ function getDifficultyTag(difficulty: string) {
|
||||
return difficultyMap[difficulty] || { type: "default", text: "未知" }
|
||||
}
|
||||
|
||||
function goToProblem(problemId: string) {
|
||||
router.push(`/problemset/${problemSetId.value}/problem/${problemId}`)
|
||||
}
|
||||
|
||||
function getProgressPercentage() {
|
||||
if (!problemSet.value) return 0
|
||||
return Math.round(
|
||||
@@ -120,9 +116,7 @@ onMounted(init)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="problemSet">
|
||||
<!-- 题单信息头部 -->
|
||||
<n-card style="margin-bottom: 24px">
|
||||
<n-card v-if="problemSet" style="margin-bottom: 24px">
|
||||
<n-flex justify="space-between" align="center">
|
||||
<n-flex align="center">
|
||||
<n-tag type="warning" v-if="problemSet.status === 'archived'">
|
||||
@@ -183,9 +177,7 @@ onMounted(init)
|
||||
</n-flex>
|
||||
</n-flex>
|
||||
</n-card>
|
||||
|
||||
<!-- 题目列表 -->
|
||||
<n-grid :cols="isDesktop ? 4 : 1" :x-gap="16" :y-gap="16">
|
||||
<n-grid v-if="problemSet" :cols="isDesktop ? 4 : 1" :x-gap="16" :y-gap="16">
|
||||
<n-grid-item
|
||||
v-for="(problemSetProblem, index) in problems"
|
||||
:key="problemSetProblem.id"
|
||||
@@ -206,7 +198,6 @@ onMounted(init)
|
||||
<n-flex vertical style="flex: 1">
|
||||
<n-flex align="center">
|
||||
<n-h4 style="margin: 0">#{{ index + 1 }}</n-h4>
|
||||
|
||||
<n-h4 style="margin: 0">
|
||||
{{ problemSetProblem.problem.title }}
|
||||
</n-h4>
|
||||
@@ -219,19 +210,23 @@ onMounted(init)
|
||||
>
|
||||
{{ DIFFICULTY[problemSetProblem.problem.difficulty] }}
|
||||
</n-tag>
|
||||
<n-text type="info">
|
||||
分数:{{ problemSetProblem.score }}
|
||||
</n-text>
|
||||
<n-text v-if="!problemSetProblem.is_required">
|
||||
(选做)
|
||||
</n-text>
|
||||
<n-text type="info"> 分数:{{ problemSetProblem.score }} </n-text>
|
||||
<n-text v-if="!problemSetProblem.is_required"> (选做) </n-text>
|
||||
</n-flex>
|
||||
</n-flex>
|
||||
</n-flex>
|
||||
</n-card>
|
||||
</n-grid-item>
|
||||
</n-grid>
|
||||
|
||||
<div class="tip">
|
||||
<n-text :deep="3">* 题目完成后会自动返回题单页面</n-text>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
<style scoped>
|
||||
.tip {
|
||||
padding: 24px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user