From 8a6858d6de06ed5c042ccf95e0a00eff113745c9 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Mon, 11 May 2026 00:22:47 -0600 Subject: [PATCH] feat: show yearly AC rate chart on problem info page --- src/oj/problem/components/ProblemInfo.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/oj/problem/components/ProblemInfo.vue b/src/oj/problem/components/ProblemInfo.vue index de9989b..c310d88 100644 --- a/src/oj/problem/components/ProblemInfo.vue +++ b/src/oj/problem/components/ProblemInfo.vue @@ -14,6 +14,8 @@ import { Colors, } from "chart.js" import { getProblemBeatRate } from "oj/api" +import { getProblemYearlyAC, type YearlyACData } from "oj/api" +import ProblemYearlyChart from "./ProblemYearlyChart.vue" import { useBreakpoints } from "shared/composables/breakpoints" // 仅注册饼图所需的 Chart.js 组件 @@ -25,6 +27,7 @@ const { problem } = storeToRefs(problemStore) const { isDesktop } = useBreakpoints() const beatRate = ref("0") +const yearlyACData = ref([]) const data = computed(() => { const status = problem.value!.statistic_info @@ -90,7 +93,15 @@ async function getBeatRate() { beatRate.value = res.data } -onMounted(getBeatRate) +async function getYearlyAC() { + const res = await getProblemYearlyAC(problem.value!._id) + yearlyACData.value = res.data +} + +onMounted(() => { + getBeatRate() + getYearlyAC() +})