fix
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
2025-10-12 18:28:33 +08:00
parent 696f5ae2c9
commit 2aec0abca2
4 changed files with 30 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
import { defineStore } from "pinia"
import { Problem } from "utils/types"
import { LANGUAGE, Problem } from "utils/types"
/**
* 题目状态管理 Store
@@ -10,17 +10,12 @@ export const useProblemStore = defineStore("problem", () => {
const problem = ref<Problem | null>(null)
// ==================== 计算属性 ====================
const hasProblem = computed(() => problem.value !== null)
const problemId = computed(() => problem.value?._id ?? null)
const problemTitle = computed(() => problem.value?.title ?? "")
const difficulty = computed(() => problem.value?.difficulty ?? "")
const languages = computed(() => problem.value?.languages ?? [])
const isACed = computed(() => problem.value?.my_status === 0)
const languages = computed<LANGUAGE[]>(() => {
if (problem.value?.allow_flowchart) {
return ["Flowchart", ...problem.value?.languages]
}
return problem.value?.languages ?? []
})
// ==================== 操作 ====================
/**
@@ -51,12 +46,7 @@ export const useProblemStore = defineStore("problem", () => {
problem,
// 计算属性
hasProblem,
problemId,
problemTitle,
difficulty,
languages,
isACed,
// 操作
setProblem,