新增内容库每页数量选择功能

- 添加每页数量选择下拉框(20/50/100/200/500条)
- 默认100条,用户可自由选择
This commit is contained in:
2026-07-14 00:16:25 +08:00
parent 00609980a8
commit 1a2d6ada88
3 changed files with 24 additions and 1 deletions
+9
View File
@@ -102,6 +102,15 @@
cursor: pointer;
}
.page-size-select {
padding: 10px 15px;
border: 1px solid #ddd;
border-radius: 6px;
font-size: 14px;
background: white;
cursor: pointer;
}
.toolbar-right {
display: flex;
gap: 10px;
+8 -1
View File
@@ -4,7 +4,7 @@ const API_BASE = '';
// 状态
let articles = [];
let currentPage = 1;
let pageSize = 100; // 增加每页数量
let pageSize = 100;
let totalCount = 0;
let selectedIds = new Set();
let currentArticleId = null;
@@ -31,6 +31,13 @@ document.addEventListener('DOMContentLoaded', () => {
});
});
// 改变每页数量
function changePageSize() {
pageSize = parseInt(document.getElementById('page-size').value);
currentPage = 1;
loadArticles();
}
// 加载文章列表
async function loadArticles() {
const keyword = document.getElementById('search-input').value.trim();