feat(frontend): 分页 pageSize 持久化到 localStorage,刷新后自动恢复

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
QTom
2026-03-18 10:53:27 +08:00
parent 9f6ab6b817
commit dfe99507b8
15 changed files with 57 additions and 14 deletions

View File

@@ -1035,6 +1035,7 @@
import { useAppStore } from '@/stores/app'
import { useOnboardingStore } from '@/stores/onboarding'
import { useClipboard } from '@/composables/useClipboard'
import { getPersistedPageSize } from '@/composables/usePersistedPageSize'
const { t } = useI18n()
import { keysAPI, authAPI, usageAPI, userGroupsAPI } from '@/api'
@@ -1101,7 +1102,7 @@ const userGroupRates = ref<Record<number, number>>({})
const pagination = ref({
page: 1,
page_size: 10,
page_size: getPersistedPageSize(),
total: 0,
pages: 0
})

View File

@@ -496,6 +496,7 @@ import Icon from '@/components/icons/Icon.vue'
import type { UsageLog, ApiKey, UsageQueryParams, UsageStatsResponse } from '@/types'
import type { Column } from '@/components/common/types'
import { formatDateTime, formatReasoningEffort } from '@/utils/format'
import { getPersistedPageSize } from '@/composables/usePersistedPageSize'
import { formatTokenPricePerMillion } from '@/utils/usagePricing'
import { getUsageServiceTierLabel } from '@/utils/usageServiceTier'
import { resolveUsageRequestType } from '@/utils/usageRequestType'
@@ -584,7 +585,7 @@ const onDateRangeChange = (range: {
const pagination = reactive({
page: 1,
page_size: 20,
page_size: getPersistedPageSize(),
total: 0,
pages: 0
})