@@ -18,10 +18,13 @@ type Sample = Problem["samples"][number] & {
|
||||
const theme = useThemeVars()
|
||||
const style = computed(() => "color: " + theme.value.primaryColor)
|
||||
|
||||
const route = useRoute()
|
||||
const codeStore = useCodeStore()
|
||||
const problemStore = useProblemStore()
|
||||
const { problem } = storeToRefs(problemStore)
|
||||
|
||||
const problemSetId = computed(() => route.params.problemSetId)
|
||||
|
||||
// 判断用户是否尝试过但未通过
|
||||
// my_status === 0: 已通过
|
||||
// my_status !== 0 && my_status !== null: 尝试过但未通过
|
||||
@@ -106,24 +109,27 @@ function type(status: ProblemStatus) {
|
||||
|
||||
<template>
|
||||
<div v-if="problem" class="problemContent">
|
||||
<!-- 已通过 -->
|
||||
<n-alert
|
||||
class="status-alert"
|
||||
v-if="problem.my_status === 0"
|
||||
type="success"
|
||||
title="🎉 本 题 已 经 被 你 解 决 啦"
|
||||
>
|
||||
</n-alert>
|
||||
<template v-if="!problemSetId">
|
||||
<!-- 已通过 -->
|
||||
<n-alert
|
||||
class="status-alert"
|
||||
v-if="problem.my_status === 0"
|
||||
type="success"
|
||||
title="🎉 本 题 已 经 被 你 解 决 啦"
|
||||
>
|
||||
</n-alert>
|
||||
|
||||
<!-- 尝试过但未通过 -->
|
||||
<n-alert
|
||||
class="status-alert"
|
||||
v-else-if="hasTriedButNotPassed"
|
||||
type="warning"
|
||||
title="💪 你已经尝试过这道题,但还没有通过"
|
||||
>
|
||||
不要放弃!仔细检查代码逻辑,或者寻求 AI 的帮助获取灵感。
|
||||
</n-alert>
|
||||
</template>
|
||||
|
||||
<!-- 尝试过但未通过 -->
|
||||
<n-alert
|
||||
class="status-alert"
|
||||
v-else-if="hasTriedButNotPassed"
|
||||
type="warning"
|
||||
title="💪 你已经尝试过这道题,但还没有通过"
|
||||
>
|
||||
不要放弃!仔细检查代码逻辑,或者寻求 AI 的帮助获取灵感。
|
||||
</n-alert>
|
||||
<n-flex align="center">
|
||||
<n-tag>{{ problem._id }}</n-tag>
|
||||
<h2 class="problemTitle">{{ problem.title }}</h2>
|
||||
|
||||
@@ -130,13 +130,26 @@ watch(isMobile, (value) => {
|
||||
>
|
||||
<ProblemFlowchart />
|
||||
</n-tab-pane>
|
||||
<n-tab-pane name="info" tab="题目统计">
|
||||
<n-tab-pane
|
||||
name="info"
|
||||
tab="题目统计"
|
||||
:disabled="!!props.problemSetId"
|
||||
>
|
||||
<ProblemInfo />
|
||||
</n-tab-pane>
|
||||
<n-tab-pane v-if="!props.contestID" name="comment" tab="题目点评">
|
||||
<n-tab-pane
|
||||
v-if="!props.contestID"
|
||||
name="comment"
|
||||
tab="题目点评"
|
||||
:disabled="!!props.problemSetId"
|
||||
>
|
||||
<ProblemComment />
|
||||
</n-tab-pane>
|
||||
<n-tab-pane name="submission" tab="我的提交">
|
||||
<n-tab-pane
|
||||
name="submission"
|
||||
tab="我的提交"
|
||||
:disabled="!!props.problemSetId"
|
||||
>
|
||||
<ProblemSubmission />
|
||||
</n-tab-pane>
|
||||
</n-tabs>
|
||||
@@ -151,13 +164,22 @@ watch(isMobile, (value) => {
|
||||
<n-tab-pane name="editor" tab="代码">
|
||||
<component :is="inProblem ? ProblemEditor : ContestEditor" />
|
||||
</n-tab-pane>
|
||||
<n-tab-pane name="info" tab="统计">
|
||||
<n-tab-pane name="info" tab="统计" :disabled="!!props.problemSetId">
|
||||
<ProblemInfo />
|
||||
</n-tab-pane>
|
||||
<n-tab-pane v-if="!props.contestID" name="comment" tab="点评">
|
||||
<n-tab-pane
|
||||
v-if="!props.contestID"
|
||||
name="comment"
|
||||
tab="点评"
|
||||
:disabled="!!props.problemSetId"
|
||||
>
|
||||
<ProblemComment />
|
||||
</n-tab-pane>
|
||||
<n-tab-pane name="submission" tab="提交">
|
||||
<n-tab-pane
|
||||
name="submission"
|
||||
tab="提交"
|
||||
:disabled="!!props.problemSetId"
|
||||
>
|
||||
<ProblemSubmission />
|
||||
</n-tab-pane>
|
||||
</n-tabs>
|
||||
|
||||
Reference in New Issue
Block a user