fix(cache): 小屏识别缓存改为单列表切换避免影视音乐重叠

This commit is contained in:
jxxghp
2026-08-15 12:42:03 +08:00
parent 17f26408eb
commit 937d28b944
+18 -5
View File
@@ -65,11 +65,17 @@ const statusOptions = computed(() => [
{ title: t('setting.cache.unrecognizedOnly'), value: 'unrecognized' },
])
const typeOptions = computed(() => [
{ title: t('setting.cache.recognitionTypeOptions.all'), value: 'all' },
{ title: t('setting.cache.recognitionTypeOptions.media'), value: 'media' },
{ title: t('setting.cache.recognitionTypeOptions.music'), value: 'music' },
])
const typeOptions = computed(() => {
const options = [
{ title: t('setting.cache.recognitionTypeOptions.media'), value: 'media' },
{ title: t('setting.cache.recognitionTypeOptions.music'), value: 'music' },
]
// 小屏幕下不提供"全部"选项,避免两个列表同时渲染导致重叠
if (!isMobile.value) {
options.unshift({ title: t('setting.cache.recognitionTypeOptions.all'), value: 'all' })
}
return options
})
// 影视与音乐缓存统计汇总展示
const totalCount = computed(() => cacheData.value.count + musicCacheData.value.count)
@@ -334,6 +340,13 @@ onMounted(() => {
void loadCacheData()
})
// 小屏幕下切换到"全部"时回退为影视,避免两个列表同时渲染
watch(isMobile, mobile => {
if (mobile && typeFilter.value === 'all') {
typeFilter.value = 'media'
}
}, { immediate: true })
watch([searchFilter, statusFilter, typeFilter], () => {
resetMobilePagination()
})