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