Commit c45b3551 by liangjianmin

refactor(stockRecheck): 优化数据列表处理逻辑,提升分页体验

- 在获取数据时,优化了列表赋值逻辑,确保第一页直接赋值,后续分页使用concat
- 添加了数据重置功能,提升了数据管理的清晰性和用户体验
parent 6e13fa74
Showing with 7 additions and 1 deletions
......@@ -209,7 +209,12 @@
if (res.code === 0) {
if (res.data.list.length > 0) {
this.hasMoreData = true;
this.list = this.list.concat(res.data.list);
// 第一页直接赋值,分页时使用concat
if (this.page === 1) {
this.list = res.data.list;
} else {
this.list = this.list.concat(res.data.list);
}
this.filter_list = createArray(this.list.length, false);
} else {
this.hasMoreData = false;
......@@ -249,6 +254,7 @@
});
setTimeout(() => {
this.filter_id = [];
this.resetChange(); // 重置数据
this.getData();
}, 2000);
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment