mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-09 01:36:45 +08:00
Update grid-template-columns in TorrentCardListView and SubscribeListView components
This commit is contained in:
@@ -81,7 +81,7 @@ onMounted(() => {
|
|||||||
// 数据分组
|
// 数据分组
|
||||||
const groupMap = new Map<string, Context[]>()
|
const groupMap = new Map<string, Context[]>()
|
||||||
// 遍历数据
|
// 遍历数据
|
||||||
props.items?.forEach((item) => {
|
props.items?.forEach(item => {
|
||||||
const { torrent_info } = item
|
const { torrent_info } = item
|
||||||
// init options
|
// init options
|
||||||
initOptions(item)
|
initOptions(item)
|
||||||
@@ -91,8 +91,7 @@ onMounted(() => {
|
|||||||
// 已入库相同标题和大小的分组,将当前上下文信息添加到分组中
|
// 已入库相同标题和大小的分组,将当前上下文信息添加到分组中
|
||||||
const group = groupMap.get(key)
|
const group = groupMap.get(key)
|
||||||
group?.push(item)
|
group?.push(item)
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// 创建新的分组,并将当前上下文信息添加到分组中
|
// 创建新的分组,并将当前上下文信息添加到分组中
|
||||||
groupMap.set(key, [item])
|
groupMap.set(key, [item])
|
||||||
}
|
}
|
||||||
@@ -110,32 +109,31 @@ watchEffect(() => {
|
|||||||
const match = (filter: Array<string>, value: string | undefined) =>
|
const match = (filter: Array<string>, value: string | undefined) =>
|
||||||
filter.length === 0 || (value && filter.includes(value))
|
filter.length === 0 || (value && filter.includes(value))
|
||||||
|
|
||||||
groupedDataList.value?.forEach((value) => {
|
groupedDataList.value?.forEach(value => {
|
||||||
if (value.length > 0) {
|
if (value.length > 0) {
|
||||||
const matchData = value.filter((data) => {
|
const matchData = value.filter(data => {
|
||||||
const { meta_info, torrent_info } = data
|
const { meta_info, torrent_info } = data
|
||||||
// 季、制作组、视频编码
|
// 季、制作组、视频编码
|
||||||
return (
|
return (
|
||||||
// 站点过滤
|
// 站点过滤
|
||||||
match(filterForm.site, torrent_info.site_name)
|
match(filterForm.site, torrent_info.site_name) &&
|
||||||
// 促销状态过滤
|
// 促销状态过滤
|
||||||
&& match(filterForm.freeState, torrent_info.volume_factor)
|
match(filterForm.freeState, torrent_info.volume_factor) &&
|
||||||
// 季过滤
|
// 季过滤
|
||||||
&& match(filterForm.season, meta_info.season_episode)
|
match(filterForm.season, meta_info.season_episode) &&
|
||||||
// 制作组过滤
|
// 制作组过滤
|
||||||
&& match(filterForm.releaseGroup, meta_info.resource_team)
|
match(filterForm.releaseGroup, meta_info.resource_team) &&
|
||||||
// 视频编码过滤
|
// 视频编码过滤
|
||||||
&& match(filterForm.videoCode, meta_info.video_encode)
|
match(filterForm.videoCode, meta_info.video_encode) &&
|
||||||
// 分辨率过滤
|
// 分辨率过滤
|
||||||
&& match(filterForm.resolution, meta_info.resource_pix)
|
match(filterForm.resolution, meta_info.resource_pix) &&
|
||||||
// 质量过滤
|
// 质量过滤
|
||||||
&& match(filterForm.edition, meta_info.edition)
|
match(filterForm.edition, meta_info.edition)
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
if (matchData.length > 0) {
|
if (matchData.length > 0) {
|
||||||
const firstData = _.cloneDeepWith(matchData[0]) as SearchTorrent
|
const firstData = _.cloneDeepWith(matchData[0]) as SearchTorrent
|
||||||
if (matchData.length > 1)
|
if (matchData.length > 1) firstData.more = matchData.slice(1)
|
||||||
firstData.more = matchData.slice(1)
|
|
||||||
|
|
||||||
dataList.value.push(firstData)
|
dataList.value.push(firstData)
|
||||||
}
|
}
|
||||||
@@ -236,7 +234,7 @@ watchEffect(() => {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.grid-torrent-card {
|
.grid-torrent-card {
|
||||||
grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
|
||||||
padding-block-end: 1rem;
|
padding-block-end: 1rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ const filteredDataList = computed(() => {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.grid-subscribe-card {
|
.grid-subscribe-card {
|
||||||
grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
|
||||||
padding-block-end: 1rem;
|
padding-block-end: 1rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user