fixed #2832
This commit is contained in:
parent
57fe55624e
commit
b34e09b8f9
3 changed files with 136 additions and 50 deletions
|
@ -522,7 +522,8 @@
|
|||
});
|
||||
return data;
|
||||
},
|
||||
handleSort (index, type) {
|
||||
handleSort (_index, type) {
|
||||
const index = this.GetOriginalIndex(_index);
|
||||
this.cloneColumns.forEach((col) => col._sortType = 'normal');
|
||||
|
||||
const key = this.cloneColumns[index].key;
|
||||
|
@ -582,11 +583,23 @@
|
|||
this.cloneColumns[index]._filterVisible = false;
|
||||
this.$emit('on-filter-change', column);
|
||||
},
|
||||
handleFilterSelect (index, value) {
|
||||
/**
|
||||
* #2832
|
||||
* 应该区分当前表头的 column 是左固定还是右固定
|
||||
* 否则执行到 $parent 时,方法的 index 与 cloneColumns 的 index 是不对应的
|
||||
* 左固定和右固定,要区分对待
|
||||
* 所以,此方法用来获取正确的 index
|
||||
* */
|
||||
GetOriginalIndex (_index) {
|
||||
return this.cloneColumns.findIndex(item => item._index === _index);
|
||||
},
|
||||
handleFilterSelect (_index, value) {
|
||||
const index = this.GetOriginalIndex(_index);
|
||||
this.cloneColumns[index]._filterChecked = [value];
|
||||
this.handleFilter(index);
|
||||
},
|
||||
handleFilterReset (index) {
|
||||
handleFilterReset (_index) {
|
||||
const index = this.GetOriginalIndex(_index);
|
||||
this.cloneColumns[index]._isFiltered = false;
|
||||
this.cloneColumns[index]._filterVisible = false;
|
||||
this.cloneColumns[index]._filterChecked = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue