diff --git a/src/styles/styles.scss b/src/styles/styles.scss index fe0b703f..b3671c10 100644 --- a/src/styles/styles.scss +++ b/src/styles/styles.scss @@ -14,8 +14,9 @@ html.v-overlay-scroll-blocked { } #nprogress .peg { + width: 5px; box-shadow: 0 0 10px rgb(var(--v-theme-primary)), 0 0 5px rgb(var(--v-theme-primary)) !important; - transform: rotate(0deg) translate(0, -1px); + transform: rotate(0deg) translate(0, -2px); } .v-toast--bottom { diff --git a/src/views/torrent/TorrentCardListView.vue b/src/views/torrent/TorrentCardListView.vue index aea64c54..448634cc 100644 --- a/src/views/torrent/TorrentCardListView.vue +++ b/src/views/torrent/TorrentCardListView.vue @@ -14,7 +14,7 @@ const props = defineProps({ }) // 过滤表单 -const filterForm = reactive({ +const filterForm: Record = reactive({ // 站点 site: [] as string[], // 季 @@ -31,20 +31,36 @@ const filterForm = reactive({ resolution: [] as string[], }) -// 获取站点过滤选项 -const siteFilterOptions = ref>([]) -// 获取季过滤选项 -const seasonFilterOptions = ref>([]) -// 获取制作组过滤选项 -const releaseGroupFilterOptions = ref>([]) -// 获取视频编码过滤选项 -const videoCodeFilterOptions = ref>([]) -// 获取促销状态过滤选项 -const freeStateFilterOptions = ref>([]) -// 获取质量过滤选项 -const editionFilterOptions = ref>([]) -// 获取分辨率过滤选项 -const resolutionFilterOptions = ref>([]) +// 过滤项映射(保持中文标题) +const filterTitles: Record = { + site: '站点', + season: '季集', + freeState: '促销状态', + videoCode: '视频编码', + edition: '质量', + resolution: '分辨率', + releaseGroup: '制作组', +} + +// 统一存储过滤选项 +const filterOptions: Record = reactive({ + site: [] as string[], + season: [] as string[], + freeState: [] as string[], + edition: [] as string[], + resolution: [] as string[], + videoCode: [] as string[], + releaseGroup: [] as string[], +}) + +// 非空值的过滤选项 +const filterOptionsNotEmpty = computed(() => { + const options: Record = {} + for (const key in filterOptions) { + if (filterOptions[key].length > 0) options[key] = filterOptions[key] + } + return options +}) // 完整的数据列表 let dataList: SearchTorrent[] @@ -60,19 +76,19 @@ function initOptions(data: Context) { const optionValue = (options: Array, value: string | undefined) => { value && !options.includes(value) && options.push(value) } - optionValue(siteFilterOptions.value, torrent_info?.site_name) - optionValue(seasonFilterOptions.value, meta_info?.season_episode) - optionValue(releaseGroupFilterOptions.value, meta_info?.resource_team) - optionValue(videoCodeFilterOptions.value, meta_info?.video_encode) - optionValue(freeStateFilterOptions.value, torrent_info?.volume_factor) - optionValue(editionFilterOptions.value, meta_info?.edition) - optionValue(resolutionFilterOptions.value, meta_info?.resource_pix) + optionValue(filterOptions.site, torrent_info?.site_name) + optionValue(filterOptions.season, meta_info?.season_episode) + optionValue(filterOptions.releaseGroup, meta_info?.resource_team) + optionValue(filterOptions.videoCode, meta_info?.video_encode) + optionValue(filterOptions.freeState, torrent_info?.volume_factor) + optionValue(filterOptions.edition, meta_info?.edition) + optionValue(filterOptions.resolution, meta_info?.resource_pix) } // 对季过滤选项进行排序 const sortSeasonFilterOptions = computed(() => { // 预解析所有选项 - const parsedOptions = seasonFilterOptions.value.map((option, index) => { + const parsedOptions = filterOptions.season.map((option, index) => { const parseSeasonEpisode = (str: string) => { const match = str.match(/^S(\d+)(?:-S(\d+))?(?:\s*E(\d+)(?:-E(\d+))?)?$/) @@ -268,86 +284,26 @@ function loadMore({ done }: { done: any }) {