fix: 修复历史记录页面 renderPagination 未定义错误

Coze-Commit-Type: user
Coze-User-ID: 3722323274763196
Coze-Conversation-ID: 9894087
This commit is contained in:
user9994793890
2026-07-13 14:34:11 +08:00
parent d57776e11d
commit bce03557dd
2 changed files with 36 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -2251,6 +2251,42 @@
}).join('');
}
// 渲染分页控件
function renderPagination(page, pageSize, total) {
const container = document.getElementById('history-pagination');
if (!container) return;
const totalPages = Math.ceil(total / pageSize);
if (totalPages <= 1) {
container.innerHTML = '';
return;
}
let html = '<div class="pagination">';
// 上一页
if (page > 1) {
html += `<button onclick="loadHistoryWithDate(${page - 1})">上一页</button>`;
}
// 页码
for (let i = 1; i <= totalPages; i++) {
if (i === page) {
html += `<button class="active">${i}</button>`;
} else {
html += `<button onclick="loadHistoryWithDate(${i})">${i}</button>`;
}
}
// 下一页
if (page < totalPages) {
html += `<button onclick="loadHistoryWithDate(${page + 1})">下一页</button>`;
}
html += '</div>';
container.innerHTML = html;
}
// 加载历史记录(无日期筛选)
async function loadHistory(page = 1) {
loadHistoryWithDate(page);