@@ -8,10 +8,11 @@ import { LANGUAGE, Problem } from "utils/types"
|
|||||||
export const useProblemStore = defineStore("problem", () => {
|
export const useProblemStore = defineStore("problem", () => {
|
||||||
// ==================== 状态 ====================
|
// ==================== 状态 ====================
|
||||||
const problem = ref<Problem | null>(null)
|
const problem = ref<Problem | null>(null)
|
||||||
|
const route = useRoute()
|
||||||
|
|
||||||
// ==================== 计算属性 ====================
|
// ==================== 计算属性 ====================
|
||||||
const languages = computed<LANGUAGE[]>(() => {
|
const languages = computed<LANGUAGE[]>(() => {
|
||||||
if (problem.value?.allow_flowchart) {
|
if (route.name === "problem" && problem.value?.allow_flowchart) {
|
||||||
return ["Flowchart", ...problem.value?.languages]
|
return ["Flowchart", ...problem.value?.languages]
|
||||||
}
|
}
|
||||||
return problem.value?.languages ?? []
|
return problem.value?.languages ?? []
|
||||||
|
|||||||
@@ -64,14 +64,17 @@ export const ojs: RouteRecordRaw = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "rank",
|
path: "rank",
|
||||||
|
name: "rank",
|
||||||
component: () => import("oj/rank/list.vue"),
|
component: () => import("oj/rank/list.vue"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "class",
|
path: "class",
|
||||||
|
name: "class",
|
||||||
component: () => import("oj/class/pk.vue"),
|
component: () => import("oj/class/pk.vue"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "announcement",
|
path: "announcement",
|
||||||
|
name: "announcements",
|
||||||
component: () => import("oj/announcement/list.vue"),
|
component: () => import("oj/announcement/list.vue"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -97,11 +100,13 @@ export const ojs: RouteRecordRaw = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "ai-analysis",
|
path: "ai-analysis",
|
||||||
|
name: "ai",
|
||||||
component: () => import("oj/ai/analysis.vue"),
|
component: () => import("oj/ai/analysis.vue"),
|
||||||
meta: { requiresAuth: true },
|
meta: { requiresAuth: true },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "flowchart",
|
path: "flowchart",
|
||||||
|
name: "flowchart",
|
||||||
component: () => import("oj/flowchart/index.vue"),
|
component: () => import("oj/flowchart/index.vue"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user