update
Deploy / deploy (push) Canceled after 0s

This commit is contained in:
xuyue committed 2026-09-27 19:36:28 +08:00
1 parent 23844ae301
commit d25b5dbe6d
268 files changed
+3684 -8861

No files matched your search

+10 -41
View File
@@ -25,9 +25,7 @@ const [show, toggleShow] = useToggle(false)
const { isDesktop } = useBreakpoints()
const isDefaultAvatar = computed(
() => profile.value?.avatar.endsWith("default.png") ?? true,
)
const isDefaultAvatar = computed(() => profile.value?.avatar.endsWith("default.png") ?? true)
const problemsFlexRef = useTemplateRef<HTMLElement>("problemsFlexRef")
const itemsPerRow = ref(8)
@@ -55,9 +53,7 @@ const visibleProblems = computed(() =>
show.value ? problems.value : problems.value.slice(0, itemsPerRow.value * 3),
)
const hasMoreProblems = computed(
() => problems.value.length > itemsPerRow.value * 3,
)
const hasMoreProblems = computed(() => problems.value.length > itemsPerRow.value * 3)
async function init() {
toggle(true)
@@ -92,9 +88,7 @@ async function init() {
// 插一项进去会打乱既有索引。成就摘要取不到也不该影响整个个人主页
async function loadAchievementSummary() {
try {
const res = await getAchievementSummary(
(route.query.name as string) || undefined,
)
const res = await getAchievementSummary((route.query.name as string) || undefined)
achievementSummary.value = res
} catch {
achievementSummary.value = null
@@ -145,13 +139,7 @@ onMounted(() => {
})
</script>
<template>
<n-flex
class="wrapper"
vertical
justify="center"
align="center"
v-if="!loading && profile"
>
<n-flex class="wrapper" vertical justify="center" align="center" v-if="!loading && profile">
<n-image
:width="140"
:height="140"
@@ -207,20 +195,14 @@ onMounted(() => {
</n-grid>
<!-- 成就摘要 -->
<n-card
v-if="!loading && profile && achievementSummary"
class="wrapper"
hoverable
>
<n-card v-if="!loading && profile && achievementSummary" class="wrapper" hoverable>
<n-flex align="center" justify="space-between">
<n-flex align="center" :size="12">
<span class="achievement-title">
成就 {{ achievementSummary.unlocked }} /
{{ achievementSummary.total }}
</span>
<n-tag size="small" type="info">
{{ achievementSummary.percent }}%
</n-tag>
<n-tag size="small" type="info"> {{ achievementSummary.percent }}% </n-tag>
</n-flex>
<n-button
text
@@ -236,9 +218,7 @@ onMounted(() => {
</n-button>
</n-flex>
<n-flex align="center" :size="10" class="achievement-recent">
<n-text v-if="achievementSummary.recent.length" depth="3">
最近获得
</n-text>
<n-text v-if="achievementSummary.recent.length" depth="3"> 最近获得 </n-text>
<n-tooltip v-for="a in achievementSummary.recent" :key="a.id">
<template #trigger>
<span class="achievement-icon">
@@ -247,9 +227,7 @@ onMounted(() => {
</template>
{{ a.name }}
</n-tooltip>
<n-text v-if="!achievementSummary.recent.length" depth="3">
还没有获得成就
</n-text>
<n-text v-if="!achievementSummary.recent.length" depth="3"> 还没有获得成就 </n-text>
</n-flex>
</n-card>
@@ -258,23 +236,14 @@ onMounted(() => {
<template #label>
<n-flex justify="space-between" align="center">
<span>已解决的题目</span>
<n-button
text
type="primary"
v-if="hasMoreProblems"
@click="toggleShow(!show)"
>
<n-button text type="primary" v-if="hasMoreProblems" @click="toggleShow(!show)">
{{ show ? "隐藏全部" : "显示全部" }}
</n-button>
</n-flex>
</template>
<div ref="problemsFlexRef">
<n-flex>
<n-button
v-for="id in visibleProblems"
:key="id"
@click="router.push('/problem/' + id)"
>
<n-button v-for="id in visibleProblems" :key="id" @click="router.push('/problem/' + id)">
{{ id }}
</n-button>
</n-flex>
+2 -10
View File
@@ -1,10 +1,6 @@
<template>
<n-list v-if="messages.length">
<n-list-item
:style="{ overflow: 'auto' }"
v-for="(item, index) in messages"
:key="index"
>
<n-list-item :style="{ overflow: 'auto' }" v-for="(item, index) in messages" :key="index">
<n-flex size="large" vertical>
<n-flex align="center">
<div>发送时间</div>
@@ -36,11 +32,7 @@
</n-list-item>
</n-list>
<n-empty v-else description="没有消息"></n-empty>
<Pagination
v-model:limit="query.limit"
v-model:page="query.page"
:total="total"
/>
<Pagination v-model:limit="query.limit" v-model:page="query.page" :total="total" />
</template>
<script lang="ts" setup>
import { getMessageList } from "oj/api"
+1 -4
View File
@@ -5,10 +5,7 @@ import { useUserStore } from "shared/store/user"
const userStore = useUserStore()
const message = useMessage()
async function beforeUpload(data: {
file: UploadFileInfo
fileList: UploadFileInfo[]
}) {
async function beforeUpload(data: { file: UploadFileInfo; fileList: UploadFileInfo[] }) {
if (!data.file.file) return false
if (data.file.file.size > 2 * 1024 * 1024) {
message.warning("图片太大啦!不能超过 2 MB 啊")