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