update
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-06-05 08:52:00 -06:00
parent 4ef2738afd
commit 324e85d2c0
2 changed files with 21 additions and 5 deletions

View File

@@ -105,8 +105,8 @@ export function getRankOfProblem(problem_id: string) {
return http.get("user_problem_rank", { params: { problem_id: problem_id } })
}
export function getTodaySubmissionCount() {
return http.get("submissions/today_count")
export function getTodaySubmissionCount(language?: string) {
return http.get("submissions/today_count", { params: { language } })
}
export function adminRejudge(id: string) {
@@ -353,6 +353,7 @@ export function getFlowchartSubmissions(params: {
myself?: string
offset?: number
limit?: number
today?: string
}) {
return http.get("flowchart/submissions", { params })
}

View File

@@ -96,6 +96,7 @@ async function listSubmissions() {
myself: query.myself,
offset,
limit: query.limit,
today: query.today,
})
total.value = res.data.total
flowcharts.value = res.data.results
@@ -114,7 +115,7 @@ async function listSubmissions() {
}
async function getTodayCount() {
const res = await getTodaySubmissionCount()
const res = await getTodaySubmissionCount(query.language)
todayCount.value = res.data
}
@@ -192,6 +193,14 @@ watch(
listSubmissions,
)
// 切换语言时刷新今日提交数(流程图与代码分别统计)
watch(
() => query.language,
() => {
if (route.name === "submissions") getTodayCount()
},
)
const columns = computed(() => {
const res: DataTableColumn<SubmissionListItem>[] = [
{
@@ -449,14 +458,20 @@ const flowchartColumns: DataTableColumn<FlowchartSubmissionListItem>[] = [
preset="card"
:style="{ maxWidth: isDesktop && '800px', maxHeight: '80vh' }"
:content-style="{ overflow: 'auto' }"
:title="query.language === 'Flowchart' ? '流程图提交的统计' : '提交记录的统计'"
:title="
query.language === 'Flowchart' ? '流程图提交的统计' : '提交记录的统计'
"
>
<FlowchartStatisticsPanel
v-if="query.language === 'Flowchart'"
:problem="query.problem"
:username="query.username"
/>
<StatisticsPanel v-else :problem="query.problem" :username="query.username" />
<StatisticsPanel
v-else
:problem="query.problem"
:username="query.username"
/>
</n-modal>
<n-modal
v-model:show="codePanel"