add today
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -25,3 +25,5 @@ dist-ssr
|
|||||||
|
|
||||||
src/components.d.ts
|
src/components.d.ts
|
||||||
src/auto-imports.d.ts
|
src/auto-imports.d.ts
|
||||||
|
|
||||||
|
.claude
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NButton, NH2, NText } from "naive-ui"
|
import { NButton } from "naive-ui"
|
||||||
import { useRouteQuery } from "@vueuse/router"
|
import { useRouteQuery } from "@vueuse/router"
|
||||||
import {
|
import {
|
||||||
adminRejudge,
|
adminRejudge,
|
||||||
@@ -34,6 +34,7 @@ interface SubmissionQuery {
|
|||||||
myself: "0" | "1"
|
myself: "0" | "1"
|
||||||
problem: string
|
problem: string
|
||||||
language: LANGUAGE | ""
|
language: LANGUAGE | ""
|
||||||
|
today: "0" | "1"
|
||||||
}
|
}
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@@ -55,6 +56,7 @@ const { query, clearQuery } = usePagination<SubmissionQuery>({
|
|||||||
myself: useRouteQuery("myself", "0").value,
|
myself: useRouteQuery("myself", "0").value,
|
||||||
problem: useRouteQuery("problem", "").value,
|
problem: useRouteQuery("problem", "").value,
|
||||||
language: useRouteQuery("language", "").value,
|
language: useRouteQuery("language", "").value,
|
||||||
|
today: "0",
|
||||||
})
|
})
|
||||||
const submissionID = ref("")
|
const submissionID = ref("")
|
||||||
const problemDisplayID = ref("")
|
const problemDisplayID = ref("")
|
||||||
@@ -103,6 +105,7 @@ async function listSubmissions() {
|
|||||||
problem_id: query.problem,
|
problem_id: query.problem,
|
||||||
contest_id: <string>route.params.contestID ?? "",
|
contest_id: <string>route.params.contestID ?? "",
|
||||||
language: query.language,
|
language: query.language,
|
||||||
|
today: query.today,
|
||||||
})
|
})
|
||||||
submissions.value = res.data.results
|
submissions.value = res.data.results
|
||||||
total.value = res.data.total
|
total.value = res.data.total
|
||||||
@@ -177,7 +180,14 @@ watchDebounced(() => [query.username, query.problem], listSubmissions, {
|
|||||||
|
|
||||||
// 监听其他查询条件变化
|
// 监听其他查询条件变化
|
||||||
watch(
|
watch(
|
||||||
() => [query.page, query.limit, query.myself, query.result, query.language],
|
() => [
|
||||||
|
query.page,
|
||||||
|
query.limit,
|
||||||
|
query.myself,
|
||||||
|
query.result,
|
||||||
|
query.language,
|
||||||
|
query.today,
|
||||||
|
],
|
||||||
listSubmissions,
|
listSubmissions,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -400,20 +410,19 @@ const flowchartColumns: DataTableColumn<FlowchartSubmissionListItem>[] = [
|
|||||||
</n-button>
|
</n-button>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
</n-form>
|
</n-form>
|
||||||
<n-form
|
<n-tag
|
||||||
:show-feedback="false"
|
|
||||||
inline
|
|
||||||
label-placement="left"
|
|
||||||
v-if="todayCount > 0"
|
v-if="todayCount > 0"
|
||||||
|
checkable
|
||||||
|
:checked="query.today === '1'"
|
||||||
|
type="success"
|
||||||
|
size="large"
|
||||||
|
@update:checked="(v: boolean) => (query.today = v ? '1' : '0')"
|
||||||
>
|
>
|
||||||
<n-form-item>
|
<n-gradient-text v-if="query.today !== '1'" type="success"
|
||||||
<n-button text>
|
>今日提交数:{{ todayCount }}</n-gradient-text
|
||||||
<component :is="isDesktop ? NH2 : NText" class="today-count">
|
>
|
||||||
<n-gradient-text>今日提交数:{{ todayCount }}</n-gradient-text>
|
<template v-else>今日提交数:{{ todayCount }}</template>
|
||||||
</component>
|
</n-tag>
|
||||||
</n-button>
|
|
||||||
</n-form-item>
|
|
||||||
</n-form>
|
|
||||||
</n-space>
|
</n-space>
|
||||||
<n-data-table
|
<n-data-table
|
||||||
v-if="query.language === 'Flowchart'"
|
v-if="query.language === 'Flowchart'"
|
||||||
@@ -486,10 +495,6 @@ const flowchartColumns: DataTableColumn<FlowchartSubmissionListItem>[] = [
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.today-count {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.flowchart-iframe {
|
.flowchart-iframe {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -412,6 +412,7 @@ export interface SubmissionListPayload {
|
|||||||
contest_id?: string
|
contest_id?: string
|
||||||
problem_id?: string
|
problem_id?: string
|
||||||
language: LANGUAGE | ""
|
language: LANGUAGE | ""
|
||||||
|
today?: "1" | "0"
|
||||||
page: number
|
page: number
|
||||||
limit: number
|
limit: number
|
||||||
offset: number
|
offset: number
|
||||||
|
|||||||
Reference in New Issue
Block a user