This commit is contained in:
2025-10-03 02:23:49 +08:00
parent 20996a8171
commit df72936d9f

View File

@@ -55,10 +55,12 @@ const { query, clearQuery } = usePagination<ProblemQuery>({
async function getAuthorOptions() { async function getAuthorOptions() {
authorOptions.value = [{ label: "全部", value: "" }] authorOptions.value = [{ label: "全部", value: "" }]
const res = await getAuthors() const res = await getAuthors()
const remotes = res.data.map((item: {username: string, problem_count: number}) => ({ const remotes = res.data.map(
(item: { username: string; problem_count: number }) => ({
label: `${item.username} (${item.problem_count})`, label: `${item.username} (${item.problem_count})`,
value: item.username, value: item.username,
})) }),
)
authorOptions.value = [...authorOptions.value, ...remotes] authorOptions.value = [...authorOptions.value, ...remotes]
} }
@@ -242,18 +244,22 @@ function rowProps(row: ProblemFiltered) {
<n-form-item> <n-form-item>
<n-flex align="center"> <n-flex align="center">
<n-button @click="clearQuery" quaternary>重置</n-button> <n-button @click="clearQuery" quaternary>重置</n-button>
<n-button @click="getRandom" quaternary v-if="isDesktop">试试手气</n-button> <n-button @click="getRandom" quaternary>试试手气</n-button>
</n-flex> </n-flex>
</n-form-item> </n-form-item>
</n-form> <n-button
</div> @click="toggleShowTag()"
<n-button @click="toggleShowTag()" quaternary icon-placement="right"> quaternary
icon-placement="right"
>
<template #icon> <template #icon>
<Icon v-if="showTag" icon="ph:caret-down"></Icon> <Icon v-if="showTag" icon="ph:caret-down"></Icon>
<Icon v-else icon="ph:caret-up"></Icon> <Icon v-else icon="ph:caret-up"></Icon>
</template> </template>
标签 标签
</n-button> </n-button>
</n-form>
</div>
</n-flex> </n-flex>
<Hitokoto v-if="isDesktop" /> <Hitokoto v-if="isDesktop" />
</n-flex> </n-flex>