From 4429e2f018740b6573bd03c7e40d2c9cddaaa9c7 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Thu, 25 Sep 2025 15:25:47 +0800 Subject: [PATCH] add heatmap --- src/oj/ai/analysis.vue | 3 +- src/oj/ai/components/Details.vue | 20 ++++++----- src/oj/ai/components/DifficultyChart.vue | 4 +-- src/oj/ai/components/Heatmap.vue | 43 ++++++++++++++++++++++++ src/oj/ai/components/TagsChart.vue | 4 +-- src/oj/api.ts | 4 +++ src/oj/store/ai.ts | 3 -- 7 files changed, 64 insertions(+), 17 deletions(-) create mode 100644 src/oj/ai/components/Heatmap.vue diff --git a/src/oj/ai/analysis.vue b/src/oj/ai/analysis.vue index adc0043..dfcf113 100644 --- a/src/oj/ai/analysis.vue +++ b/src/oj/ai/analysis.vue @@ -15,6 +15,7 @@ + @@ -26,9 +27,9 @@ import { isDesktop } from "~/shared/composables/breakpoints" import { formatISO, sub, type Duration } from "date-fns" import WeeklyChart from "./components/WeeklyChart.vue" import Details from "./components/Details.vue" +import Heatmap from "./components/Heatmap.vue" import AI from "./components/AI.vue" import { useAIStore } from "../store/ai" - const aiStore = useAIStore() const start = ref("") diff --git a/src/oj/ai/components/Details.vue b/src/oj/ai/components/Details.vue index cf877e1..55bb37e 100644 --- a/src/oj/ai/components/Details.vue +++ b/src/oj/ai/components/Details.vue @@ -7,7 +7,7 @@ v-if="aiStore.detailsData.solved.length" > {{ durationLabel }}, - {{ aiStore.theFirstPerson }}一共解决 + 你一共解决 {{ aiStore.detailsData.solved.length }} 道题, @@ -20,16 +20,17 @@ {{ greeting }} - + - - - - + + + + + + + + diff --git a/src/oj/ai/components/Heatmap.vue b/src/oj/ai/components/Heatmap.vue new file mode 100644 index 0000000..40f708e --- /dev/null +++ b/src/oj/ai/components/Heatmap.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/oj/ai/components/TagsChart.vue b/src/oj/ai/components/TagsChart.vue index f05c25b..c150ee1 100644 --- a/src/oj/ai/components/TagsChart.vue +++ b/src/oj/ai/components/TagsChart.vue @@ -51,7 +51,7 @@ const options = computed(() => { diff --git a/src/oj/api.ts b/src/oj/api.ts index da1a163..b99e08e 100644 --- a/src/oj/api.ts +++ b/src/oj/api.ts @@ -255,3 +255,7 @@ export function getAIWeeklyData( ) { return http.get("ai/weekly", { params: { end, duration } }) } + +export function getAIHeatmapData() { + return http.get("ai/heatmap") +} \ No newline at end of file diff --git a/src/oj/store/ai.ts b/src/oj/store/ai.ts index 03085dd..0769230 100644 --- a/src/oj/store/ai.ts +++ b/src/oj/store/ai.ts @@ -25,8 +25,6 @@ export const useAIStore = defineStore("ai", () => { const mdContent = ref("") - const theFirstPerson = "你" - async function fetchDetailsData( start: string, end: string, @@ -140,7 +138,6 @@ export const useAIStore = defineStore("ai", () => { weeklyData, detailsData, duration, - theFirstPerson, loading, mdContent, }