diff --git a/ruoyi-admin/src/main/resources/templates/home/public_view.html b/ruoyi-admin/src/main/resources/templates/home/public_view.html index 5422c2a..63c6487 100644 --- a/ruoyi-admin/src/main/resources/templates/home/public_view.html +++ b/ruoyi-admin/src/main/resources/templates/home/public_view.html @@ -101,7 +101,7 @@
首页 >  - + 专题活动
diff --git a/ruoyi-admin/src/main/resources/templates/home/special_view.html b/ruoyi-admin/src/main/resources/templates/home/special_view.html index 60b6b6b..f7ba247 100644 --- a/ruoyi-admin/src/main/resources/templates/home/special_view.html +++ b/ruoyi-admin/src/main/resources/templates/home/special_view.html @@ -357,7 +357,7 @@ defaultSelected: [[${columnId}]], rightList: [], isMoreTitle: true, - itemsPerPage: 5, // 每页显示的项目数 + // itemsPerPage: 5, // 每页显示的项目数 }; }, filters: { @@ -407,8 +407,9 @@ if (res.code == 0) { this.rightList = res.data.map(item => ({ ...item, - isExpanded: false, // 初始化折叠状态 - currentPage: 1 // 初始化当前页码 + isExpanded: false, + currentPage: 1, + itemsPerPage: 5 // 初始化每页显示5条 })); } }.bind(this) @@ -426,8 +427,9 @@ if (res.code == 0) { this.rightList = res.data.map(item => ({ ...item, - isExpanded: false, // 初始化折叠状态 - currentPage: 1 // 初始化当前页码 + isExpanded: false, + currentPage: 1, + itemsPerPage: 5 // 初始化每页显示5条 })); } }.bind(this) @@ -454,8 +456,8 @@ } }, getPaginatedData(item, index) { - const startIndex = (this.rightList[index].currentPage - 1) * this.itemsPerPage; - const endIndex = startIndex + this.itemsPerPage; + const startIndex = (this.rightList[index].currentPage - 1) * this.rightList[index].itemsPerPage; + const endIndex = startIndex + this.rightList[index].itemsPerPage; return item.sysSpecials.list.slice(startIndex, endIndex); }, getTotalPages(item) { @@ -467,13 +469,14 @@ } }, nextPage(index) { - if (this.rightList[index].currentPage < this.getTotalPages(this.rightList[index])) { + const total = this.totalPages(index); + if (this.rightList[index].currentPage < total) { this.rightList[index].currentPage++; } }, handlePageSizeChange(index,itemsPerPage) { this.rightList[index].currentPage = 1; // 切换页大小后重置页码 - this.itemsPerPage = itemsPerPage; + this.rightList[index].itemsPerPage = itemsPerPage; // 直接更新当前列表项的属性 }, paginatedData(index) { const item = this.rightList[index]; @@ -483,7 +486,7 @@ }, totalPages(index) { const item = this.rightList[index]; - return Math.ceil(item.sysSpecials.list.length / this.itemsPerPage); + return Math.ceil(item.sysSpecials.list.length / item.itemsPerPage); } } })