diff --git a/src/components/Film.vue b/src/components/Film.vue index ed7cbe1..372febe 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -20,14 +20,6 @@ :value="item.name"> - - - - +
+ + + + + + + + + + 上映区间: + + 至 + + +
(this.selectedAreas.length === 0) || this.selectedAreas.includes(x.area)) - filteredData = filteredData.filter(res => !this.setting.excludeR18Films || !this.containsR18Keywords(res.type)) - return filteredData } }, filters: { @@ -398,12 +411,29 @@ export default { }, filterSettings () { this.siteClick(this.site.name) + }, + list: { + handler (list) { + this.selectedClassName = this.type.name + ' ' + list.length + '/' + this.recordcount + if (!list.length) return + this.areas = [...new Set(list.map(ele => ele.area))].filter(x => x) + this.langs = [...new Set(list.map(ele => ele.lang))].filter(x => x) + this.refreshFilteredList() + }, + deep: true } }, methods: { ...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE', 'SET_SETTING']), - getAreas () { - this.areas = [...new Set(this.list.map(ele => ele.area))].filter(x => x) + refreshFilteredList () { + var filteredData = this.list.filter(x => (this.selectedAreas.length === 0) || this.selectedAreas.includes(x.area)) + filteredData = filteredData.filter(x => (this.selectedLangs.length === 0) || this.selectedLangs.includes(x.lang)) + filteredData = filteredData.filter(res => !this.setting.excludeR18Films || !this.containsR18Keywords(res.type)) + filteredData = filteredData.filter(res => res.year >= this.selectedYears.start) + filteredData = filteredData.filter(res => res.year <= this.selectedYears.end) + this.areas = [...new Set(filteredData.map(ele => ele.area))].filter(x => x) + this.langs = [...new Set(filteredData.map(ele => ele.lang))].filter(x => x) + this.filteredList = filteredData }, updateSearchViewMode () { setting.find().then(res => { @@ -541,8 +571,6 @@ export default { if (this.$refs.filmWaterfall) { this.$refs.filmWaterfall.refresh() } - // 更新地区信息 - this.getAreas() // 更新缓存数据 const cacheKey = this.site.key + '@' + typeTid FILM_DATA_CACHE[cacheKey] = { diff --git a/src/lib/element/index.js b/src/lib/element/index.js index 3a36e61..f366367 100644 --- a/src/lib/element/index.js +++ b/src/lib/element/index.js @@ -1,5 +1,5 @@ import Vue from 'vue' -import { Message, Button, Table, TableColumn, Tag, Input, Dialog, Form, FormItem, Switch, Select, Option, Checkbox, Autocomplete, Col, Tree } from 'element-ui' +import { Message, Button, Table, TableColumn, Tag, Input, InputNumber, Dialog, Form, FormItem, Switch, Select, Option, Checkbox, Autocomplete, Col, Tree } from 'element-ui' import Plugin from 'v-fit-columns' Vue.use(Button) Vue.use(Col) @@ -7,6 +7,7 @@ Vue.use(Table) Vue.use(TableColumn) Vue.use(Tag) Vue.use(Input) +Vue.use(InputNumber) Vue.use(Dialog) Vue.use(Form) Vue.use(FormItem)