fix
Some checks failed
Deploy / deploy (build, debian, 22, /root/OJDeploy/data/clientnext) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822, /root/OJ/data/dist) (push) Has been cancelled

This commit is contained in:
2026-05-07 08:20:49 -06:00
parent 8aca538fbf
commit 3c24f2cd9e
5 changed files with 21 additions and 17 deletions

View File

@@ -88,8 +88,9 @@ const data = computed<ChartData<"bar" | "line">>(() => {
type: "line", type: "line",
label: "等级", label: "等级",
data: aiStore.durationData.map((duration) => data: aiStore.durationData.map((duration) =>
gradeOrder.indexOf(duration.grade || "C"), duration.grade ? gradeOrder.indexOf(duration.grade) : null,
), ),
spanGaps: false,
tension: 0.4, tension: 0.4,
yAxisID: "y1", yAxisID: "y1",
barThickness: 10, barThickness: 10,

View File

@@ -66,9 +66,9 @@ const efficiencyData = computed(() => {
// 值越接近1说明一次AC率越高 // 值越接近1说明一次AC率越高
const efficiency = problemCount > 0 ? submissionCount / problemCount : 0 const efficiency = problemCount > 0 ? submissionCount / problemCount : 0
// 计算一次AC率百分比 // AC率AC题目数 / 总提交次数(越高说明提交质量越好
const onePassRate = const onePassRate =
problemCount > 0 ? (problemCount / submissionCount) * 100 : 0 submissionCount > 0 ? (problemCount / submissionCount) * 100 : 0
return { return {
label: [ label: [
@@ -106,7 +106,7 @@ const data = computed<ChartData<"line">>(() => {
yAxisID: "y", yAxisID: "y",
}, },
{ {
label: "一次AC率", label: "提交AC率",
data: efficiency.map((e) => e.onePassRate), data: efficiency.map((e) => e.onePassRate),
borderColor: "rgb(34, 197, 94)", borderColor: "rgb(34, 197, 94)",
backgroundColor: "rgba(34, 197, 94, 0.1)", backgroundColor: "rgba(34, 197, 94, 0.1)",
@@ -165,7 +165,7 @@ const options = computed(() => {
max: 100, max: 100,
title: { title: {
display: true, display: true,
text: "一次AC率%", text: "提交AC率%",
font: { font: {
size: 13, size: 13,
}, },
@@ -201,10 +201,10 @@ const options = computed(() => {
`总提交: ${item.submissionCount}`, `总提交: ${item.submissionCount}`,
] ]
} else { } else {
// 一次AC率 // 提交AC率
return [ return [
`${dsLabel}: ${item.onePassRate.toFixed(1)}%`, `${dsLabel}: ${item.onePassRate.toFixed(1)}%`,
`提示: 越高表示刷题质量越好`, `提示: AC题目数 / 总提交次数,越高表示提交质量越好`,
] ]
} }
}, },

View File

@@ -1,7 +1,7 @@
<template> <template>
<n-card title="解题排名分布" size="small" v-if="show"> <n-card title="同期解题排名分布" size="small" v-if="show">
<template #header-extra> <template #header-extra>
<n-text depth="3" style="font-size: 12px">了解解题速度和竞争力</n-text> <n-text depth="3" style="font-size: 12px">了解同期解题速度和竞争力</n-text>
</template> </template>
<div style="height: 300px"> <div style="height: 300px">
<Pie :data="data" :options="options" /> <Pie :data="data" :options="options" />
@@ -36,12 +36,10 @@ const rankDistribution = computed(() => {
})) }))
aiStore.detailsData.solved.forEach((item) => { aiStore.detailsData.solved.forEach((item) => {
const rank = item.rank const rank = item.period_rank
const acCount = item.ac_count const acCount = item.period_ac_count
if (rank && acCount && acCount > 0) { if (rank && acCount && acCount > 0) {
// 计算百分位:(rank / acCount) * 100
// 例如第5名/共100人 = 5%
const percentile = (rank / acCount) * 100 const percentile = (rank / acCount) * 100
// 找到对应的区间 // 找到对应的区间

View File

@@ -2,7 +2,6 @@
<n-tabs animated v-if="submissions.length && flowcharts.length"> <n-tabs animated v-if="submissions.length && flowcharts.length">
<n-tab-pane name="代码提交"> <n-tab-pane name="代码提交">
<n-data-table <n-data-table
v-if="submissions.length"
striped striped
:data="submissions" :data="submissions"
:columns="columns" :columns="columns"
@@ -11,7 +10,6 @@
</n-tab-pane> </n-tab-pane>
<n-tab-pane name="流程图提交"> <n-tab-pane name="流程图提交">
<n-data-table <n-data-table
v-if="flowcharts.length"
striped striped
:data="flowcharts" :data="flowcharts"
:columns="flowchartsColumns" :columns="flowchartsColumns"
@@ -20,12 +18,19 @@
</n-tab-pane> </n-tab-pane>
</n-tabs> </n-tabs>
<n-data-table <n-data-table
v-if="submissions.length && !flowcharts.length" v-else-if="submissions.length"
striped striped
:data="submissions" :data="submissions"
:columns="columns" :columns="columns"
:max-height="isDesktop ? 1500 : 500" :max-height="isDesktop ? 1500 : 500"
/> />
<n-data-table
v-else-if="flowcharts.length"
striped
:data="flowcharts"
:columns="flowchartsColumns"
:max-height="isDesktop ? 1500 : 500"
/>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>

View File

@@ -1,7 +1,7 @@
<template> <template>
<n-card title="时间活跃度分析" size="small" v-if="show"> <n-card title="时间活跃度分析" size="small" v-if="show">
<template #header-extra> <template #header-extra>
<n-text depth="3" style="font-size: 12px">发现最佳学习时段</n-text> <n-text depth="3" style="font-size: 12px">基于 AC 时间发现解题高峰时段</n-text>
</template> </template>
<div style="height: 300px"> <div style="height: 300px">
<Bar :data="data" :options="options" /> <Bar :data="data" :options="options" />