update
This commit is contained in:
@@ -105,8 +105,8 @@ export function getRankOfProblem(problem_id: string) {
|
|||||||
return http.get("user_problem_rank", { params: { problem_id: problem_id } })
|
return http.get("user_problem_rank", { params: { problem_id: problem_id } })
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTodaySubmissionCount() {
|
export function getTodaySubmissionCount(language?: string) {
|
||||||
return http.get("submissions/today_count")
|
return http.get("submissions/today_count", { params: { language } })
|
||||||
}
|
}
|
||||||
|
|
||||||
export function adminRejudge(id: string) {
|
export function adminRejudge(id: string) {
|
||||||
@@ -353,6 +353,7 @@ export function getFlowchartSubmissions(params: {
|
|||||||
myself?: string
|
myself?: string
|
||||||
offset?: number
|
offset?: number
|
||||||
limit?: number
|
limit?: number
|
||||||
|
today?: string
|
||||||
}) {
|
}) {
|
||||||
return http.get("flowchart/submissions", { params })
|
return http.get("flowchart/submissions", { params })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ async function listSubmissions() {
|
|||||||
myself: query.myself,
|
myself: query.myself,
|
||||||
offset,
|
offset,
|
||||||
limit: query.limit,
|
limit: query.limit,
|
||||||
|
today: query.today,
|
||||||
})
|
})
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
flowcharts.value = res.data.results
|
flowcharts.value = res.data.results
|
||||||
@@ -114,7 +115,7 @@ async function listSubmissions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getTodayCount() {
|
async function getTodayCount() {
|
||||||
const res = await getTodaySubmissionCount()
|
const res = await getTodaySubmissionCount(query.language)
|
||||||
todayCount.value = res.data
|
todayCount.value = res.data
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,6 +193,14 @@ watch(
|
|||||||
listSubmissions,
|
listSubmissions,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 切换语言时刷新今日提交数(流程图与代码分别统计)
|
||||||
|
watch(
|
||||||
|
() => query.language,
|
||||||
|
() => {
|
||||||
|
if (route.name === "submissions") getTodayCount()
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
const columns = computed(() => {
|
const columns = computed(() => {
|
||||||
const res: DataTableColumn<SubmissionListItem>[] = [
|
const res: DataTableColumn<SubmissionListItem>[] = [
|
||||||
{
|
{
|
||||||
@@ -449,14 +458,20 @@ const flowchartColumns: DataTableColumn<FlowchartSubmissionListItem>[] = [
|
|||||||
preset="card"
|
preset="card"
|
||||||
:style="{ maxWidth: isDesktop && '800px', maxHeight: '80vh' }"
|
:style="{ maxWidth: isDesktop && '800px', maxHeight: '80vh' }"
|
||||||
:content-style="{ overflow: 'auto' }"
|
:content-style="{ overflow: 'auto' }"
|
||||||
:title="query.language === 'Flowchart' ? '流程图提交的统计' : '提交记录的统计'"
|
:title="
|
||||||
|
query.language === 'Flowchart' ? '流程图提交的统计' : '提交记录的统计'
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<FlowchartStatisticsPanel
|
<FlowchartStatisticsPanel
|
||||||
v-if="query.language === 'Flowchart'"
|
v-if="query.language === 'Flowchart'"
|
||||||
:problem="query.problem"
|
:problem="query.problem"
|
||||||
:username="query.username"
|
: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>
|
||||||
<n-modal
|
<n-modal
|
||||||
v-model:show="codePanel"
|
v-model:show="codePanel"
|
||||||
|
|||||||
Reference in New Issue
Block a user