From 1f812a52585310e3f22f3542af976344f482c78b Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 6 Feb 2025 08:30:27 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E9=87=8D=E6=9E=84=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E9=80=89=E9=A1=B9=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=BF=87=E6=BB=A4=E8=A1=A8=E5=8D=95=E5=92=8C=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/styles.scss | 3 +- src/views/torrent/TorrentCardListView.vue | 138 +++++++------------ src/views/torrent/TorrentRowListView.vue | 154 +++++++++++++++++++++- 3 files changed, 200 insertions(+), 95 deletions(-) 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 }) {