Files
OJ2/apps/web/src/oj/problemset/components/LockNote.vue
T
xuyueandClaude Opus 5.5 1b703d13ae
Deploy / deploy (push) Canceled after 0s
style(专题): 「题单」改名「专题」,顶栏、列表、详情、后台、成就说法统一
只改界面文字和注释:网址 /problemset、接口、表名、字段名都不动,老链接照常能打开。
设计稿页名「题单重设计」和已执行的迁移文件保留原样。
线上 3 个成就(题单收藏家 / 入门 / 通关)已同步改名。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:12:18 +08:00

46 lines
1.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { useThemeVars } from 'naive-ui'
import { getProblemSetLocks } from 'oj/api'
import { parseTime } from 'utils/functions'
import type { ProblemSetLock } from 'utils/types'
/**
* 「旧代码为什么藏着」那一句(设计稿「题单重设计」旧代码藏着时学生看到的):
* 专题《X》布置中,这道题以前的代码先藏着 · 在专题里做对,或 M月D日 之后就能看。
* 规则在后端 problemSetLockCutoffs;查不到是哪个专题(比如刚过期)就说通用的一句
*/
const props = defineProps<{ problem: { id: number } | { displayId: string } }>()
const theme = useThemeVars()
const locks = ref<ProblemSetLock[]>([])
watch(
() => ('id' in props.problem ? props.problem.id : props.problem.displayId),
async () => {
try {
locks.value = await getProblemSetLocks(props.problem)
} catch {
locks.value = []
}
},
{ immediate: true },
)
const first = computed(() => locks.value[0])
</script>
<template>
<span v-if="first">
专题<router-link :to="{ name: 'problemset', params: { problemSetId: first.problemSetId } }">《{{ first.title }}》</router-link
>布置中,这道题以前的代码先藏着 · 在专题里做对,或 {{ parseTime(first.assignedUntil, 'M月D日') }} 之后就能看
</span>
<span v-else>这道题正在专题里布置,以前的代码先藏着 · 在专题里做对,或者布置期结束就能看</span>
</template>
<style scoped>
a {
color: v-bind('theme.primaryColor');
text-decoration: none;
}
</style>