From b7bb5f85a31a4de1a3d47c4f8b7771615ab095f4 Mon Sep 17 00:00:00 2001 From: buvta <12312540+buvta@users.noreply.github.com> Date: Tue, 10 Nov 2020 00:08:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E5=90=8C=E6=97=B6=E7=94=A8=E5=A4=9A=E4=B8=AA=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Film.vue | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/components/Film.vue b/src/components/Film.vue index 6744a96..d27a0b8 100644 --- a/src/components/Film.vue +++ b/src/components/Film.vue @@ -141,9 +141,11 @@
@@ -164,6 +168,8 @@ @@ -174,18 +180,23 @@ width="100"> + prop="area" + :filters="getFilters('area')" + :filter-method="(value, row, column) => { this.currentColumn = column; return value === row.area }" + label="地区" + align="center" + width="100"> + :filters="getFilters('lang')" + :filter-method="(value, row, column) => { this.currentColumn = column; return value === row.lang }" + prop="lang" + label="语言" + align="center" + width="100"> @@ -237,6 +248,7 @@ export default { searchList: [], searchTxt: '', searchContents: [], + currentColumn: '', searchGroup: '', searchGroups: [], // 福利片关键词 @@ -326,8 +338,18 @@ export default { return date.split(/\s/)[0] }, getFilters (column) { + if (column === 'siteName') return [...new Set(this.searchContents.map(row => row.site.name))].map(e => { return { text: e, value: e } }) // 有方法合并这两行吗? return [...new Set(this.searchContents.map(row => row[column]))].map(e => { return { text: e, value: e } }) }, + filterChange (filters) { + // 一次只能一列 + if (Object.values(filters)[0].length) { + const otherColumns = this.$refs.searchResultTable.columns.filter(col => col.id !== this.currentColumn.id) + otherColumns.forEach(col => { col.filterable = false }) + } else { + this.$refs.searchResultTable.columns.forEach(col => { col.filterable = true }) + } + }, siteClick (siteName) { this.list = [] this.site = this.sites.find(x => x.name === siteName)