Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 【监控】处理套餐搜索页面搜索结果页面数量显示不正确 --Bug=137445509 #4892

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,21 @@ class Container extends Mixins(authorityMixinCreate(ruleAuth)) {

private emptyType: EmptyStatusType = 'empty';

/** 搜索的时候前端过滤出来的数据 */
get filterData() {
return this.data.filter(
item =>
String(item.name).toLocaleLowerCase().includes(this.keyword.toLocaleLowerCase()) ||
String(item.plugin_name).toLocaleLowerCase().includes(this.keyword.toLocaleLowerCase()) ||
String(item.update_user).toLocaleLowerCase().includes(this.keyword.toLocaleLowerCase())
);
}
/** 表格中每一页需要展示的数据 */
get tableData() {
return this.data
.filter(
item =>
String(item.name).toLocaleLowerCase().includes(this.keyword.toLocaleLowerCase()) ||
String(item.plugin_name).toLocaleLowerCase().includes(this.keyword.toLocaleLowerCase()) ||
String(item.update_user).toLocaleLowerCase().includes(this.keyword.toLocaleLowerCase())
)
.slice(this.pagination.limit * (this.pagination.current - 1), this.pagination.limit * this.pagination.current);
return this.filterData.slice(
this.pagination.limit * (this.pagination.current - 1),
this.pagination.limit * this.pagination.current
);
}

activated() {
Expand Down Expand Up @@ -141,6 +147,7 @@ class Container extends Mixins(authorityMixinCreate(ruleAuth)) {
handleSearch(v: string) {
this.pagination.current = 1;
this.keyword = v;
this.pagination.count = this.filterData.length;
this.emptyType = v ? 'search-empty' : 'empty';
}
// message组件
Expand Down