mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-08-03 12:27:10 +08:00
bangumi添加年份过滤选项
This commit is contained in:
@@ -31,6 +31,13 @@ const bangumiSortDict = {
|
|||||||
'date': '日期',
|
'date': '日期',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 年份字典,自动生成最近10年
|
||||||
|
const yearDict: Record<number, number> = {}
|
||||||
|
const currentYear = new Date().getFullYear()
|
||||||
|
for (let i = 0; i < 10; i++) {
|
||||||
|
yearDict[currentYear - i] = currentYear - i
|
||||||
|
}
|
||||||
|
|
||||||
// 当前Key
|
// 当前Key
|
||||||
const currentKey = ref(0)
|
const currentKey = ref(0)
|
||||||
|
|
||||||
@@ -76,6 +83,23 @@ watch([filterParams], () => {
|
|||||||
</VChip>
|
</VChip>
|
||||||
</VChipGroup>
|
</VChipGroup>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex justify-start align-center">
|
||||||
|
<div class="mr-5">
|
||||||
|
<VLabel>年份</VLabel>
|
||||||
|
</div>
|
||||||
|
<VChipGroup v-model="filterParams.year">
|
||||||
|
<VChip
|
||||||
|
:color="filterParams.year == key ? 'primary' : ''"
|
||||||
|
filter
|
||||||
|
tile
|
||||||
|
:value="key"
|
||||||
|
v-for="(value, key) in yearDict"
|
||||||
|
:key="key"
|
||||||
|
>
|
||||||
|
{{ value }}
|
||||||
|
</VChip>
|
||||||
|
</VChipGroup>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<MediaCardListView :key="currentKey" apipath="bangumi/subjects" :params="filterParams" />
|
<MediaCardListView :key="currentKey" apipath="bangumi/subjects" :params="filterParams" />
|
||||||
|
|||||||
Reference in New Issue
Block a user